Mercurial > repos > galaxyp > cardinal_preprocessing
comparison preprocessing.xml @ 8:87bb011a4ee8 draft
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/cardinal commit d008f6ea0f5c8435fb975a34cb99ea4d42c5ebd2"
author | galaxyp |
---|---|
date | Wed, 13 May 2020 14:21:48 -0400 |
parents | 44a4b31fcbf3 |
children | ca727a6dede6 |
comparison
equal
deleted
inserted
replaced
7:44a4b31fcbf3 | 8:87bb011a4ee8 |
---|---|
1 <tool id="cardinal_preprocessing" name="MSI preprocessing" version="@VERSION@.1"> | 1 <tool id="cardinal_preprocessing" name="MSI preprocessing" version="@VERSION@.2"> |
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> |
90 | 90 |
91 if (class(msidata) == "MSProcessedImagingExperiment"){ | 91 if (class(msidata) == "MSProcessedImagingExperiment"){ |
92 msidata = as(msidata, "MSContinuousImagingExperiment") | 92 msidata = as(msidata, "MSContinuousImagingExperiment") |
93 } | 93 } |
94 | 94 |
95 msidata = normalize(msidata, method="tic") | 95 msidata = normalize(msidata, method="$method.methods_conditional.methods_for_normalization.normalization_method") |
96 msidata <- process(msidata, BPPARAM=MulticoreParam(workers=number_cpu)) | 96 msidata <- process(msidata, BPPARAM=MulticoreParam(workers=number_cpu)) |
97 | 97 |
98 | 98 |
99 ############################### QC ########################### | 99 ############################### QC ########################### |
100 | 100 |
176 smoothed = c(minmz, maxmz,maxfeatures, pixelcount) | 176 smoothed = c(minmz, maxmz,maxfeatures, pixelcount) |
177 QC_numbers= cbind(QC_numbers, smoothed) | 177 QC_numbers= cbind(QC_numbers, smoothed) |
178 vectorofactions = append(vectorofactions, "smoothed") | 178 vectorofactions = append(vectorofactions, "smoothed") |
179 print(plot(msidata, pixel=random_spectra)) | 179 print(plot(msidata, pixel=random_spectra)) |
180 title("Spectra after smoothing", outer=TRUE, line=0) | 180 title("Spectra after smoothing", outer=TRUE, line=0) |
181 | |
182 | |
183 ############################### Mz alignment ########################### | |
184 | |
185 #elif str( $method.methods_conditional.preprocessing_method ) == 'mz_alignment': | |
186 print('M/z alignment') | |
187 ## M/z alignment | |
188 | |
189 #if str( $method.methods_conditional.mzalign_ref_type.align_reference_datatype) == 'align_table': | |
190 | |
191 reference_mz = read.delim("$method.methods_conditional.mzalign_ref_type.mz_tabular", header = $method.methods_conditional.mzalign_ref_type.feature_header, stringsAsFactors = FALSE) | |
192 reference_mz = reference_mz[,$method.methods_conditional.mzalign_ref_type.feature_column] | |
193 | |
194 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) | |
195 | |
196 | |
197 #elif str( $method.methods_conditional.mzalign_ref_type.align_reference_datatype) == 'align_noref': | |
198 | |
199 msidata = mzAlign(msidata,tolerance = $method.methods_conditional.alignment_tol, units = "$method.methods_conditional.alignment_units", , quantile = $method.methods_conditional.quantile, span = $method.methods_conditional.span) | |
200 | |
201 #end if | |
202 | |
203 msidata <- process(msidata, BPPARAM=MulticoreParam(workers=number_cpu)) | |
204 | |
205 ############################### QC ########################### | |
206 | |
207 maxfeatures =nrow(msidata) | |
208 pixelcount = ncol(msidata) | |
209 minmz = round(min(mz(msidata)), digits=2) | |
210 maxmz = round(max(mz(msidata)), digits=2) | |
211 mz_aligned = c(minmz, maxmz,maxfeatures, pixelcount) | |
212 QC_numbers= cbind(QC_numbers, mz_aligned) | |
213 vectorofactions = append(vectorofactions, "mz aligned") | |
214 print(plot(msidata, pixel=random_spectra)) | |
215 title("Spectra after m/z alignment", outer=TRUE, line=0) | |
216 | |
181 | 217 |
182 ############################### Peak picking ########################### | 218 ############################### Peak picking ########################### |
183 | 219 |
184 #elif str( $method.methods_conditional.preprocessing_method) == 'Peak_picking': | 220 #elif str( $method.methods_conditional.preprocessing_method) == 'Peak_picking': |
185 #set $used_peak_picking = True | 221 #set $used_peak_picking = True |
436 <conditional name="methods_conditional"> | 472 <conditional name="methods_conditional"> |
437 <param name="preprocessing_method" type="select" label="Preprocessing methods"> | 473 <param name="preprocessing_method" type="select" label="Preprocessing methods"> |
438 <option value="Normalization" selected="True">Intensity Normalization</option> | 474 <option value="Normalization" selected="True">Intensity Normalization</option> |
439 <option value="Baseline_reduction">Baseline Reduction</option> | 475 <option value="Baseline_reduction">Baseline Reduction</option> |
440 <option value="Smoothing">Peak smoothing</option> | 476 <option value="Smoothing">Peak smoothing</option> |
477 <option value="mz_alignment">m/z alignment</option> | |
441 <option value="Peak_picking">Peak picking</option> | 478 <option value="Peak_picking">Peak picking</option> |
442 <option value="Peak_alignment">Peak alignment</option> | 479 <option value="Peak_alignment">Peak alignment</option> |
443 <option value="Peak_filtering">Peak filtering</option> | 480 <option value="Peak_filtering">Peak filtering</option> |
444 <option value="Peak_binning">Peak binning to reference peaks</option> | 481 <option value="Peak_binning">Peak binning to reference peaks</option> |
445 <option value="Data_reduction">Data reduction</option> | 482 <option value="Data_reduction">Data reduction</option> |
484 label="The coefficients for the moving average filter"/> | 521 label="The coefficients for the moving average filter"/> |
485 </when> | 522 </when> |
486 </conditional> | 523 </conditional> |
487 <param name="window_smoothing" type="float" value="8" | 524 <param name="window_smoothing" type="float" value="8" |
488 label="Window size"/> | 525 label="Window size"/> |
526 </when> | |
527 <when value="mz_alignment"> | |
528 <param name="alignment_tol" type="text" value="NA" | |
529 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."> | |
530 <sanitizer> | |
531 <valid initial="string.digits"> | |
532 <add value="N" /> | |
533 <add value="A" /> | |
534 </valid> | |
535 </sanitizer> | |
536 </param> | |
537 <param name="alignment_units" type="select" display="radio" optional="False" label="The units to use for the tolerance."> | |
538 <option value="ppm" selected="True">ppm</option> | |
539 <option value="mz">m/z</option> | |
540 </param> | |
541 <conditional name="mzalign_ref_type"> | |
542 <param name="align_reference_datatype" type="select" label="Choose reference"> | |
543 <option value="align_noref" selected="True">use mean spectrum as reference</option> | |
544 <option value="align_table" >m/z values from tabular file as reference</option> | |
545 </param> | |
546 <when value="align_noref"/> | |
547 <when value="align_table"> | |
548 <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."/> | |
549 </when> | |
550 </conditional> | |
551 <param name="quantile" type="float" value="0.2" | |
552 label="quantile" help="The top quantile of reference points (peaks detected via local maxima) to use from the reference spectrum."/> | |
553 <param name="span" type="float" value="0.75" | |
554 label="span" help="The smoothing parameter for the local polynomial regression used to determine the warping function."/> | |
489 </when> | 555 </when> |
490 <when value="Peak_picking"> | 556 <when value="Peak_picking"> |
491 <param name="SNR_picking_method" type="float" value="6" | 557 <param name="SNR_picking_method" type="float" value="6" |
492 label="Signal to noise ratio" | 558 label="Signal to noise ratio" |
493 help="The minimal signal to noise ratio for peaks to be considered as a valid peak."/> | 559 help="The minimal signal to noise ratio for peaks to be considered as a valid peak."/> |
520 <option value="mz">m/z</option> | 586 <option value="mz">m/z</option> |
521 </param> | 587 </param> |
522 <conditional name="align_ref_type"> | 588 <conditional name="align_ref_type"> |
523 <param name="align_reference_datatype" type="select" label="Choose reference"> | 589 <param name="align_reference_datatype" type="select" label="Choose reference"> |
524 <option value="align_noref" selected="True">no reference</option> | 590 <option value="align_noref" selected="True">no reference</option> |
525 <option value="align_table" >tabular file as reference</option> | 591 <option value="align_table" >m/z values from tabular file as reference</option> |
526 </param> | 592 </param> |
527 <when value="align_noref"/> | 593 <when value="align_noref"/> |
528 <when value="align_table"> | 594 <when value="align_table"> |
529 <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."/> | 595 <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."/> |
530 </when> | 596 </when> |
535 <param name="frequ_filtering" type="float" value="0.01" max="1" min="0" label="Minimum frequency" help="Peaks that occur in the dataset in lesser proportion than this will be dropped (0.01 --> filtering for 1% of spectra)"/> | 601 <param name="frequ_filtering" type="float" value="0.01" max="1" min="0" label="Minimum frequency" help="Peaks that occur in the dataset in lesser proportion than this will be dropped (0.01 --> filtering for 1% of spectra)"/> |
536 </when> | 602 </when> |
537 <when value="Peak_binning"> | 603 <when value="Peak_binning"> |
538 <expand macro="reading_1_column_mz_tabular" label="A reference to which the peaks are binned." help="Tabular file with m/z features to extract from input file"/> | 604 <expand macro="reading_1_column_mz_tabular" label="A reference to which the peaks are binned." help="Tabular file with m/z features to extract from input file"/> |
539 <param name="peakbin_tol" value="NA" type="text" label="The tolerance to be used when matching the m/z features in the dataset to the reference. If this is NA, then automatically guess a resolution from the data." > | 605 <param name="peakbin_tol" value="NA" type="text" label="The tolerance to be used when matching the m/z features in the dataset to the reference. If this is NA, then automatically guess a resolution from the data." > |
540 <sanitizer invalid_char=""> | 606 <sanitizer> |
541 <valid initial="string.digits"> | 607 <valid initial="string.digits"> |
542 <add value="NA" /> | 608 <add value="N" /> |
609 <add value="A" /> | |
543 </valid> | 610 </valid> |
544 </sanitizer> | 611 </sanitizer> |
545 </param> | 612 </param> |
546 <param name="peakbin_units" display="radio" type="select" label="The units to use for the tolerance."> | 613 <param name="peakbin_units" display="radio" type="select" label="The units to use for the tolerance."> |
547 <option value="mz" >mz</option> | 614 <option value="mz" >mz</option> |
726 <param name="normalization_method" value="tic"/> | 793 <param name="normalization_method" value="tic"/> |
727 </conditional> | 794 </conditional> |
728 </repeat> | 795 </repeat> |
729 <repeat name="methods"> | 796 <repeat name="methods"> |
730 <conditional name="methods_conditional"> | 797 <conditional name="methods_conditional"> |
798 <param name="preprocessing_method" value="mz_alignment"/> | |
799 </conditional> | |
800 </repeat> | |
801 <repeat name="methods"> | |
802 <conditional name="methods_conditional"> | |
731 <param name="preprocessing_method" value="Data_reduction"/> | 803 <param name="preprocessing_method" value="Data_reduction"/> |
732 <conditional name="methods_for_reduction"> | 804 <conditional name="methods_for_reduction"> |
733 <param name="reduction_method" value="bin"/> | 805 <param name="reduction_method" value="bin"/> |
734 <param name="bin_width" value="0.1"/> | 806 <param name="bin_width" value="0.1"/> |
735 </conditional> | 807 </conditional> |
759 <repeat name="methods"> | 831 <repeat name="methods"> |
760 <conditional name="methods_conditional"> | 832 <conditional name="methods_conditional"> |
761 <param name="preprocessing_method" value="Baseline_reduction"/> | 833 <param name="preprocessing_method" value="Baseline_reduction"/> |
762 </conditional> | 834 </conditional> |
763 </repeat> | 835 </repeat> |
764 <output name="QC_overview" file="preprocessing_results5.pdf" compare="sim_size"/> | 836 <output name="QC_overview" file="preprocessing_results5.pdf" compare="sim_size" delta="13000"/> |
765 <output name="outfile_imzml" ftype="imzml" file="preprocessing_results5.imzml.txt" compare="sim_size"> | 837 <output name="outfile_imzml" ftype="imzml" file="preprocessing_results5.imzml.txt" compare="sim_size"> |
766 <extra_files type="file" file="preprocessing_results5.imzml" name="imzml" lines_diff="6"/> | 838 <extra_files type="file" file="preprocessing_results5.imzml" name="imzml" lines_diff="6"/> |
767 <extra_files type="file" file="preprocessing_results5.ibd" name="ibd" compare="sim_size"/> | 839 <extra_files type="file" file="preprocessing_results5.ibd" name="ibd" compare="sim_size"/> |
768 </output> | 840 </output> |
769 </test> | 841 </test> |