comparison preprocessing.xml @ 15:accf9fb6ea01 draft

"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/cardinal commit c8d3adac445b4e08e2724e22d7201bfc38bbf40f"
author galaxyp
date Sun, 29 Aug 2021 07:32:56 +0000
parents 6b36be80febb
children 611d80c0e29d
comparison
equal deleted inserted replaced
14:f1897eb07081 15:accf9fb6ea01
1 <tool id="cardinal_preprocessing" name="MSI preprocessing" version="@VERSION@.2"> 1 <tool id="cardinal_preprocessing" name="MSI preprocessing" version="@VERSION@.0">
2 <description> 2 <description>
3 mass spectrometry imaging preprocessing 3 mass spectrometry imaging preprocessing
4 </description> 4 </description>
5 <macros> 5 <macros>
6 <import>macros.xml</import> 6 <import>macros.xml</import>
7 </macros> 7 </macros>
8 <expand macro="requirements"> 8 <expand macro="requirements">
9 <requirement type="package" version="2.3">r-gridextra</requirement> 9 <requirement type="package" version="2.3">r-gridextra</requirement>
10 <requirement type="package" version="3.3.2">r-ggplot2</requirement> 10 <requirement type="package" version="3.3.5">r-ggplot2</requirement>
11 </expand> 11 </expand>
12 <command detect_errors="exit_code"> 12 <command detect_errors="exit_code">
13 <![CDATA[ 13 <![CDATA[
14 14
15 @INPUT_LINKING@ 15 @INPUT_LINKING@
202 mz_aligned = c(minmz, maxmz,maxfeatures, pixelcount) 202 mz_aligned = c(minmz, maxmz,maxfeatures, pixelcount)
203 QC_numbers= cbind(QC_numbers, mz_aligned) 203 QC_numbers= cbind(QC_numbers, mz_aligned)
204 vectorofactions = append(vectorofactions, "mz aligned") 204 vectorofactions = append(vectorofactions, "mz aligned")
205 print(plot(msidata, pixel=random_spectra, col="black")) 205 print(plot(msidata, pixel=random_spectra, col="black"))
206 title("Spectra after m/z alignment", outer=TRUE, line=0) 206 title("Spectra after m/z alignment", outer=TRUE, line=0)
207
208
209 ############################### Mz recalibration ###########################
210
211 #elif str( $method.methods_conditional.preprocessing_method ) == 'mz_recalibration':
212 print('m/z recalibration')
213 ## M/z recalibration
214
215 reference_mz = read.delim("$method.methods_conditional.mz_tabular", header = $method.methods_conditional.feature_header, stringsAsFactors = FALSE)
216 reference_mz = reference_mz[,$method.methods_conditional.feature_column]
217
218 msidata = mzAlign(msidata, ref=reference_mz, tolerance = $method.methods_conditional.alignment_tol, units = "$method.methods_conditional.alignment_units", quantile = $method.methods_conditional.quantile, span = $method.methods_conditional.span)
219
220 msidata <- process(msidata, BPPARAM=MulticoreParam(workers=number_cpu))
221
222 ## remove the reference peaks data to allow proper peak alignment afterwards
223 metadata(featureData(msidata))['reference peaks'] <- NULL
224
225 ############################### QC ###########################
226
227 maxfeatures =nrow(msidata)
228 pixelcount = ncol(msidata)
229 minmz = round(min(mz(msidata)), digits=2)
230 maxmz = round(max(mz(msidata)), digits=2)
231 mz_recal = c(minmz, maxmz,maxfeatures, pixelcount)
232 QC_numbers= cbind(QC_numbers, mz_recal)
233 vectorofactions = append(vectorofactions, "mz recalibrated")
234 print(plot(msidata, pixel=random_spectra, col="black"))
235 title("Spectra after m/z recalibration", outer=TRUE, line=0)
207 236
208 237
209 ############################### Peak picking ########################### 238 ############################### Peak picking ###########################
210 239
211 #elif str( $method.methods_conditional.preprocessing_method) == 'Peak_picking': 240 #elif str( $method.methods_conditional.preprocessing_method) == 'Peak_picking':
454 <param name="preprocessing_method" type="select" label="Preprocessing methods"> 483 <param name="preprocessing_method" type="select" label="Preprocessing methods">
455 <option value="Normalization" selected="True">Intensity Normalization</option> 484 <option value="Normalization" selected="True">Intensity Normalization</option>
456 <option value="Baseline_reduction">Baseline Reduction</option> 485 <option value="Baseline_reduction">Baseline Reduction</option>
457 <option value="Smoothing">Peak smoothing</option> 486 <option value="Smoothing">Peak smoothing</option>
458 <option value="mz_alignment">m/z alignment</option> 487 <option value="mz_alignment">m/z alignment</option>
488 <option value="mz_recalibration">m/z recalibration</option>
459 <option value="Peak_picking">Peak picking</option> 489 <option value="Peak_picking">Peak picking</option>
460 <option value="Peak_alignment">Peak alignment</option> 490 <option value="Peak_alignment">Peak alignment</option>
461 <option value="Peak_filtering">Peak filtering</option> 491 <option value="Peak_filtering">Peak filtering</option>
462 <option value="Peak_binning">Peak binning to reference peaks</option> 492 <option value="Peak_binning">Peak binning to reference peaks</option>
463 <option value="Mass_binning">m/z binning</option> 493 <option value="Mass_binning">m/z binning</option>
532 <param name="quantile" type="float" value="0.2" 562 <param name="quantile" type="float" value="0.2"
533 label="quantile" help="The top quantile of reference points (peaks detected via local maxima) to use from the reference spectrum."/> 563 label="quantile" help="The top quantile of reference points (peaks detected via local maxima) to use from the reference spectrum."/>
534 <param name="span" type="float" value="0.75" 564 <param name="span" type="float" value="0.75"
535 label="span" help="The smoothing parameter for the local polynomial regression used to determine the warping function."/> 565 label="span" help="The smoothing parameter for the local polynomial regression used to determine the warping function."/>
536 </when> 566 </when>
567 <when value="mz_recalibration">
568 <param name="alignment_tol" type="text" value="NA"
569 label="tolerance" help="The tolerance to be used when matching the peaks in the unaligned spectra to the reference spectrum. If this is NA, then automatically guess a tolerance from the data.">
570 <sanitizer>
571 <valid initial="string.digits">
572 <add value="N" />
573 <add value="A" />
574 </valid>
575 </sanitizer>
576 </param>
577 <param name="alignment_units" type="select" display="radio" optional="False" label="The units to use for the tolerance.">
578 <option value="ppm" selected="True">ppm</option>
579 <option value="mz">m/z</option>
580 </param>
581 <expand macro="reading_1_column_mz_tabular" label="Tabular file with m/z features to use for alignment. Only the m/z values from the tabular file will be kept."/>
582 <param name="quantile" type="float" value="0.2"
583 label="quantile" help="The top quantile of reference points (peaks detected via local maxima) to use from the reference spectrum."/>
584 <param name="span" type="float" value="0.75"
585 label="span" help="The smoothing parameter for the local polynomial regression used to determine the warping function."/>
586 </when>
537 <when value="Peak_picking"> 587 <when value="Peak_picking">
538 <param name="SNR_picking_method" type="float" value="6" 588 <param name="SNR_picking_method" type="float" value="6"
539 label="Signal to noise ratio" 589 label="Signal to noise ratio"
540 help="The minimal signal to noise ratio for peaks to be considered as a valid peak."/> 590 help="The minimal signal to noise ratio for peaks to be considered as a valid peak."/>
541 <param name="blocks_picking" type="integer" value="100" label = "Number of blocks" 591 <param name="blocks_picking" type="integer" value="100" label = "Number of blocks"
771 <param name="preprocessing_method" value="mz_alignment"/> 821 <param name="preprocessing_method" value="mz_alignment"/>
772 </conditional> 822 </conditional>
773 </repeat> 823 </repeat>
774 <repeat name="methods"> 824 <repeat name="methods">
775 <conditional name="methods_conditional"> 825 <conditional name="methods_conditional">
826 <param name="preprocessing_method" value="mz_recalibration"/>
827 <param name="alignment_tol" value="2"/>
828 <param name="alignment_units" value="ppm"/>
829 <param name="mz_tabular" value="inputcalibrantfile2.txt" ftype="tabular"/>
830 <param name="feature_column" value="1"/>
831 <param name="feature_header" value="TRUE"/>
832 </conditional>
833 </repeat>
834 <repeat name="methods">
835 <conditional name="methods_conditional">
776 <param name="preprocessing_method" value="Mass_binning"/> 836 <param name="preprocessing_method" value="Mass_binning"/>
777 <param name="bin_width" value="0.1"/> 837 <param name="bin_width" value="0.1"/>
778 <param name="bin_units" value="mz"/> 838 <param name="bin_units" value="mz"/>
779 </conditional> 839 </conditional>
780 </repeat> 840 </repeat>