Mercurial > repos > workflow4metabolomics > xcms_plot_raw
changeset 0:520448a32548 draft default tip
planemo upload for repository https://github.com/workflow4metabolomics/tools-metabolomics/ commit eca29d4347fe2f4802091c4a06715232a6fd9253
author | workflow4metabolomics |
---|---|
date | Mon, 15 Jul 2024 16:03:26 +0000 |
parents | |
children | |
files | macros_xcms_plot.xml test-data/raw_plot.png test-data/xcms_plot_raw_testdata.mzML xcms_plot_raw.xml |
diffstat | 4 files changed, 305 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/macros_xcms_plot.xml Mon Jul 15 16:03:26 2024 +0000 @@ -0,0 +1,38 @@ +<macros> + <token name="@TOOL_VERSION@">4.0.0</token> + <xml name="creator"> + <creator> + <person + givenName="Wudmir" + familyName="Rojas" + url="https://github.com/wverastegui" + identifier="0000-0001-7036-9987" /> + <person + givenName="Helge" + familyName="Hecht" + url="https://github.com/hechth" + identifier="0000-0001-6744-996X" /> + <organization + url="https://www.recetox.muni.cz/" + email="GalaxyToolsDevelopmentandDeployment@space.muni.cz" + name="RECETOX MUNI"/> + </creator> + </xml> + <xml name="bio.tools"> + <xrefs> + <xref type="bio.tools">XCMS</xref> + </xrefs> + </xml> + <xml name="base_params"> + <param type="data" name="input" format="mzML" label="Input mzML file"/> + <param type="float" name="mz_value" value="10.0" min="0.0" label="m/z Value" help="m/z value for the EIC"/> + <param type="integer" value="10" name="tolerance_ppm" min="0" label="Tolerance (ppm)" help="Tolerance for m/z value in ppm"/> + </xml> + <xml name="citations"> + <citations> + <citation type="doi">10.1021/ac051437y</citation> + <citation type="doi">10.3390/metabo12020173</citation> + <citation type="doi">10.5281/zenodo.11185520</citation> + </citations> + </xml> +</macros> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/xcms_plot_raw_testdata.mzML Mon Jul 15 16:03:26 2024 +0000 @@ -0,0 +1,212 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<indexedmzML xmlns="http://psi.hupo.org/ms/mzml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://psi.hupo.org/ms/mzml http://psidev.info/files/ms/mzML/xsd/mzML1.1.0_idx.xsd"> +<mzML xmlns="http://psi.hupo.org/ms/mzml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://psi.hupo.org/ms/mzml http://psidev.info/files/ms/mzML/xsd/mzML1.1.0.xsd" accession="" version="1.1.0"> + <cvList count="5"> + <cv id="MS" fullName="Proteomics Standards Initiative Mass Spectrometry Ontology" URI="http://psidev.cvs.sourceforge.net/*checkout*/psidev/psi/psi-ms/mzML/controlledVocabulary/psi-ms.obo"/> + <cv id="UO" fullName="Unit Ontology" URI="http://obo.cvs.sourceforge.net/obo/obo/ontology/phenotype/unit.obo"/> + <cv id="BTO" fullName="BrendaTissue545" version="unknown" URI="http://www.brenda-enzymes.info/ontology/tissue/tree/update/update_files/BrendaTissueOBO"/> + <cv id="GO" fullName="Gene Ontology - Slim Versions" version="unknown" URI="http://www.geneontology.org/GO_slims/goslim_goa.obo"/> + <cv id="PATO" fullName="Quality ontology" version="unknown" URI="http://obo.cvs.sourceforge.net/*checkout*/obo/obo/ontology/phenotype/quality.obo"/> + </cvList> + <fileDescription> + <fileContent> + <cvParam cvRef="MS" accession="MS:1000294" name="mass spectrum" /> + </fileContent> + <sourceFileList count="1"> + <sourceFile id="sf_ru_0" name="RCX_06_shortened.mzML" location="file:///C:/Users/473355/Downloads"> + <cvParam cvRef="MS" accession="MS:1000569" name="SHA-1" value="6c9fc5a54e7e588b4940994f66c953de66f8e8c5" /> + <cvParam cvRef="MS" accession="MS:1000584" name="mzML format" /> + <cvParam cvRef="MS" accession="MS:1000777" name="spectrum identifier nativeID format" /> + </sourceFile> + </sourceFileList> + </fileDescription> + <sampleList count="1"> + <sample id="sa_0" name=""> + <cvParam cvRef="MS" accession="MS:1000004" name="sample mass" value="0" unitAccession="UO:0000021" unitName="gram" unitCvRef="UO" /> + <cvParam cvRef="MS" accession="MS:1000005" name="sample volume" value="0" unitAccession="UO:0000098" unitName="milliliter" unitCvRef="UO" /> + <cvParam cvRef="MS" accession="MS:1000006" name="sample concentration" value="0" unitAccession="UO:0000175" unitName="gram per liter" unitCvRef="UO" /> + </sample> + </sampleList> + <softwareList count="2"> + <software id="so_in_0" version="" > + <cvParam cvRef="MS" accession="MS:1000799" name="custom unreleased software tool" value="" /> + </software> + <software id="so_default" version="" > + <cvParam cvRef="MS" accession="MS:1000799" name="custom unreleased software tool" value="" /> + </software> + </softwareList> + <instrumentConfigurationList count="1"> + <instrumentConfiguration id="ic_0"> + <cvParam cvRef="MS" accession="MS:1000031" name="instrument model" /> + <softwareRef ref="so_in_0" /> + </instrumentConfiguration> + </instrumentConfigurationList> + <dataProcessingList count="1"> + <dataProcessing id="dp_sp_0"> + <processingMethod order="0" softwareRef="so_default"> + <cvParam cvRef="MS" accession="MS:1000544" name="Conversion to mzML" /> + <userParam name="warning" type="xsd:string" value="fictional processing method used to fulfill format requirements" /> + </processingMethod> + </dataProcessing> + </dataProcessingList> + <run id="ru_0" defaultInstrumentConfigurationRef="ic_0" sampleRef="sa_0" defaultSourceFileRef="sf_ru_0"> + <userParam name="mzml_id" type="xsd:string" value="MZmine mzML export"/> + <spectrumList count="4" defaultDataProcessingRef="dp_sp_0"> + <spectrum id="scan=126" index="0" defaultArrayLength="31" dataProcessingRef="dp_sp_0"> + <cvParam cvRef="MS" accession="MS:1000128" name="profile spectrum" /> + <cvParam cvRef="MS" accession="MS:1000511" name="ms level" value="1" /> + <cvParam cvRef="MS" accession="MS:1000294" name="mass spectrum" /> + <cvParam cvRef="MS" accession="MS:1000285" name="total ion current" value="6.0450043e09"/> + <cvParam cvRef="MS" accession="MS:1000528" name="lowest observed m/z" value="108.907723264639685" unitAccession="MS:1000040" unitName="m/z" unitCvRef="MS"/> + <cvParam cvRef="MS" accession="MS:1000527" name="highest observed m/z" value="1111.100247713231283" unitAccession="MS:1000040" unitName="m/z" unitCvRef="MS"/> + <userParam name="filter string" type="xsd:string" value="FTMS + p ESI Full ms [110.0000-1100.0000]"/> + <scanList count="1"> + <cvParam cvRef="MS" accession="MS:1000795" name="no combination" /> + <scan > + <cvParam cvRef="MS" accession="MS:1000016" name="scan start time" value="171.55917" unitAccession="UO:0000010" unitName="second" unitCvRef="UO" /> + <userParam name="MS:1000130" type="xsd:string" value=""/> + <scanWindowList count="1"> + <scanWindow> + <cvParam cvRef="MS" accession="MS:1000501" name="scan window lower limit" value="110" unitAccession="MS:1000040" unitName="m/z" unitCvRef="MS" /> + <cvParam cvRef="MS" accession="MS:1000500" name="scan window upper limit" value="1100" unitAccession="MS:1000040" unitName="m/z" unitCvRef="MS" /> + </scanWindow> + </scanWindowList> + </scan> + </scanList> + <binaryDataArrayList count="2"> + <binaryDataArray encodedLength="332"> + <cvParam cvRef="MS" accession="MS:1000514" name="m/z array" unitAccession="MS:1000040" unitName="m/z" unitCvRef="MS" /> + <cvParam cvRef="MS" accession="MS:1000523" name="64-bit float" /> + <cvParam cvRef="MS" accession="MS:1000576" name="no compression" /> + <binary>r5exsg4iY0CIh5zHECJjQFnOh9wSImNAI2xz8RQiY0DoYF8GFyJjQKWsSxsZImNAXU84MBsiY0ANSSVFHSJjQLiZElofImNAXUEAbyEiY0D8P+6DIyJjQJOV3JglImNAJkLLrSciY0DAvI+5WyJjQNE+h85dImNA4Bd/418iY0DqR3f4YSJjQO/Obw1kImNA8qxoImYiY0DPgTgP4yJjQHoaRiTlImNAJgpUOeciY0DTUGJO6SJjQIDucGPrImNAL+N/eO0iY0AdcL2ZPCNjQC+m2a4+I2NARjP2w0AjY0BhFxPZQiNjQIBSMO5EI2NAo+RNA0cjY0A=</binary> + </binaryDataArray> + <binaryDataArray encodedLength="168"> + <cvParam cvRef="MS" accession="MS:1000515" name="intensity array" unitAccession="MS:1000131" unitName="number of detector counts" unitCvRef="MS"/> + <cvParam cvRef="MS" accession="MS:1000521" name="32-bit float" /> + <cvParam cvRef="MS" accession="MS:1000576" name="no compression" /> + <binary>n7xcRxLCpkdqnyZJdS8vSqhE/UqdaFZLB+CHS17TUEvmdfVKVOwpSrriTEnEfoNIuSX9R9s+AkfErrtHYdANSIrABki7tKBH5HDURtM8ekc5hvNHwH4WSPywAkjmQaxHN1ktR2ZZFEeHy8hHHs8kSFVNMEgs2v1HAyl6Rw==</binary> + </binaryDataArray> + </binaryDataArrayList> + </spectrum> + <spectrum id="scan=127" index="1" defaultArrayLength="25"> + <cvParam cvRef="MS" accession="MS:1000128" name="profile spectrum" /> + <cvParam cvRef="MS" accession="MS:1000511" name="ms level" value="1" /> + <cvParam cvRef="MS" accession="MS:1000294" name="mass spectrum" /> + <cvParam cvRef="MS" accession="MS:1000285" name="total ion current" value="7.4992742e09"/> + <cvParam cvRef="MS" accession="MS:1000528" name="lowest observed m/z" value="108.907733023156396" unitAccession="MS:1000040" unitName="m/z" unitCvRef="MS"/> + <cvParam cvRef="MS" accession="MS:1000527" name="highest observed m/z" value="1111.100738826513407" unitAccession="MS:1000040" unitName="m/z" unitCvRef="MS"/> + <userParam name="filter string" type="xsd:string" value="FTMS + p ESI Full ms [110.0000-1100.0000]"/> + <scanList count="1"> + <cvParam cvRef="MS" accession="MS:1000795" name="no combination" /> + <scan > + <cvParam cvRef="MS" accession="MS:1000016" name="scan start time" value="171.92241" unitAccession="UO:0000010" unitName="second" unitCvRef="UO" /> + <userParam name="MS:1000130" type="xsd:string" value=""/> + <scanWindowList count="1"> + <scanWindow> + <cvParam cvRef="MS" accession="MS:1000501" name="scan window lower limit" value="110" unitAccession="MS:1000040" unitName="m/z" unitCvRef="MS" /> + <cvParam cvRef="MS" accession="MS:1000500" name="scan window upper limit" value="1100" unitAccession="MS:1000040" unitName="m/z" unitCvRef="MS" /> + </scanWindow> + </scanWindowList> + </scan> + </scanList> + <binaryDataArrayList count="2"> + <binaryDataArray encodedLength="268"> + <cvParam cvRef="MS" accession="MS:1000514" name="m/z array" unitAccession="MS:1000040" unitName="m/z" unitCvRef="MS" /> + <cvParam cvRef="MS" accession="MS:1000523" name="64-bit float" /> + <cvParam cvRef="MS" accession="MS:1000576" name="no compression" /> + <binary>dPjCarchY0C7p59/uSFjQPetfJS7IWNAKgtaqb0hY0BUvze+vyFjQHPKFdPBIWNAiiz058MhY0Bu8yXYDiJjQFnnEO0QImNAPTL8ARMiY0Ab1OcWFSJjQPPM0ysXImNAwxzAQBkiY0COw6xVGyJjQFPBmWodImNAEBaHfx8iY0DIwXSUISJjQHrEYqkjImNAJR5RviUiY0AdSg3KWSJjQEd5BN9bImNAa//7810iY0CN3PMIYCJjQKsQ7B1iImNAxJvkMmQiY0A=</binary> + </binaryDataArray> + <binaryDataArray encodedLength="136"> + <cvParam cvRef="MS" accession="MS:1000515" name="intensity array" unitAccession="MS:1000131" unitName="number of detector counts" unitCvRef="MS"/> + <cvParam cvRef="MS" accession="MS:1000521" name="32-bit float" /> + <cvParam cvRef="MS" accession="MS:1000576" name="no compression" /> + <binary>weaTRwOtJUhmbmtIh5J4SCCxVEjhYRNIjwmRR+TAMEdkshZIpwk/SSEqK0oxl+hKWLdCS2T2dEsDhjxLo73dSiRWF0r3fBRJ/KUYRzb5mkf1fQ5IkJ9ASD4EO0hfe+dHrvn+Rg==</binary> + </binaryDataArray> + </binaryDataArrayList> + </spectrum> + <spectrum id="scan=128" index="2" defaultArrayLength="18"> + <cvParam cvRef="MS" accession="MS:1000128" name="profile spectrum" /> + <cvParam cvRef="MS" accession="MS:1000511" name="ms level" value="1" /> + <cvParam cvRef="MS" accession="MS:1000294" name="mass spectrum" /> + <cvParam cvRef="MS" accession="MS:1000285" name="total ion current" value="6.3630976e09"/> + <cvParam cvRef="MS" accession="MS:1000528" name="lowest observed m/z" value="108.907709764292704" unitAccession="MS:1000040" unitName="m/z" unitCvRef="MS"/> + <cvParam cvRef="MS" accession="MS:1000527" name="highest observed m/z" value="1111.100125670347097" unitAccession="MS:1000040" unitName="m/z" unitCvRef="MS"/> + <userParam name="filter string" type="xsd:string" value="FTMS + p ESI Full ms [110.0000-1100.0000]"/> + <scanList count="1"> + <cvParam cvRef="MS" accession="MS:1000795" name="no combination" /> + <scan > + <cvParam cvRef="MS" accession="MS:1000016" name="scan start time" value="172.28342" unitAccession="UO:0000010" unitName="second" unitCvRef="UO" /> + <userParam name="MS:1000130" type="xsd:string" value=""/> + <scanWindowList count="1"> + <scanWindow> + <cvParam cvRef="MS" accession="MS:1000501" name="scan window lower limit" value="110" unitAccession="MS:1000040" unitName="m/z" unitCvRef="MS" /> + <cvParam cvRef="MS" accession="MS:1000500" name="scan window upper limit" value="1100" unitAccession="MS:1000040" unitName="m/z" unitCvRef="MS" /> + </scanWindow> + </scanWindowList> + </scan> + </scanList> + <binaryDataArrayList count="2"> + <binaryDataArray encodedLength="192"> + <cvParam cvRef="MS" accession="MS:1000514" name="m/z array" unitAccession="MS:1000040" unitName="m/z" unitCvRef="MS" /> + <cvParam cvRef="MS" accession="MS:1000523" name="64-bit float" /> + <cvParam cvRef="MS" accession="MS:1000576" name="no compression" /> + <binary>ccJIT7shY0AdGCZkvSFjQL/EA3m/IWNAV8jhjcEhY0DlIsCiwyFjQGvUnrfFIWNAt3Dwkg4iY0AbXdunECJjQHigxrwSImNAzjqy0RQiY0AeLJ7mFiJjQGd0ivsYImNAqhN3EBsiY0DmCWQlHSJjQBxXUTofImNATPs+TyEiY0B39ixkIyJjQJpIG3klImNA</binary> + </binaryDataArray> + <binaryDataArray encodedLength="96"> + <cvParam cvRef="MS" accession="MS:1000515" name="intensity array" unitAccession="MS:1000131" unitName="number of detector counts" unitCvRef="MS"/> + <cvParam cvRef="MS" accession="MS:1000521" name="32-bit float" /> + <cvParam cvRef="MS" accession="MS:1000576" name="no compression" /> + <binary>MpSAR7CKlkfSH7ZH8ADIR47vl0elaPRGkTmOR/0nH0gVxxNJXw/6SSlRrkpz4hJLaZY8S4KkE0vEPa5KZiHvSTSj30hQKRBH</binary> + </binaryDataArray> + </binaryDataArrayList> + </spectrum> + <spectrum id="scan=129" index="3" defaultArrayLength="31"> + <cvParam cvRef="MS" accession="MS:1000128" name="profile spectrum" /> + <cvParam cvRef="MS" accession="MS:1000511" name="ms level" value="1" /> + <cvParam cvRef="MS" accession="MS:1000294" name="mass spectrum" /> + <cvParam cvRef="MS" accession="MS:1000285" name="total ion current" value="5.5177718e09"/> + <cvParam cvRef="MS" accession="MS:1000528" name="lowest observed m/z" value="108.907641099520376" unitAccession="MS:1000040" unitName="m/z" unitCvRef="MS"/> + <cvParam cvRef="MS" accession="MS:1000527" name="highest observed m/z" value="1111.099388375058879" unitAccession="MS:1000040" unitName="m/z" unitCvRef="MS"/> + <userParam name="filter string" type="xsd:string" value="FTMS + p ESI Full ms [110.0000-1100.0000]"/> + <scanList count="1"> + <cvParam cvRef="MS" accession="MS:1000795" name="no combination" /> + <scan > + <cvParam cvRef="MS" accession="MS:1000016" name="scan start time" value="172.64467" unitAccession="UO:0000010" unitName="second" unitCvRef="UO" /> + <userParam name="MS:1000130" type="xsd:string" value=""/> + <scanWindowList count="1"> + <scanWindow> + <cvParam cvRef="MS" accession="MS:1000501" name="scan window lower limit" value="110" unitAccession="MS:1000040" unitName="m/z" unitCvRef="MS" /> + <cvParam cvRef="MS" accession="MS:1000500" name="scan window upper limit" value="1100" unitAccession="MS:1000040" unitName="m/z" unitCvRef="MS" /> + </scanWindow> + </scanWindowList> + </scan> + </scanList> + <binaryDataArrayList count="2"> + <binaryDataArray encodedLength="332"> + <cvParam cvRef="MS" accession="MS:1000514" name="m/z array" unitAccession="MS:1000040" unitName="m/z" unitCvRef="MS" /> + <cvParam cvRef="MS" accession="MS:1000523" name="64-bit float" /> + <cvParam cvRef="MS" accession="MS:1000576" name="no compression" /> + <binary>v/C4pr4hY0B13Za7wCFjQCMhddDCIWNAx7tT5cQhY0BirTL6xiFjQPT1EQ/JIWNAwtKM1Q8iY0A9/3fqESJjQLGCY/8TImNAH11PFBYiY0CGjjspGCJjQOgWKD4aImNAQvYUUxwiY0CWLAJoHiJjQOW573wgImNALZ7dkSIiY0Bu2cumJCJjQKprursmImNA4VSp0CgiY0CGbJeIVCJjQE3PjZ1WImNAEImEslgiY0DPmXvHWiJjQIkBc9xcImNAQcBq8V4iY0D01WIGYSJjQKGC19E/I2NAY0z05kEjY0ApbRH8QyNjQPTkLhFGI2NAwrNMJkgjY0A=</binary> + </binaryDataArray> + <binaryDataArray encodedLength="168"> + <cvParam cvRef="MS" accession="MS:1000515" name="intensity array" unitAccession="MS:1000131" unitName="number of detector counts" unitCvRef="MS"/> + <cvParam cvRef="MS" accession="MS:1000521" name="32-bit float" /> + <cvParam cvRef="MS" accession="MS:1000576" name="no compression" /> + <binary>fv0oRj9abEfoz8tHM/PIR0Q2f0eGNfFGwRgcSAr2V0icrD9JxtcqSvxEwErt4BlLlFcpSyPp6UqapnlK1o6YSfuKpEjqzglIZ2WBR8B3u0bDlYJHQfIASNx2I0hHr5NH7dsiRw69pUYm4wdHO6CKR0+FkEcPBkJHQvz1Rg==</binary> + </binaryDataArray> + </binaryDataArrayList> + </spectrum> + </spectrumList> + </run> +</mzML> +<indexList count="1"> + <index name="spectrum"> + <offset idRef="scan=126">3577</offset> + <offset idRef="scan=127">6508</offset> + <offset idRef="scan=128">9315</offset> + <offset idRef="scan=129">12005</offset> + </index> +</indexList> +<indexListOffset>14938</indexListOffset> +<fileChecksum>0</fileChecksum> +</indexedmzML> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xcms_plot_raw.xml Mon Jul 15 16:03:26 2024 +0000 @@ -0,0 +1,55 @@ +<tool id="xcms_plot_raw" name="xcms plot raw" version="@TOOL_VERSION@+galaxy0" profile="21.09"> + <description>Plot raw data filtered by m/z range and retention time (RT) range</description> + <macros> + <import>macros_xcms_plot.xml</import> + </macros> + <expand macro="bio.tools"/> + <expand macro="creator"/> + <requirements> + <requirement type="package" version="@TOOL_VERSION@">bioconductor-xcms</requirement> + </requirements> + <command detect_errors="exit_code"><![CDATA[ + Rscript -e 'source("${plot_raw}")' + ]]></command> + <configfiles> + <configfile name="plot_raw"> +library(xcms) +library(MsExperiment) +library(Spectra) +mse = readMsExperiment(file.path('${input}')) +mz_offset = ${tolerance_ppm} * 1e-6 * ${mz_value} +rt_offset = ${rt_range} / 2 +raw = mse |> + filterRt(rt = ${rt} + c(-rt_offset, rt_offset)) |> + filterMzRange(mz = ${mz_value} + c(-mz_offset, mz_offset)) +png(filename = '${output_filename}') +par(oma = c(0.5, 2, 0.5, 1)) +plot(raw) +dev.off() + </configfile> + </configfiles> + <inputs> + <expand macro="base_params"/> + <param type="float" name="rt" label="Retention Time" min="0.0" value="0.0" help="Retention time for the plot"/> + <param type="float" name="rt_range" value="5.0" min="0.0" label="Retention Time Range" help="Retention time range for the plot"/> + </inputs> + <outputs> + <data name="output_filename" format="png" label="PLot at m/z=$mz_value and rt=$rt of $input.element_identifier"/> + </outputs> + <tests> + <test> + <param name="input" value="xcms_plot_raw_testdata.mzML"/> + <param name="mz_value" value="153.06583"/> + <param name="tolerance_ppm" value="10"/> + <param name="rt" value="171.922"/> + <param name="rt_range" value="0.1"/> + <output name="output_filename" file="raw_plot.png" compare="sim_size" delta="5000"/> + </test> + </tests> + <help><![CDATA[ + This tool plots the raw data filtered by m/z range and retention time (RT) range from an mzML file. + It uses a default tolerance of 10 ppm and retention time range of 5 s. + More information and detailed instructions can be found in the tutorial at: https://jorainer.github.io/xcmsTutorials/articles/xcms-preprocessing.html#data-visualization + ]]></help> + <expand macro="citations"/> +</tool> \ No newline at end of file