comparison msi_qualitycontrol.xml @ 3:f6aa0cff777c draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/msi_qualitycontrol commit 9f8984da558d0a307fed3ff3af9313829d2e5baa
author galaxyp
date Sat, 24 Feb 2018 12:48:28 -0500
parents 1ccbda92b76b
children fef8bd551236
comparison
equal deleted inserted replaced
2:1ccbda92b76b 3:f6aa0cff777c
1 <tool id="mass_spectrometry_imaging_qc" name="MSI Qualitycontrol" version="1.7.0.1"> 1 <tool id="mass_spectrometry_imaging_qc" name="MSI Qualitycontrol" version="1.7.0.2">
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.7.0">bioconductor-cardinal</requirement>
157 "Normalization", 157 "Normalization",
158 "Smoothing", 158 "Smoothing",
159 "Baseline reduction", 159 "Baseline reduction",
160 "Peak picking", 160 "Peak picking",
161 "Centroided", 161 "Centroided",
162 "# valid input masses") 162 paste0("# valid masses in ", "$filename"))
163 163
164 values = c(paste0(maxfeatures), 164 values = c(paste0(maxfeatures),
165 paste0(minmz, " - ", maxmz), 165 paste0(minmz, " - ", maxmz),
166 paste0(pixelcount), 166 paste0(pixelcount),
167 paste0(minimumx, " - ", maximumx), 167 paste0(minimumx, " - ", maximumx),
174 paste0(normalizationinfo), 174 paste0(normalizationinfo),
175 paste0(smoothinginfo), 175 paste0(smoothinginfo),
176 paste0(baselinereductioninfo), 176 paste0(baselinereductioninfo),
177 paste0(peakpickinginfo), 177 paste0(peakpickinginfo),
178 paste0(centroidedinfo), 178 paste0(centroidedinfo),
179 paste0(length(inputmasses))) 179 paste0(length(inputmasses), "/", length(calibrant_list[,1])+length(input_list[,1])))
180 180
181 181
182 property_df = data.frame(properties, values) 182 property_df = data.frame(properties, values)
183 183
184 ######################################## PDF ############################################# 184 ######################################## PDF #############################################
285 #for $foldchanges in $calibrantratio: 285 #for $foldchanges in $calibrantratio:
286 mass1 = $foldchanges.mass1 286 mass1 = $foldchanges.mass1
287 mass2 = $foldchanges.mass2 287 mass2 = $foldchanges.mass2
288 distance = $foldchanges.distance 288 distance = $foldchanges.distance
289 289
290 #if not str($foldchanges.filenameratioplot).strip():
291 #set $label = "Fold change %s Da / %s Da" % ($foldchanges.mass1, $foldchanges.mass2)
292 #else:
293 #set $label = $foldchanges.filenameratioplot
294 #end if
295
290 ### find rows which contain masses: 296 ### find rows which contain masses:
291 297
292 mzrowdown1 = features(msidata, mz = mass1-distance) 298 mzrowdown1 = features(msidata, mz = mass1-distance)
293 mzrowup1 = features(msidata, mz = mass1+distance) 299 mzrowup1 = features(msidata, mz = mass1+distance)
294 mzrowdown2 = features(msidata, mz = mass2-distance) 300 mzrowdown2 = features(msidata, mz = mass2-distance)
337 foldchange = log2(mass1vector/mass2vector) 343 foldchange = log2(mass1vector/mass2vector)
338 344
339 ratiomatrix = cbind(foldchange, coord(msidata)) 345 ratiomatrix = cbind(foldchange, coord(msidata))
340 346
341 print(ggplot(ratiomatrix, aes(x=x, y=y, fill=foldchange), colour=colo) 347 print(ggplot(ratiomatrix, aes(x=x, y=y, fill=foldchange), colour=colo)
342 +scale_y_reverse() + geom_tile() + coord_fixed() 348 + geom_tile() + coord_fixed()
343 + ggtitle(paste0("Fold change ", mass1, " Da / ", mass2, " Da")) 349 + ggtitle("$label")
344 + theme_bw() 350 + theme_bw()
345 + theme(text=element_text(family="ArialMT", face="bold", size=12)) 351 + theme(text=element_text(family="ArialMT", face="bold", size=12))
346 + scale_fill_gradientn(colours = c("blue", "purple" , "red","orange") 352 + scale_fill_gradientn(colours = c("blue", "purple" , "red","orange")
347 ,space = "Lab", na.value = "black", name ="FC")) 353 ,space = "Lab", na.value = "black", name ="FC"))
348 #end for 354 #end for
349 #end if 355 #end if
350 356
351 ## 3) Calibrant images: 357 ## 3) Calibrant images:
352 358
359 par(mfrow=c(1,1), mar=c(5.1, 4.1, 4.1, 2.1), mgp=c(3, 1, 0), las=0)
353 if (length(inputmasses) != 0) 360 if (length(inputmasses) != 0)
354 { for (mass in 1:length(inputmasses)) 361 { for (mass in 1:length(inputmasses))
355 { 362 {
356 image(msidata, mz=inputmasses[mass], plusminus=$plusminusinDalton, 363 image(msidata, mz=inputmasses[mass], plusminus=$plusminusinDalton,
357 main= paste0("3",LETTERS[mass], ") ", inputnames[mass], " (", round(inputmasses[mass], digits = 2), " Da)"), 364 main= paste0("3", LETTERS[mass], ") ", inputnames[mass], " (", round(inputmasses[mass], digits = 2)," ± ", $plusminusinDalton, " Da)"),
358 contrast.enhance = "histogram", ylim=c(maxy+1, 0)) 365 contrast.enhance = "histogram", ylim=c(maxy+1, 0))
359 } 366 }
360 } else {print("3) The inputpeptide masses were outside the mass range")} 367 } else {print("3) The inputpeptide masses were outside the mass range")}
361 368
362 ## 4) Number of peaks per pixel - image 369 ## 4) Number of peaks per pixel - image
557 } 564 }
558 565
559 ]]></configfile> 566 ]]></configfile>
560 </configfiles> 567 </configfiles>
561 <inputs> 568 <inputs>
562 <param name="infile" type="data" format="imzml, rdata, analyze75" label="Inputfile as imzML, Analyze7.5 or Cardinal MSImageSet saved as RData" 569 <param name="infile" type="data" format="imzml,rdata,analyze75" label="Inputfile as imzML, Analyze7.5 or Cardinal MSImageSet saved as RData"
563 help="Upload composite datatype imzml (ibd+imzML) or analyze75 (hdr+img+t2m) or regular upload .RData (Cardinal MSImageSet)"/> 570 help="Upload composite datatype imzml (ibd+imzML) or analyze75 (hdr+img+t2m) or regular upload .RData (Cardinal MSImageSet)"/>
564 <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."/> 571 <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."/>
565 <param name="inputpeptidefile" type="data" optional="true" format="txt, csv" label="Text file with peptidemasses and names" 572 <param name="inputpeptidefile" type="data" optional="true" format="txt, csv" label="Text file with peptidemasses and names"
566 help="first column peptide m/z, second column peptide name, tab separated file"/> 573 help="first column peptide m/z, second column peptide name, tab separated file"/>
567 <param name="inputcalibrants" type="data" optional="true" format="txt,csv" 574 <param name="inputcalibrants" type="data" optional="true" format="txt,csv"
570 <param name="plusminusinDalton" value="0.25" type="text" label="Mass range" help="plusminus mass window in Dalton"/> 577 <param name="plusminusinDalton" value="0.25" type="text" label="Mass range" help="plusminus mass window in Dalton"/>
571 <repeat name="calibrantratio" title="Plot fold change of two masses for each spectrum" min="0" max="10"> 578 <repeat name="calibrantratio" title="Plot fold change of two masses for each spectrum" min="0" max="10">
572 <param name="mass1" value="1111" type="float" label="Mass 1" help="First mass in Dalton"/> 579 <param name="mass1" value="1111" type="float" label="Mass 1" help="First mass in Dalton"/>
573 <param name="mass2" value="2222" type="float" label="Mass 2" help="Second mass in Dalton"/> 580 <param name="mass2" value="2222" type="float" label="Mass 2" help="Second mass in Dalton"/>
574 <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"/> 581 <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"/>
582 <param name="filenameratioplot" type="text" optional="true" label="Title" help="Optional title for fold change plot."/>
575 </repeat> 583 </repeat>
576 </inputs> 584 </inputs>
577 <outputs> 585 <outputs>
578 <data format="pdf" name="plots" from_work_dir="qualitycontrol.pdf" label = "${tool.name} on $infile.display_name"/> 586 <data format="pdf" name="plots" from_work_dir="qualitycontrol.pdf" label = "${tool.name} on $infile.display_name"/>
579 </outputs> 587 </outputs>