comparison msi_qualitycontrol.xml @ 8:52ef77866de8 draft

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/msi_qualitycontrol commit 1c808d60243bb1eeda0cd26cb4b0a17ab05de2c0
author galaxyp
date Mon, 28 May 2018 12:38:50 -0400
parents b86a66dd1a16
children 963c7ec00141
comparison
equal deleted inserted replaced
7:b86a66dd1a16 8:52ef77866de8
1 <tool id="mass_spectrometry_imaging_qc" name="MSI Qualitycontrol" version="1.7.0.5"> 1 <tool id="mass_spectrometry_imaging_qc" name="MSI Qualitycontrol" version="1.10.0.0">
2 <description> 2 <description>
3 mass spectrometry imaging QC 3 mass spectrometry imaging QC
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-ggplot2</requirement> 7 <requirement type="package" version="2.2.1">r-ggplot2</requirement>
8 <requirement type="package" version="1.1_2">r-rcolorbrewer</requirement> 8 <requirement type="package" version="1.1_2">r-rcolorbrewer</requirement>
9 <requirement type="package" version="2.2.1">r-gridextra</requirement> 9 <requirement type="package" version="2.2.1">r-gridextra</requirement>
10 <requirement type="package" version="2.23_15">r-kernsmooth</requirement> 10 <requirement type="package" version="2.23_15">r-kernsmooth</requirement>
11 </requirements> 11 </requirements>
12 <command detect_errors="exit_code"> 12 <command detect_errors="exit_code">
13 <![CDATA[ 13 <![CDATA[
14 #if $infile.ext == 'imzml' 14 #if $infile.ext == 'imzml'
15 cp '${infile.extra_files_path}/imzml' infile.imzML && 15 ln -s '${infile.extra_files_path}/imzml' infile.imzML &&
16 cp '${infile.extra_files_path}/ibd' infile.ibd && 16 ln -s '${infile.extra_files_path}/ibd' infile.ibd &&
17 #elif $infile.ext == 'analyze75' 17 #elif $infile.ext == 'analyze75'
18 cp '${infile.extra_files_path}/hdr' infile.hdr && 18 ln -s '${infile.extra_files_path}/hdr' infile.hdr &&
19 cp '${infile.extra_files_path}/img' infile.img && 19 ln -s '${infile.extra_files_path}/img' infile.img &&
20 cp '${infile.extra_files_path}/t2m' infile.t2m && 20 ln -s '${infile.extra_files_path}/t2m' infile.t2m &&
21 #else 21 #else
22 ln -s '$infile' infile.RData && 22 ln -s '$infile' infile.RData &&
23 #end if 23 #end if
24 cat '${cardinal_qualitycontrol_script}' && 24 cat '${cardinal_qualitycontrol_script}' &&
25 Rscript '${cardinal_qualitycontrol_script}' 25 Rscript '${cardinal_qualitycontrol_script}'
35 library(KernSmooth) 35 library(KernSmooth)
36 36
37 ## Read MALDI Imaging dataset 37 ## Read MALDI Imaging dataset
38 38
39 #if $infile.ext == 'imzml' 39 #if $infile.ext == 'imzml'
40 msidata = readMSIData('infile.imzML') 40 msidata = readImzML('infile')
41 #elif $infile.ext == 'analyze75' 41 #elif $infile.ext == 'analyze75'
42 msidata = readMSIData('infile.hdr') 42 msidata = readAnalyze('infile')
43
44 #else 43 #else
45 load('infile.RData') 44 load('infile.RData')
46 #end if 45 #end if
47 46
48 47
105 peakpickinginfo='FALSE' 104 peakpickinginfo='FALSE'
106 } else { 105 } else {
107 peakpickinginfo=processinginfo@peakPicking 106 peakpickinginfo=processinginfo@peakPicking
108 } 107 }
109 108
110 ### Read tabular file with peptide masses for plots and heatmap images: 109 ### Read tabular file with masses for plots and heatmap images:
111 110
112 #if $peptide_file: 111 #if $peptide_file:
113 112
114 input_list = read.delim("$peptide_file", header = FALSE, na.strings=c("","NA"), stringsAsFactors = FALSE) 113 input_list = read.delim("$peptide_file", header = FALSE, na.strings=c("","NA"), stringsAsFactors = FALSE)
115 if (ncol(input_list) == 1) 114 if (ncol(input_list) == 1)
141 ### calculate how many input calibrant masses are valid: 140 ### calculate how many input calibrant masses are valid:
142 inputcalibrants = calibrant_list[calibrant_list[,1]>minmz & calibrant_list[,1]<maxmz,] 141 inputcalibrants = calibrant_list[calibrant_list[,1]>minmz & calibrant_list[,1]<maxmz,]
143 number_calibrants_in = length(calibrant_list[,1]) 142 number_calibrants_in = length(calibrant_list[,1])
144 number_calibrants_valid = length(inputcalibrants[,1]) 143 number_calibrants_valid = length(inputcalibrants[,1])
145 #else 144 #else
146 ###inputcalibrants = data.frame(0,0)
147 145
148 inputcalibrants = as.data.frame(matrix(, nrow = 0, ncol = 2)) 146 inputcalibrants = as.data.frame(matrix(, nrow = 0, ncol = 2))
149
150 number_calibrants_in = 0 147 number_calibrants_in = 0
151 number_calibrants_valid = 0 148 number_calibrants_valid = 0
152 #end if 149 #end if
153 150
154 colnames(inputcalibrants) = c("mz", "name") 151 colnames(inputcalibrants) = c("mz", "name")
370 if (length(inputmasses) != 0) 367 if (length(inputmasses) != 0)
371 { for (mass in 1:length(inputmasses)) 368 { for (mass in 1:length(inputmasses))
372 { 369 {
373 image(msidata, mz=inputmasses[mass], plusminus=$plusminus_dalton, 370 image(msidata, mz=inputmasses[mass], plusminus=$plusminus_dalton,
374 main= paste0(inputnames[mass], " (", round(inputmasses[mass], digits = 2)," ± ", $plusminus_dalton, " Da)"), 371 main= paste0(inputnames[mass], " (", round(inputmasses[mass], digits = 2)," ± ", $plusminus_dalton, " Da)"),
375 contrast.enhance = "histogram", ylim=c(maximumy+2, 0)) 372 contrast.enhance = "histogram", ylim= c(maximumy+0.2*maximumy,minimumy-0.2*minimumy))
376 } 373 }
377 } else {print("3) The inputpeptide masses were not provided or outside the mass range")} 374 } else {print("3) The inputpeptide masses were not provided or outside the mass range")}
378 375
379 376
380 ## 4) Number of peaks per pixel - image 377 ## 4) Number of peaks per pixel - image
426 423
427 ## 7) pca image for two components 424 ## 7) pca image for two components
428 pca = PCA(msidata, ncomp=2) 425 pca = PCA(msidata, ncomp=2)
429 par(mfrow = c(2,1)) 426 par(mfrow = c(2,1))
430 plot(pca, col=c("black", "darkgrey"), main="PCA for two components") 427 plot(pca, col=c("black", "darkgrey"), main="PCA for two components")
431 image(pca, col=c("black", "white"),ylim=c(maximumy+2, 0), strip=FALSE) 428 image(pca, col=c("black", "white"),ylim= c(maximumy+0.2*maximumy,minimumy-0.2*minimumy), strip=FALSE)
432 429
433 430
434 ############################# III) properties over acquisition (spectra index)########## 431 ############################# III) properties over acquisition (spectra index)##########
435 ############################################################################## 432 ##############################################################################
436 433
598 </configfiles> 595 </configfiles>
599 <inputs> 596 <inputs>
600 <param name="infile" type="data" format="imzml,rdata,analyze75" label="Inputfile as imzML, Analyze7.5 or Cardinal MSImageSet saved as RData" 597 <param name="infile" type="data" format="imzml,rdata,analyze75" label="Inputfile as imzML, Analyze7.5 or Cardinal MSImageSet saved as RData"
601 help="Upload composite datatype imzml (ibd+imzML) or analyze75 (hdr+img+t2m) or regular upload .RData (Cardinal MSImageSet)"/> 598 help="Upload composite datatype imzml (ibd+imzML) or analyze75 (hdr+img+t2m) or regular upload .RData (Cardinal MSImageSet)"/>
602 <param name="filename" type="text" value="" optional="true" label="Title" help="will appear in the quality report. If nothing given it will take the dataset name."/> 599 <param name="filename" type="text" value="" optional="true" label="Title" help="will appear in the quality report. If nothing given it will take the dataset name."/>
603 <param name="peptide_file" type="data" optional="true" format="tabular" label="Text file with peptidemasses and names" 600 <param name="peptide_file" type="data" optional="true" format="tabular" label="Text file with masses and names"
604 help="first column peptide m/z, second column peptide name, tab separated file"/> 601 help="first column m/z, second column name, tab separated file"/>
605 <param name="calibrant_file" type="data" optional="true" format="tabular" 602 <param name="calibrant_file" type="data" optional="true" format="tabular"
606 label="Internal calibrants" 603 label="Internal calibrants and names"
607 help="Used for plot number of calibrant per spectrum and for zoomed in mass spectra"/> 604 help="Used for plot number of calibrant per spectrum and for zoomed in mass spectra"/>
608 <param name="plusminus_dalton" value="0.25" type="text" label="Mass range" help="plusminus mass window in Dalton"/> 605 <param name="plusminus_dalton" value="0.25" type="text" label="Mass range in Dalton" help="Plusminus mass window in Dalton for calibrant and peptide plots"/>
609 <repeat name="calibrantratio" title="Plot fold change of two masses for each spectrum" min="0" max="10"> 606 <repeat name="calibrantratio" title="Plot fold change of two masses for each spectrum" min="0" max="10">
610 <param name="mass1" value="1111" type="float" label="Mass 1" help="First mass in Dalton"/> 607 <param name="mass1" value="1111" type="float" label="Mass 1" help="First mass in Dalton"/>
611 <param name="mass2" value="2222" type="float" label="Mass 2" help="Second mass in Dalton"/> 608 <param name="mass2" value="2222" type="float" label="Mass 2" help="Second mass in Dalton"/>
612 <param name="distance" value="0.25" type="float" label="Distance in Dalton" help="Distance in Da used to find peak maximum from input masses in both directions"/> 609 <param name="distance" value="0.25" type="float" label="Distance in Dalton" help="Distance in Da used to find peak maximum from input masses in both directions"/>
613 <param name="filenameratioplot" type="text" optional="true" label="Title" help="Optional title for fold change plot."/> 610 <param name="filenameratioplot" type="text" optional="true" label="Title" help="Optional title for fold change plot."/>
621 <test> 618 <test>
622 <param name="infile" value="" ftype="imzml"> 619 <param name="infile" value="" ftype="imzml">
623 <composite_data value="Example_Continuous.imzML" /> 620 <composite_data value="Example_Continuous.imzML" />
624 <composite_data value="Example_Continuous.ibd" /> 621 <composite_data value="Example_Continuous.ibd" />
625 </param> 622 </param>
626 <param name="peptide_file" value="inputpeptides.csv" ftype="csv"/> 623 <param name="peptide_file" value="inputpeptides.txt"/>
627 <param name="calibrant_file" ftype="txt" value="inputcalibrantfile1.txt"/> 624 <param name="calibrant_file" value="inputcalibrantfile1.txt"/>
628 <param name="plusminus_dalton" value="0.25"/> 625 <param name="plusminus_dalton" value="0.25"/>
629 <param name="filename" value="Testfile_imzml"/> 626 <param name="filename" value="Testfile_imzml"/>
630 <repeat name="calibrantratio"> 627 <repeat name="calibrantratio">
631 <param name="mass1" value="111"/> 628 <param name="mass1" value="111"/>
632 <param name="mass2" value="222"/> 629 <param name="mass2" value="222"/>
633 <param name="distance" value="0.25"/> 630 <param name="distance" value="0.25"/>
634 <param name="filenameratioplot" value = "Ratio of mass1 (111) / mass2 (222)"/> 631 <param name="filenameratioplot" value = "Ratio of mass1 (111) / mass2 (222)"/>
635 </repeat> 632 </repeat>
636 <output name="plots" file="Testfile_qualitycontrol_imzml.pdf" compare="sim_size" delta="20000"/> 633 <output name="plots" file="QC_imzml.pdf" compare="sim_size" delta="20000"/>
637 </test> 634 </test>
638
639 <test> 635 <test>
640 <param name="infile" value="" ftype="analyze75"> 636 <param name="infile" value="" ftype="analyze75">
641 <composite_data value="Analyze75.hdr"/> 637 <composite_data value="Analyze75.hdr"/>
642 <composite_data value="Analyze75.img"/> 638 <composite_data value="Analyze75.img"/>
643 <composite_data value="Analyze75.t2m"/> 639 <composite_data value="Analyze75.t2m"/>
644 </param> 640 </param>
645 <param name="peptide_file" value="inputpeptides.txt" ftype="txt"/> 641 <param name="peptide_file" value="inputpeptides.txt"/>
646 <param name="calibrant_file" ftype="txt" value="inputcalibrantfile2.txt"/> 642 <param name="calibrant_file" value="inputcalibrantfile2.txt"/>
647 <param name="plusminus_dalton" value="0.5"/> 643 <param name="plusminus_dalton" value="0.5"/>
648 <param name="filename" value="Testfile_analyze75"/> 644 <param name="filename" value="Testfile_analyze75"/>
649 <output name="plots" file="Testfile_qualitycontrol_analyze75.pdf" compare="sim_size" delta="20000"/> 645 <output name="plots" file="QC_analyze75.pdf" compare="sim_size" delta="20000"/>
650 </test> 646 </test>
651
652 <test> 647 <test>
653 <param name="infile" value="preprocessing_results1.RData" ftype="rdata"/> 648 <param name="infile" value="preprocessed.RData" ftype="rdata"/>
649 <param name="plusminus_dalton" value="0"/>
650 <param name="filename" value="Testfile_rdata"/>
651 <output name="plots" file="QC_rdata.pdf" compare="sim_size" delta="20000"/>
652 </test>
653 <test>
654 <param name="infile" value="empty_spectra.rdata" ftype="rdata"/>
655 <param name="peptide_file" value="inputpeptides.txt"/>
656 <param name="calibrant_file" value="inputcalibrantfile2.txt"/>
654 <param name="plusminus_dalton" value="0.1"/> 657 <param name="plusminus_dalton" value="0.1"/>
655 <param name="filename" value="Testfile_rdata"/> 658 <param name="filename" value="Testfile_rdata"/>
656 <output name="plots" file="Testfile_qualitycontrol_rdata.pdf" compare="sim_size" delta="20000"/> 659 <output name="plots" file="QC_empty_spectra.pdf" compare="sim_size" delta="20000"/>
657 </test>
658 <test>
659 <param name="infile" value="LM8_file16.rdata" ftype="rdata"/>
660 <param name="peptide_file" value="inputpeptides.txt" ftype="txt"/>
661 <param name="calibrant_file" ftype="txt" value="inputcalibrantfile2.txt"/>
662 <param name="plusminus_dalton" value="0.1"/>
663 <param name="filename" value="Testfile_rdata"/>
664 <output name="plots" file="LM8_file16output.pdf" compare="sim_size" delta="20000"/>
665 </test> 660 </test>
666 </tests> 661 </tests>
667 <help> 662 <help>
668 <![CDATA[ 663 <![CDATA[
669 Quality control for maldi imaging mass spectrometry data. The output of this tool contains key values and plots of the imaging data as pdf. 664 Cardinal is an R package that implements statistical & computational tools for analyzing mass spectrometry imaging datasets. `More information on Cardinal <http://cardinalmsi.org//>`_
670 For additional beautiful heatmap images use the MSI ion images tool and to plot more mass spectra use the MSI massspectra tool. 665
666 This tool uses some Cardinal functions to create a quality control report with descriptive plots for mass-spectrometry imaging data.
671 667
672 Input data: 3 types of input data can be used: 668 Input data: 3 types of input data can be used:
673 669
674 - imzml file (upload imzml and ibd file via the "composite" function) `Introduction to the imzml format <http://ms-imaging.org/wp/introduction/>`_ 670 - imzml file (upload imzml and ibd file via the "composite" function) `Introduction to the imzml format <https://ms-imaging.org/wp/imzml/>`_
675 - Analyze7.5 (upload hdr, img and t2m file via the "composite" function) 671 - Analyze7.5 (upload hdr, img and t2m file via the "composite" function)
676 - Cardinal "MSImageSet" data (with variable name "msidata", saved as .RData) 672 - Cardinal "MSImageSet" data (with variable name "msidata", saved as .RData)
677 673
678 674 Options:
675
676 - masses of interest as tabular file, used to generate heatmap images
677 - internal calibrants as tabular file, used for the following plots: Number of calibrant per spectrum, heatmap images, mass-spectrum plot zoomed in for calibrant region, ppm accuracy
678 - fold change plot: draws a heatmap of the fold change of two masses (log2(intensity ratio))
679
680 Output:
681
682 - pdf with numbers and descriptive plots to check the quality of the mass-spectrometry imaging data
683
684 Tip:
685
686 - For additional heatmap images use the MSI ion images tool and to plot more mass spectra use the MSI massspectra tool.
679 687
680 ]]> 688 ]]>
681 </help> 689 </help>
682 <citations> 690 <citations>
683 <citation type="doi">10.1093/bioinformatics/btv146</citation> 691 <citation type="doi">10.1093/bioinformatics/btv146</citation>