Mercurial > repos > recetox > bioconductor_mzr
comparison bioconductor_mzr_convert.xml @ 0:42e59b8e9e0b draft default tip
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/main/tools/bioconductor-mzR commit 28f3d51cdd92c47c1a175029d73454708d487e73
| author | recetox |
|---|---|
| date | Thu, 19 Jun 2025 08:17:53 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:42e59b8e9e0b |
|---|---|
| 1 <tool id="bioconductor_mzr_convert" name="bioconductor-mzR convert" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="23.0" license="MIT"> | |
| 2 <description>mass spectrometry data conversion</description> | |
| 3 <macros> | |
| 4 <token name="@TOOL_VERSION@">2.40.0</token> | |
| 5 <token name="@VERSION_SUFFIX@">0</token> | |
| 6 </macros> | |
| 7 | |
| 8 <xrefs> | |
| 9 <xref type="bio.tools">mzr</xref> | |
| 10 <xref type="bioconductor">mzR</xref> | |
| 11 </xrefs> | |
| 12 <requirements> | |
| 13 <requirement type="package" version="@TOOL_VERSION@">bioconductor-mzr</requirement> | |
| 14 </requirements> | |
| 15 <command detect_errors="exit_code"><![CDATA[ | |
| 16 Rscript '${bioconductor_mzr_convert}' | |
| 17 ]]></command> | |
| 18 | |
| 19 <configfiles> | |
| 20 <configfile name="bioconductor_mzr_convert"><![CDATA[ | |
| 21 #if $input_file.ext == $output_format: | |
| 22 stop('Conversion from/to identical formats is not supported. Please select a different output format.') | |
| 23 #end if | |
| 24 | |
| 25 #if $input_file.ext == "netcdf": | |
| 26 backend <- "netCDF" | |
| 27 #else | |
| 28 backend <- "pwiz" | |
| 29 #end if | |
| 30 x <- mzR::openMSfile('$input_file', backend=backend) | |
| 31 | |
| 32 peaks <- mzR::peaks(x) | |
| 33 header <- mzR::header(x) | |
| 34 | |
| 35 mzR::writeMSData( | |
| 36 peaks, | |
| 37 '$output_file', | |
| 38 header=header, | |
| 39 backend='pwiz', | |
| 40 outformat = '$output_format', | |
| 41 rtime_seconds = $rtime_seconds | |
| 42 ) | |
| 43 ]]></configfile> | |
| 44 </configfiles> | |
| 45 <inputs> | |
| 46 <param type="data" name="input_file" label="Input file" format="mzml,mzxml,netcdf" help="The input file to convert."/> | |
| 47 <param type="select" name="output_format" label="Output format" display="radio" help="The format to convert the input file to."> | |
| 48 <option value="mzml" selected="true">mzML</option> | |
| 49 <option value="mzxml">mzXML</option> | |
| 50 </param> | |
| 51 <param type="boolean" name="rtime_seconds" truevalue="TRUE" falsevalue="FALSE" checked="true" label="Use retention time in seconds" help="If checked, the retention time will be reported in seconds. If unchecked, it will be reported in minutes. Note that no active conversion is taking place."/> | |
| 52 </inputs> | |
| 53 <outputs> | |
| 54 <data format="mzml" name="output_file"> | |
| 55 <change_format> | |
| 56 <when input="output_format" value="mzxml" format="mzxml" /> | |
| 57 </change_format> | |
| 58 </data> | |
| 59 </outputs> | |
| 60 <tests> | |
| 61 <test> | |
| 62 <param name="input_file" location="https://zenodo.org/records/3757956/files/HU_neg_048.mzML" ftype="mzml"/> | |
| 63 <param name="output_format" value="mzxml"/> | |
| 64 <param name="rtime_seconds" value="FALSE"/> | |
| 65 <output name="output_file"> | |
| 66 <assert_contents> | |
| 67 <has_n_lines n="38604"/> | |
| 68 <has_text text='msRun scanCount="2031" startTime="PT43.47S" endTime="PT68387.9S"'/> | |
| 69 </assert_contents> | |
| 70 </output> | |
| 71 </test> | |
| 72 <test> | |
| 73 <param name="input_file" location="https://ftp.ebi.ac.uk/pub/databases/metabolights/studies/public/MTBLS200/FILES/OMAIR_012811_01.CDF" ftype="netcdf"/> | |
| 74 <param name="output_format" value="mzml"/> | |
| 75 <param name="rtime_seconds" value="TRUE"/> | |
| 76 <output name="output_file"> | |
| 77 <assert_contents> | |
| 78 <has_n_lines n="162669"/> | |
| 79 <has_text text='run id="Experiment_1" defaultInstrumentConfigurationRef="IC"'/> | |
| 80 <has_text text='cvRef="MS" accession="MS:1000016" name="scan start time" value="0.154999997467" unitCvRef="UO" unitAccession="UO:0000010" unitName="second"'/> | |
| 81 </assert_contents> | |
| 82 </output> | |
| 83 </test> | |
| 84 </tests> | |
| 85 <help><![CDATA[ | |
| 86 =============================== | |
| 87 bioconductor-mzR Convert Tool | |
| 88 =============================== | |
| 89 | |
| 90 **Description** | |
| 91 | |
| 92 This tool converts mass spectrometry data files between supported formats (mzML, mzXML, netCDF) using the Bioconductor mzR package. | |
| 93 Conversion between identical formats is not supported. | |
| 94 | |
| 95 Inputs | |
| 96 ------ | |
| 97 | |
| 98 - **Input file**: Mass spectrometry data file in mzML, mzXML, or netCDF format. | |
| 99 - **Output format**: Choose the desired output format (mzML or mzXML). | |
| 100 - **Use retention time in seconds**: If enabled, retention times in the output will be reported in seconds (otherwise, in minutes). | |
| 101 | |
| 102 Outputs | |
| 103 ------- | |
| 104 | |
| 105 - **Converted file**: The input file converted to the selected output format. | |
| 106 ]]></help> | |
| 107 <citations> | |
| 108 <citation type="doi">10.18129/B9.bioc.mzR</citation> | |
| 109 <citation type="doi">10.1038/nbt.2377</citation> | |
| 110 </citations> | |
| 111 </tool> |
