comparison msi_preprocessing.xml @ 3:b9523950e79d draft

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_preprocessing commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
author galaxyp
date Mon, 28 May 2018 12:38:04 -0400
parents 50ba097d03e0
children 42580292d381
comparison
equal deleted inserted replaced
2:50ba097d03e0 3:b9523950e79d
1 <tool id="mass_spectrometry_imaging_preprocessing" name="MSI preprocessing" version="1.7.0.2"> 1 <tool id="mass_spectrometry_imaging_preprocessing" name="MSI preprocessing" version="1.10.0.0">
2 <description> 2 <description>
3 mass spectrometry imaging preprocessing 3 mass spectrometry imaging preprocessing
4 </description> 4 </description>
5 <requirements> 5 <requirements>
6 <requirement type="package" version="1.7.0">bioconductor-cardinal</requirement> 6 <requirement type="package" version="1.10.0">bioconductor-cardinal</requirement>
7 <requirement type="package" version="2.2.1">r-gridextra</requirement> 7 <requirement type="package" version="2.2.1">r-gridextra</requirement>
8 <requirement type="package" version="0.20-35">r-lattice</requirement> 8 <requirement type="package" version="0.20-35">r-lattice</requirement>
9 </requirements> 9 </requirements>
10 <command detect_errors="exit_code"> 10 <command detect_errors="exit_code">
11 <![CDATA[ 11 <![CDATA[
12 12
13 #if $infile.ext == 'imzml' 13 #if $infile.ext == 'imzml'
14 cp '${infile.extra_files_path}/imzml' infile.imzML && 14 ln -s '${infile.extra_files_path}/imzml' infile.imzML &&
15 cp '${infile.extra_files_path}/ibd' infile.ibd && 15 ln -s '${infile.extra_files_path}/ibd' infile.ibd &&
16 #elif $infile.ext == 'analyze75' 16 #elif $infile.ext == 'analyze75'
17 cp '${infile.extra_files_path}/hdr' infile.hdr && 17 ln -s '${infile.extra_files_path}/hdr' infile.hdr &&
18 cp '${infile.extra_files_path}/img' infile.img && 18 ln -s '${infile.extra_files_path}/img' infile.img &&
19 cp '${infile.extra_files_path}/t2m' infile.t2m && 19 ln -s '${infile.extra_files_path}/t2m' infile.t2m &&
20 #else 20 #else
21 ln -s '$infile' infile.RData && 21 ln -s '$infile' infile.RData &&
22 #end if 22 #end if
23 cat '${cardinal_preprocessing}' && 23 cat '${cardinal_preprocessing}' &&
24 Rscript '${cardinal_preprocessing}' 24 Rscript '${cardinal_preprocessing}'
30 library(Cardinal) 30 library(Cardinal)
31 library(gridExtra) 31 library(gridExtra)
32 library(lattice) 32 library(lattice)
33 33
34 #if $infile.ext == 'imzml' 34 #if $infile.ext == 'imzml'
35 msidata <- readMSIData('infile.imzML') 35 msidata = readImzML('infile')
36 #elif $infile.ext == 'analyze75' 36 #elif $infile.ext == 'analyze75'
37 msidata <- readMSIData('infile.hdr') 37 msidata = readAnalyze('infile')
38 #else 38 #else
39 load('infile.RData') 39 load('infile.RData')
40 #end if 40 #end if
41 41
42 42
43 ##################################### Preparations for QC report ####################################################################################### 43 ##################################### Preparations for QC report ###############
44 44
45 #if $outputs.outputs_select == "quality_control": 45 #if $outputs.outputs_select == "quality_control":
46 46
47 ### values for QC table: 47 ### values for QC table:
48 maxfeatures = length(features(msidata)) 48 maxfeatures = length(features(msidata))
52 QC_numbers= data.frame(rawdata = c(maxfeatures, medianpeaks, medint, TICs)) 52 QC_numbers= data.frame(rawdata = c(maxfeatures, medianpeaks, medint, TICs))
53 vectorofactions = "rawdata" 53 vectorofactions = "rawdata"
54 54
55 55
56 ### Read tabular file with calibrant masses: 56 ### Read tabular file with calibrant masses:
57 calibrant_list = read.delim("$outputs.calibrant_file", header = FALSE, na.strings=c("","NA"), stringsAsFactors = FALSE) 57 calibrant_list = read.delim("$outputs.calibrant_file", header = FALSE, stringsAsFactors = FALSE)
58 58
59 ### calculate how many input calibrant masses are valid: 59 ### calculate how many input calibrant masses are valid:
60 inputcalibrants = calibrant_list[calibrant_list[,$outputs.calibrants_column]>min(mz(msidata)) & calibrant_list[,$outputs.calibrants_column]<max(mz(msidata)),$outputs.calibrants_column] 60 inputcalibrants = calibrant_list[calibrant_list[,$outputs.calibrants_column]>min(mz(msidata)) & calibrant_list[,$outputs.calibrants_column]<max(mz(msidata)),$outputs.calibrants_column]
61 number_calibrants_in = length(calibrant_list[,$outputs.calibrants_column]) 61 number_calibrants_in = length(calibrant_list[,$outputs.calibrants_column])
62 number_calibrants_valid = length(inputcalibrants) 62 number_calibrants_valid = length(inputcalibrants)
83 83
84 assign(paste("rawdata",calibrant, sep="_"), currentimage) 84 assign(paste("rawdata",calibrant, sep="_"), currentimage)
85 } 85 }
86 86
87 87
88 current_plot_raw <- vector(length(inputcalibrants), mode='list') 88 current_plot_raw = vector(length(inputcalibrants), mode='list')
89 89
90 90
91 #end if 91 #end if
92 92
93 ################################################### Preprocessing steps ####################################################################################### 93 ############################### Preprocessing steps ###########################
94 #for $method in $methods: 94 #for $method in $methods:
95
95 #if str( $method.methods_conditional.preprocessing_method ) == 'Normalization': 96 #if str( $method.methods_conditional.preprocessing_method ) == 'Normalization':
96 print('Normalization') 97 print('Normalization')
97 ##normalization 98 ##normalization
98 99
99 msidata <- normalize(msidata, method="tic") 100 msidata = normalize(msidata, method="tic")
100 101
101 #if $outputs.outputs_select == "quality_control": 102 #if $outputs.outputs_select == "quality_control":
102 ### values for QC table: 103 ### values for QC table:
103 maxfeatures = length(features(msidata)) 104 maxfeatures = length(features(msidata))
104 medianpeaks = median(colSums(spectra(msidata)[]>0)) 105 medianpeaks = median(colSums(spectra(msidata)[]>0))
150 print('Smoothing') 151 print('Smoothing')
151 ## Smoothing 152 ## Smoothing
152 153
153 #if str( $method.methods_conditional.methods_for_smoothing.smoothing_method) == 'gaussian': 154 #if str( $method.methods_conditional.methods_for_smoothing.smoothing_method) == 'gaussian':
154 print('gaussian smoothing') 155 print('gaussian smoothing')
155 msidata <- smoothSignal(msidata, method="$method.methods_conditional.methods_for_smoothing.smoothing_method", window=$method.methods_conditional.window_smoothing, sd = $method.methods_conditional.methods_for_smoothing.sd_gaussian) 156 msidata = smoothSignal(msidata, method="$method.methods_conditional.methods_for_smoothing.smoothing_method", window=$method.methods_conditional.window_smoothing, sd = $method.methods_conditional.methods_for_smoothing.sd_gaussian)
156 #elif str( $method.methods_conditional.methods_for_smoothing.smoothing_method) == 'sgolay': 157 #elif str( $method.methods_conditional.methods_for_smoothing.smoothing_method) == 'sgolay':
157 print('sgolay smoothing') 158 print('sgolay smoothing')
158 msidata <- smoothSignal(msidata, method="$method.methods_conditional.methods_for_smoothing.smoothing_method", window=$method.methods_conditional.window_smoothing, order = $method.methods_conditional.methods_for_smoothing.order_of_filters) 159 msidata = smoothSignal(msidata, method="$method.methods_conditional.methods_for_smoothing.smoothing_method", window=$method.methods_conditional.window_smoothing, order = $method.methods_conditional.methods_for_smoothing.order_of_filters)
159 #elif str($method.methods_conditional.methods_for_smoothing.smoothing_method) == 'ma': 160 #elif str($method.methods_conditional.methods_for_smoothing.smoothing_method) == 'ma':
160 print('sgolay smoothing') 161 print('sgolay smoothing')
161 msidata <- smoothSignal(msidata, method="$method.methods_conditional.methods_for_smoothing.smoothing_method", window=$method.methods_conditional.window_smoothing, coef = $method.methods_conditional.methods_for_smoothing.coefficients_ma_filter) 162 msidata = smoothSignal(msidata, method="$method.methods_conditional.methods_for_smoothing.smoothing_method", window=$method.methods_conditional.window_smoothing, coef = $method.methods_conditional.methods_for_smoothing.coefficients_ma_filter)
162 #end if 163 #end if
163 164
164 #if $outputs.outputs_select == "quality_control": 165 #if $outputs.outputs_select == "quality_control":
165 maxfeatures = length(features(msidata)) 166 maxfeatures = length(features(msidata))
166 medianpeaks = median(colSums(spectra(msidata)[]>0)) 167 medianpeaks = median(colSums(spectra(msidata)[]>0))
224 225
225 #if str( $method.methods_conditional.align_ref_type.align_reference_datatype) == 'align_noref': 226 #if str( $method.methods_conditional.align_ref_type.align_reference_datatype) == 'align_noref':
226 align_peak_reference = msidata 227 align_peak_reference = msidata
227 228
228 #elif str( $method.methods_conditional.align_ref_type.align_reference_datatype) == 'align_table': 229 #elif str( $method.methods_conditional.align_ref_type.align_reference_datatype) == 'align_table':
229 align_reference_table = read.delim("$method.methods_conditional.align_ref_type.align_peaks_table", header = FALSE, na.strings=c("","NA"), stringsAsFactors = FALSE) 230 align_reference_table = read.delim("$method.methods_conditional.align_ref_type.align_peaks_table", header = FALSE, stringsAsFactors = FALSE)
230 231
231 align_reference_column = align_reference_table[,$method.methods_conditional.align_ref_type.align_mass_column] 232 align_reference_column = align_reference_table[,$method.methods_conditional.align_ref_type.align_mass_column]
232 233
233 align_peak_reference = align_reference_column[align_reference_column>=min(mz(msidata)) & align_reference_column<=max(mz(msidata))] 234 align_peak_reference = align_reference_column[align_reference_column>=min(mz(msidata)) & align_reference_column<=max(mz(msidata))]
234 if (length(align_peak_reference) == 0) 235 if (length(align_peak_reference) == 0)
315 316
316 #elif str( $method.methods_conditional.methods_for_reduction.reduction_method) == 'peaks': 317 #elif str( $method.methods_conditional.methods_for_reduction.reduction_method) == 'peaks':
317 print('peaks reduction') 318 print('peaks reduction')
318 319
319 #if str( $method.methods_conditional.methods_for_reduction.ref_type.reference_datatype) == 'table': 320 #if str( $method.methods_conditional.methods_for_reduction.ref_type.reference_datatype) == 'table':
320 reference_table = read.delim("$method.methods_conditional.methods_for_reduction.ref_type.peaks_table", header = FALSE, na.strings=c("","NA"), stringsAsFactors = FALSE) 321 reference_table = read.delim("$method.methods_conditional.methods_for_reduction.ref_type.peaks_table", header = FALSE, stringsAsFactors = FALSE)
321 reference_column = reference_table[,$method.methods_conditional.methods_for_reduction.ref_type.mass_column] 322 reference_column = reference_table[,$method.methods_conditional.methods_for_reduction.ref_type.mass_column]
322 peak_reference = reference_column[reference_column>min(mz(msidata)) & reference_column<max(mz(msidata))] 323 peak_reference = reference_column[reference_column>min(mz(msidata)) & reference_column<max(mz(msidata))]
323 324
324 #elif str( $method.methods_conditional.methods_for_reduction.ref_type.reference_datatype) == 'msidata_ref': 325 #elif str( $method.methods_conditional.methods_for_reduction.ref_type.reference_datatype) == 'msidata_ref':
325 loadRData <- function(fileName){ 326 loadRData <- function(fileName){
349 scales = list(draw = FALSE), plusminus = $outputs.plusminus_dalton, main="reduced") 350 scales = list(draw = FALSE), plusminus = $outputs.plusminus_dalton, main="reduced")
350 351
351 assign(paste("reduced",calibrant, sep="_"), currentimage) 352 assign(paste("reduced",calibrant, sep="_"), currentimage)
352 } 353 }
353 #end if 354 #end if
355
356 #elif str( $method.methods_conditional.preprocessing_method) == 'Transformation':
357 print('Transformation')
358
359 #if str( $method.methods_conditional.transf_conditional.trans_type) == 'log2':
360 print('log2 transformation')
361 spectra(msidata)[spectra(msidata) ==0] = NA
362 print(paste0("Number of 0 which were converted into NA:",sum(is.na(spectra(msidata)))))
363 spectra(msidata) = log2(spectra(msidata))
364
365 #elif str( $method.methods_conditional.transf_conditional.trans_type) == 'sqrt':
366 print('squareroot transformation')
367 spectra(msidata) = sqrt(spectra(msidata))
368
369 #end if
354 #end if 370 #end if
355 #end for 371 #end for
356 372
357 ####################################################### Outputs: RData, tabular and QC report ###################################################### 373 ###################### Outputs: RData, tabular and QC report ###################
358 374
359 375
360 ## save as (.RData) 376 ## save as (.RData)
361 save(msidata, file="$msidata_preprocessed") 377 save(msidata, file="$msidata_preprocessed")
362 378
408 424
409 425
410 ]]></configfile> 426 ]]></configfile>
411 </configfiles> 427 </configfiles>
412 <inputs> 428 <inputs>
413 <param name="infile" type="data" format="imzml,rdata,analyze75" 429 <param name="infile" type="data" format="imzml,rdata,danalyze75"
414 label="MSI rawdata as imzml, analyze7.5 or Cardinal MSImageSet saved as RData" 430 label="MSI rawdata as imzml, analyze7.5 or Cardinal MSImageSet saved as RData"
415 help="load imzml and ibd file by uploading composite datatype imzml"/> 431 help="load imzml and ibd file by uploading composite datatype imzml"/>
416 <repeat name="methods" title="Preprocessing" min="1" max="50"> 432 <repeat name="methods" title="Preprocessing" min="1" max="50">
417 <conditional name="methods_conditional"> 433 <conditional name="methods_conditional">
418 <param name="preprocessing_method" type="select" label="Select the preprocessing methods you want to apply"> 434 <param name="preprocessing_method" type="select" label="Select the preprocessing methods you want to apply">
421 <option value="Smoothing">Peak smoothing</option> 437 <option value="Smoothing">Peak smoothing</option>
422 <option value="Peak_picking">Peak picking</option> 438 <option value="Peak_picking">Peak picking</option>
423 <option value="Peak_alignment">Peak alignment</option> 439 <option value="Peak_alignment">Peak alignment</option>
424 <option value="Peak_filtering">Peak filtering</option> 440 <option value="Peak_filtering">Peak filtering</option>
425 <option value="Data_reduction">Data reduction</option> 441 <option value="Data_reduction">Data reduction</option>
442 <option value="Transformation">Transformation</option>
426 </param> 443 </param>
427
428 <when value="Normalization"/> 444 <when value="Normalization"/>
429 <when value="Baseline_reduction"> 445 <when value="Baseline_reduction">
430 <param name="blocks_baseline" type="integer" value="50" 446 <param name="blocks_baseline" type="integer" value="50"
431 label="Blocks"/> 447 label="Blocks"/>
432 </when> 448 </when>
528 <option value="resample">resample</option> 544 <option value="resample">resample</option>
529 <option value="peaks">peaks</option> 545 <option value="peaks">peaks</option>
530 </param> 546 </param>
531 <when value="bin"> 547 <when value="bin">
532 <param name="bin_width" type="float" value="1" 548 <param name="bin_width" type="float" value="1"
533 label="The width of a bin in mz or ppm" help="Width must be greater than Range of mz values/Number of mz features"/> 549 label="The width of a bin in mz or ppm" help="Width must be greater than range of mz values divided by number of mz features"/>
534 <param name="bin_units" type="select" display="radio" 550 <param name="bin_units" type="select" display="radio"
535 label="Unit for bin"> 551 label="Unit for bin">
536 <option value="mz" selected="True">mz</option> 552 <option value="mz" selected="True">mz</option>
537 <option value="ppm">ppm</option> 553 <option value="ppm">ppm</option>
538 </param> 554 </param>
542 <option value="sum">sum</option> 558 <option value="sum">sum</option>
543 </param> 559 </param>
544 </when> 560 </when>
545 <when value="resample"> 561 <when value="resample">
546 <param name="resample_step" type="float" value="1" 562 <param name="resample_step" type="float" value="1"
547 label="The step size in mz" help="Step size must be greater than Range of mz values/Number of mz features"/> 563 label="The step size in mz" help="Step size must be greater than range of mz values divided by number of mz features"/>
548 </when> 564 </when>
549 <when value="peaks"> 565 <when value="peaks">
550 <param name="peaks_type" type="select" display="radio" 566 <param name="peaks_type" type="select" display="radio"
551 label="Should the peak height or area under the curve be taken as the intensity value?"> 567 label="Should the peak height or area under the curve be taken as the intensity value?">
552 <option value="height" selected="True">height</option> 568 <option value="height" selected="True">height</option>
565 <when value="msidata_ref"> 581 <when value="msidata_ref">
566 <param name="peaks_msidata" type="data" format="rdata," label="Picked and aligned Cardinal MSImageSet saved as RData"/> 582 <param name="peaks_msidata" type="data" format="rdata," label="Picked and aligned Cardinal MSImageSet saved as RData"/>
567 </when> 583 </when>
568 </conditional> 584 </conditional>
569 </when> 585 </when>
586 </conditional>
587 </when>
588 <when value="Transformation">
589 <conditional name="transf_conditional">
590 <param name="trans_type" type="select" label="Choose which intensity transformation you want to apply" help="logarithm base 2 (log2) or squareroot (sqrt)">
591 <option value="log2" selected="True">log2</option>
592 <option value="sqrt">sqrt</option>
593 </param>
594 <when value="log2"/>
595 <when value="sqrt"/>
570 </conditional> 596 </conditional>
571 </when> 597 </when>
572 </conditional> 598 </conditional>
573 </repeat> 599 </repeat>
574 <conditional name="outputs"> 600 <conditional name="outputs">
595 <data format="tabular" name="matrixasoutput" label="Intensity matrix ${on_string}"> 621 <data format="tabular" name="matrixasoutput" label="Intensity matrix ${on_string}">
596 <filter>output_matrix</filter> 622 <filter>output_matrix</filter>
597 </data> 623 </data>
598 </outputs> 624 </outputs>
599 <tests> 625 <tests>
600 <test> 626 <test expect_num_outputs="2">
601 <param name="infile" value="" ftype="imzml"> 627 <param name="infile" value="" ftype="imzml">
602 <composite_data value="Example_Continuous.imzML"/> 628 <composite_data value="Example_Continuous.imzML"/>
603 <composite_data value="Example_Continuous.ibd"/> 629 <composite_data value="Example_Continuous.ibd"/>
604 </param> 630 </param>
605 <repeat name="methods"> 631 <repeat name="methods">
606 <conditional name="methods_conditional"> 632 <conditional name="methods_conditional">
607 <param name="preprocessing_method" value="Normalization" /> 633 <param name="preprocessing_method" value="Normalization"/>
608 </conditional> 634 </conditional>
609 </repeat> 635 </repeat>
610 <repeat name="methods"> 636 <repeat name="methods">
611 <conditional name="methods_conditional"> 637 <conditional name="methods_conditional">
612 <param name="preprocessing_method" value="Smoothing" /> 638 <param name="preprocessing_method" value="Smoothing"/>
613 <conditional name="methods_for_smoothing"> 639 <conditional name="methods_for_smoothing">
614 <param name="smoothing_method" value="gaussian" /> 640 <param name="smoothing_method" value="gaussian"/>
615 </conditional> 641 </conditional>
616 </conditional> 642 </conditional>
617 </repeat> 643 </repeat>
618 <repeat name="methods"> 644 <repeat name="methods">
619 <conditional name="methods_conditional"> 645 <conditional name="methods_conditional">
620 <param name="preprocessing_method" value="Peak_picking" /> 646 <param name="preprocessing_method" value="Peak_picking"/>
621 <conditional name="methods_for_picking"> 647 <conditional name="methods_for_picking">
622 <param name="picking_method" value="adaptive" /> 648 <param name="picking_method" value="adaptive"/>
623 </conditional> 649 </conditional>
624 <param name="blocks_picking" value="3" /> 650 <param name="blocks_picking" value="3"/>
625 <param name="window_picking" value="3" /> 651 <param name="window_picking" value="3"/>
626 </conditional> 652 </conditional>
627 </repeat> 653 </repeat>
628 <repeat name="methods"> 654 <repeat name="methods">
629 <conditional name="methods_conditional"> 655 <conditional name="methods_conditional">
630 <param name="preprocessing_method" value="Peak_alignment" /> 656 <param name="preprocessing_method" value="Peak_alignment"/>
631 <conditional name="methods_for_alignment"> 657 <conditional name="methods_for_alignment">
632 <param name="alignment_method" value="diff" /> 658 <param name="alignment_method" value="diff"/>
633 </conditional> 659 </conditional>
634 </conditional> 660 </conditional>
635 </repeat> 661 </repeat>
636 <repeat name="methods"> 662 <repeat name="methods">
637 <conditional name="methods_conditional"> 663 <conditional name="methods_conditional">
638 <param name="preprocessing_method" value="Peak_filtering" /> 664 <param name="preprocessing_method" value="Peak_filtering"/>
639 <param name="frequ_filtering" value="2"/> 665 <param name="frequ_filtering" value="2"/>
666 </conditional>
667 </repeat>
668 <repeat name="methods">
669 <conditional name="methods_conditional">
670 <param name="preprocessing_method" value="Transformation"/>
671 <conditional name="transf_conditional">
672 <param name="trans_type" value="sqrt"/>
673 </conditional>
640 </conditional> 674 </conditional>
641 </repeat> 675 </repeat>
642 <param name="outputs_select" value="no_quality_control"/> 676 <param name="outputs_select" value="no_quality_control"/>
643 <param name="output_matrix" value="True"/> 677 <param name="output_matrix" value="True"/>
644 <output name="msidata_preprocessed" file="preprocessing_results1.RData" compare="sim_size" /> 678 <output name="msidata_preprocessed" file="preprocessing_results1.RData" compare="sim_size"/>
645 <output name="matrixasoutput" file="preprocessing_results1.txt" /> 679 <output name="matrixasoutput" file="preprocessing_results1.txt"/>
646 </test> 680 </test>
647 <test> 681 <test expect_num_outputs="3">
648 <param name="infile" value="example_continous.RData" ftype="rdata"/> 682 <param name="infile" value="example_continous.RData" ftype="rdata"/>
649 <repeat name="methods"> 683 <repeat name="methods">
650 <conditional name="methods_conditional"> 684 <conditional name="methods_conditional">
651 <param name="preprocessing_method" value="Peak_picking" /> 685 <param name="preprocessing_method" value="Peak_picking"/>
652 <param name="blocks_picking" value="3" /> 686 <param name="blocks_picking" value="3"/>
653 <param name="window_picking" value="5" /> 687 <param name="window_picking" value="5"/>
654 <param name="methods_for_picking" value="simple" /> 688 <conditional name="methods_for_picking">
655 </conditional> 689 <param name="picking_method" value="simple"/>
656 </repeat> 690 </conditional>
657 <repeat name="methods"> 691 </conditional>
658 <conditional name="methods_conditional"> 692 </repeat>
659 <param name="preprocessing_method" value="Peak_alignment" /> 693 <repeat name="methods">
660 <param name="methods_for_alignment" value="DP" /> 694 <conditional name="methods_conditional">
695 <param name="preprocessing_method" value="Peak_alignment"/>
696 <conditional name="methods_for_alignment">
697 <param name="alignment_method" value="DP"/>
698 </conditional>
661 </conditional> 699 </conditional>
662 </repeat> 700 </repeat>
663 <param name="outputs_select" value="quality_control"/> 701 <param name="outputs_select" value="quality_control"/>
664 <param name="calibrant_file" ftype="tabular" value="inputcalibrantfile2.tabular"/> 702 <param name="calibrant_file" ftype="tabular" value="inputcalibrantfile2.tabular"/>
665 <param name="calibrants_column" value="1"/> 703 <param name="calibrants_column" value="1"/>
666 <param name="plusminus_dalton" value="0.25"/> 704 <param name="plusminus_dalton" value="0.25"/>
667 <param name="output_matrix" value="True"/> 705 <param name="output_matrix" value="True"/>
668 <output name="msidata_preprocessed" file="preprocessing_results2.RData" compare="sim_size" /> 706 <output name="msidata_preprocessed" file="preprocessing_results2.RData" compare="sim_size"/>
669 <output name="matrixasoutput" file="preprocessing_results2.txt" lines_diff="2" /> 707 <output name="matrixasoutput" file="preprocessing_results2.txt" lines_diff="2"/>
670 <output name="QC_plots" file="preprocessing_results2.pdf" compare="sim_size"/> 708 <output name="QC_plots" file="preprocessing_results2.pdf" compare="sim_size"/>
671 </test> 709 </test>
672 <test> 710 <test expect_num_outputs="2">
673 <param name="infile" value="" ftype="analyze75"> 711 <param name="infile" value="" ftype="analyze75">
674 <composite_data value="Analyze75.hdr"/> 712 <composite_data value="Analyze75.hdr"/>
675 <composite_data value="Analyze75.img"/> 713 <composite_data value="Analyze75.img"/>
676 <composite_data value="Analyze75.t2m"/> 714 <composite_data value="Analyze75.t2m"/>
677 </param> 715 </param>
678 <repeat name="methods"> 716 <repeat name="methods">
679 <conditional name="methods_conditional"> 717 <conditional name="methods_conditional">
680 <param name="preprocessing_method" value="Normalization" /> 718 <param name="preprocessing_method" value="Normalization"/>
681 </conditional> 719 </conditional>
682 </repeat> 720 </repeat>
683 <repeat name="methods"> 721 <repeat name="methods">
684 <conditional name="methods_conditional"> 722 <conditional name="methods_conditional">
685 <param name="preprocessing_method" value="Peak_picking" /> 723 <param name="preprocessing_method" value="Peak_picking"/>
686 <param name="blocks_picking" value="3" /> 724 <param name="blocks_picking" value="100"/>
687 <param name="window_picking" value="5" /> 725 <param name="window_picking" value="5"/>
688 <param name="methods_for_picking" value="limpic" /> 726 <conditional name="methods_for_picking">
689 </conditional> 727 <param name="picking_method" value="limpic"/>
690 </repeat> 728 </conditional>
691 <repeat name="methods"> 729 </conditional>
692 <conditional name="methods_conditional"> 730 </repeat>
693 <param name="preprocessing_method" value="Peak_alignment" /> 731 <repeat name="methods">
694 <param name="methods_for_alignment" value="diff" /> 732 <conditional name="methods_conditional">
733 <param name="preprocessing_method" value="Peak_alignment"/>
734 <conditional name="methods_for_alignment">
735 <param name="alignment_method" value="diff"/>
736 </conditional>
695 </conditional> 737 </conditional>
696 </repeat> 738 </repeat>
697 <param name="outputs_select" value="quality_control"/> 739 <param name="outputs_select" value="quality_control"/>
698 <param name="calibrant_file" ftype="tabular" value="inputcalibrantfile2.tabular"/> 740 <param name="calibrant_file" ftype="tabular" value="inputcalibrantfile2.tabular"/>
699 <param name="calibrants_column" value="1"/> 741 <param name="calibrants_column" value="1"/>
700 <param name="plusminus_dalton" value="0.25"/> 742 <param name="plusminus_dalton" value="0.25"/>
701 <output name="msidata_preprocessed" file="preprocessing_results3.RData" compare="sim_size" /> 743 <output name="msidata_preprocessed" file="preprocessing_results3.RData" compare="sim_size"/>
702 <output name="QC_plots" file="preprocessing_results3.pdf" compare="sim_size"/> 744 <output name="QC_plots" file="preprocessing_results3.pdf" compare="sim_size"/>
703 </test> 745 </test>
704 <test> 746 <test expect_num_outputs="2">
705 <param name="infile" value="" ftype="analyze75"> 747 <param name="infile" value="" ftype="analyze75">
706 <composite_data value="Analyze75.hdr"/> 748 <composite_data value="Analyze75.hdr"/>
707 <composite_data value="Analyze75.img"/> 749 <composite_data value="Analyze75.img"/>
708 <composite_data value="Analyze75.t2m"/> 750 <composite_data value="Analyze75.t2m"/>
709 </param> 751 </param>
710 <repeat name="methods"> 752 <repeat name="methods">
711 <conditional name="methods_conditional"> 753 <conditional name="methods_conditional">
712 <param name="preprocessing_method" value="Normalization" /> 754 <param name="preprocessing_method" value="Normalization"/>
713 </conditional> 755 </conditional>
714 </repeat> 756 </repeat>
715 <repeat name="methods"> 757 <repeat name="methods">
716 <conditional name="methods_conditional"> 758 <conditional name="methods_conditional">
717 <param name="preprocessing_method" value="Data_reduction" /> 759 <param name="preprocessing_method" value="Data_reduction"/>
718 <param name="bin_width" value="0.1" /> 760 <param name="bin_width" value="0.1"/>
719 </conditional> 761 </conditional>
720 </repeat> 762 </repeat>
721 <param name="outputs_select" value="no_quality_control"/> 763 <param name="outputs_select" value="no_quality_control"/>
722 <param name="output_matrix" value="True"/> 764 <param name="output_matrix" value="True"/>
723 <output name="msidata_preprocessed" file="preprocessing_results4.RData" compare="sim_size" /> 765 <output name="msidata_preprocessed" file="preprocessing_results4.RData" compare="sim_size"/>
724 <output name="matrixasoutput" file="preprocessing_results4.txt" /> 766 <output name="matrixasoutput" file="preprocessing_results4.txt"/>
725 </test> 767 </test>
726 <test> 768 <test expect_num_outputs="3">
727 <param name="infile" value="" ftype="imzml"> 769 <param name="infile" value="" ftype="imzml">
728 <composite_data value="Example_Continuous.imzML"/> 770 <composite_data value="Example_Continuous.imzML"/>
729 <composite_data value="Example_Continuous.ibd"/> 771 <composite_data value="Example_Continuous.ibd"/>
730 </param> 772 </param>
731 <repeat name="methods"> 773 <repeat name="methods">
732 <conditional name="methods_conditional"> 774 <conditional name="methods_conditional">
733 <param name="preprocessing_method" value="Data_reduction" /> 775 <param name="preprocessing_method" value="Data_reduction"/>
734 <param name="step_width" value="0.1" /> 776 <conditional name="methods_for_reduction">
777 <param name="reduction_method" value="resample"/>
778 <param name="step_width" value="0.1"/>
779 </conditional>
780 </conditional>
781 </repeat>
782 <repeat name="methods">
783 <conditional name="methods_conditional">
784 <param name="preprocessing_method" value="Transformation"/>
785 <conditional name="transf_conditional">
786 <param name="trans_type" value="log2"/>
787 </conditional>
735 </conditional> 788 </conditional>
736 </repeat> 789 </repeat>
737 <param name="outputs_select" value="quality_control"/> 790 <param name="outputs_select" value="quality_control"/>
738 <param name="calibrant_file" ftype="tabular" value="inputcalibrantfile1.tabular"/> 791 <param name="calibrant_file" ftype="tabular" value="inputcalibrantfile1.tabular"/>
739 <param name="calibrants_column" value="1"/> 792 <param name="calibrants_column" value="1"/>
740 <param name="plusminus_dalton" value="0.25"/> 793 <param name="plusminus_dalton" value="0.25"/>
741 <param name="output_matrix" value="True"/> 794 <param name="output_matrix" value="True"/>
742 <output name="msidata_preprocessed" file="preprocessing_results5.RData" compare="sim_size" /> 795 <output name="msidata_preprocessed" file="preprocessing_results5.RData" compare="sim_size"/>
743 <output name="matrixasoutput" file="preprocessing_results5.txt" /> 796 <output name="matrixasoutput" file="preprocessing_results5.txt"/>
744 <output name="QC_plots" file="preprocessing_results5.pdf" compare="sim_size"/> 797 <output name="QC_plots" file="preprocessing_results5.pdf" compare="sim_size"/>
745 </test> 798 </test>
746 </tests> 799 </tests>
747 <help> 800 <help>
748 <![CDATA[ 801 <![CDATA[
749 Cardinal is an R package that implements statistical & computational tools for analyzing mass spectrometry imaging datasets. 802
750 803 Cardinal is an R package that implements statistical & computational tools for analyzing mass spectrometry imaging datasets. `More information on Cardinal <http://cardinalmsi.org//>`_
751 **Preprocessing steps:** 804
752 805 This tool provides provides multiple Cardinal functions to preprocess mass-spectrometry imaging data.
753 - Smoothening: Smoothing of the mass peaks reduces noise and improves peak detection 806
807 Input data: 3 types of input data can be used:
808
809 - imzml file (upload imzml and ibd file via the "composite" function) `Introduction to the imzml format <https://ms-imaging.org/wp/imzml/>`_
810 - Analyze7.5 (upload hdr, img and t2m file via the "composite" function)
811 - Cardinal "MSImageSet" data (with variable name "msidata", saved as .RData)
812
813 Options:
814
754 - Normalization: Normalization of intensities to total ion current (TIC) 815 - Normalization: Normalization of intensities to total ion current (TIC)
755 - Baseline reduction: Baseline reduction removes backgroundintensity generated by chemical noise (common in MALDI datasets) 816 - Baseline reduction: Baseline reduction removes backgroundintensity generated by chemical noise (common in MALDI datasets)
756 - Peak picking: relevant peaks are picked while noise-peaks are removed 817 - Smoothening: Smoothing of the mass peaks reduces noise and improves peak detection
757 - Peak alignment: after peak picking, mz inaccuracies are removed by alignment of same peaks to a common mz value 818 - Peak picking: relevant peaks are picked while noise-peaks are removed (needs peak alignment afterwards)
758 - Peak filtering: after peak picking and alignment, removes peaks that occur infrequently, such as those which only occur in a small proportion of pixels. If not sure which cutoff to chose run qualitycontrol first and decide according to the zero value plot. 819 - Peak alignment: only possible after peak picking, mz inaccuracies are removed by alignment of same peaks to a common mz value
820 - Peak filtering: works only on centroided data (after peak picking and alignment or data reduction with peak filtering), removes peaks that occur only in a small proportion of pixels. If not sure which cutoff to chose run qualitycontrol first and decide according to the zero value plot.
759 - Data reduction: binning, resampling or peak filtering to reduce data 821 - Data reduction: binning, resampling or peak filtering to reduce data
822 - Transformation: log2 or squareroot transformation of all intensities
823
824 Output:
825
826 - imzML file, preprocessed
827 - optional: pdf with heatmap of masses of interest after each preprocessing step
828 - optional: intensity matrix as tabular file (intensities for masses in rows and pixel in columns)
829
830 Tip:
831
832 - Peak alignment works only after peak picking
833 - Peak filtering works only on centroided data (peak picking and alignment or Data reduction peaks)
834
760 ]]> 835 ]]>
761 </help> 836 </help>
762 <citations> 837 <citations>
763 <citation type="doi">10.1093/bioinformatics/btv146</citation> 838 <citation type="doi">10.1093/bioinformatics/btv146</citation>
764 </citations> 839 </citations>