comparison spectra_plots.xml @ 1:45fb4dd8400b draft

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/cardinal commit d2f311f7fff24e54c565127c40414de708e31b3c
author galaxyp
date Thu, 25 Oct 2018 07:21:18 -0400
parents de334e98f1c1
children 95fc17c26ade
comparison
equal deleted inserted replaced
0:de334e98f1c1 1:45fb4dd8400b
1 <tool id="cardinal_spectra_plots" name="MSI plot spectra" version="@VERSION@.0"> 1 <tool id="cardinal_spectra_plots" name="MSI plot spectra" version="@VERSION@.1">
2 <description> 2 <description>
3 mass spectrometry imaging mass spectra plots 3 mass spectrometry imaging mass spectra plots
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.2.1">r-gridextra</requirement> 9 <requirement type="package" version="3.0">r-ggplot2</requirement>
10 <requirement type="package" version="2.2.1">r-ggplot2</requirement> 10 <requirement type="package" version="2.3">r-gridextra</requirement>
11 <requirement type="package" version="0.5.0">r-scales</requirement> 11 <requirement type="package" version="1.0.0">r-scales</requirement>
12 </expand> 12 </expand>
13 <command detect_errors="exit_code"> 13 <command detect_errors="exit_code">
14 <![CDATA[ 14 <![CDATA[
15 @INPUT_LINKING@ 15 @INPUT_LINKING@
16 cat '${MSI_mzplots}' && 16 cat '${MSI_mzplots}' &&
29 29
30 @READING_MSIDATA@ 30 @READING_MSIDATA@
31 31
32 @DATA_PROPERTIES@ 32 @DATA_PROPERTIES@
33 33
34
34 ######################################## PDF ################################### 35 ######################################## PDF ###################################
35 ################################################################################ 36 ################################################################################
36 ################################################################################ 37 ################################################################################
37 38
38 39
49 50
50 grid.table(property_df, rows= NULL) 51 grid.table(property_df, rows= NULL)
51 52
52 ## set NA to 0 otherwise plot function will not work 53 ## set NA to 0 otherwise plot function will not work
53 54
54 spectra(msidata)[is.na(spectra(msidata)[])] = 0 ## in case of NA values they will be set to zero 55 ##spectra(msidata)[is.na(spectra(msidata)[])] = 0 ## in case of NA values they will be set to zero
56
57 spectra_df = spectra(msidata)[]
58 spectra_df[is.na(spectra_df)] = 0
59 print(paste0("Number of NA which were converted into 0:",sum(is.na(spectra_df))))
60 spectra(msidata) = spectra_df
61
55 62
56 if (npeaks > 0){ 63 if (npeaks > 0){
57 64
58 pixeldf = data.frame(matrix(ncol = 2, nrow=0)) 65 pixeldf = data.frame(matrix(ncol = 2, nrow=0))
59 66
86 plot(msidata, coord=list(x=$chosenpixel.inputx, y=$chosenpixel.inputy)) 93 plot(msidata, coord=list(x=$chosenpixel.inputx, y=$chosenpixel.inputy))
87 94
88 ##################### IV) plot zoom-in mass spectrum ############### 95 ##################### IV) plot zoom-in mass spectrum ###############
89 96
90 #if $chosenpixel.zoomedplot: 97 #if $chosenpixel.zoomedplot:
91 iData(msidata) <- iData(msidata)[] ## getting back data on disk
92 98
93 #for $token in $chosenpixel.zoomedplot: 99 #for $token in $chosenpixel.zoomedplot:
94 100
95 minmasspixel = features(msidata, mz=$token.xlimmin) 101 minmasspixel = features(msidata, mz=$token.xlimmin)
96 maxmasspixel = features(msidata, mz=$token.xlimmax) 102 maxmasspixel = features(msidata, mz=$token.xlimmax)
251 257
252 }else{ 258 }else{
253 print("Inputfile has no intensities > 0") 259 print("Inputfile has no intensities > 0")
254 dev.off() 260 dev.off()
255 } 261 }
262
263
256 ]]></configfile> 264 ]]></configfile>
257 </configfiles> 265 </configfiles>
258 <inputs> 266 <inputs>
259 <expand macro="reading_msidata"/> 267 <expand macro="reading_msidata"/>
260 <expand macro="pdf_filename"/> 268 <expand macro="pdf_filename"/>