comparison macros.xml @ 2:d4803c1e5e19 draft

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/cardinal commit f127be2141cf22e269c85282d226eb16fe14a9c1
author galaxyp
date Fri, 15 Feb 2019 10:21:09 -0500
parents ae9ffc7ba261
children 3b7a35d50ebf
comparison
equal deleted inserted replaced
1:ae9ffc7ba261 2:d4803c1e5e19
54 #end if 54 #end if
55 55
56 ]]></token> 56 ]]></token>
57 57
58 <token name="@DATA_PROPERTIES@"><![CDATA[ 58 <token name="@DATA_PROPERTIES@"><![CDATA[
59 ## Number of features (mz)
60 maxfeatures = length(features(msidata))
61 ## Range mz
62 minmz = round(min(mz(msidata)), digits=2)
63 maxmz = round(max(mz(msidata)), digits=2)
64 ## Number of spectra (pixels)
65 pixelcount = length(pixels(msidata))
66 ## Range x coordinates
67 minimumx = min(coord(msidata)[,1])
68 maximumx = max(coord(msidata)[,1])
69 ## Range y coordinates
70 minimumy = min(coord(msidata)[,2])
71 maximumy = max(coord(msidata)[,2])
72
73
74 properties = c("Number of m/z features",
75 "Range of m/z values",
76 "Number of pixels",
77 "Range of x coordinates",
78 "Range of y coordinates")
79
80 values = c(paste0(maxfeatures),
81 paste0(minmz, " - ", maxmz),
82 paste0(pixelcount),
83 paste0(minimumx, " - ", maximumx),
84 paste0(minimumy, " - ", maximumy))
85
86 property_df = data.frame(properties, values)
87 ]]></token>
88
89 <token name="@READING_MSIDATA_INRAM@"><![CDATA[
90 ## importing MSI data files
91
92 ## function to read RData files independent of filename
93 loadRData <- function(fileName){
94 load(fileName)
95 get(ls()[ls() != "fileName"])
96 }
97
98 #if $infile.ext == 'imzml'
99 #if str($processed_cond.processed_file) == "processed":
100 msidata <- readImzML('infile', mass.accuracy=$processed_cond.accuracy, units.accuracy = "$processed_cond.units")
101 centroided(msidata) = $centroids
102 #else
103 msidata <- readImzML('infile')
104 centroided(msidata) = $centroids
105 #end if
106 #elif $infile.ext == 'analyze75'
107 msidata = readAnalyze('infile')
108 centroided(msidata) = $centroids
109 #else
110 msidata = loadRData('infile.RData')
111 #end if
112
113 ]]></token>
114
115 <token name="@DATA_PROPERTIES_INRAM@"><![CDATA[
116 ########################### QC numbers ########################
117 ## including intensity calculations which need data in RAM
59 ## Number of features (mz) 118 ## Number of features (mz)
60 maxfeatures = length(features(msidata)) 119 maxfeatures = length(features(msidata))
61 ## Range mz 120 ## Range mz
62 minmz = round(min(mz(msidata)), digits=2) 121 minmz = round(min(mz(msidata)), digits=2)
63 maxmz = round(max(mz(msidata)), digits=2) 122 maxmz = round(max(mz(msidata)), digits=2)
72 ## Range of intensities 131 ## Range of intensities
73 minint = round(min(spectra(msidata)[], na.rm=TRUE), digits=2) 132 minint = round(min(spectra(msidata)[], na.rm=TRUE), digits=2)
74 maxint = round(max(spectra(msidata)[], na.rm=TRUE), digits=2) 133 maxint = round(max(spectra(msidata)[], na.rm=TRUE), digits=2)
75 ## Number of intensities > 0, for if conditions 134 ## Number of intensities > 0, for if conditions
76 npeaks= sum(spectra(msidata)[]>0, na.rm=TRUE) 135 npeaks= sum(spectra(msidata)[]>0, na.rm=TRUE)
136 ## Number of NA in spectra matrix
137 NAcount = sum(is.na(spectra(msidata)[]))
138 ## Number of NA in spectra matrix
139 infcount = sum(is.infinite(spectra(msidata)[]))
77 140
78 properties = c("Number of m/z features", 141 properties = c("Number of m/z features",
79 "Range of m/z values", 142 "Range of m/z values",
80 "Number of pixels", 143 "Number of pixels",
81 "Range of x coordinates", 144 "Range of x coordinates",
82 "Range of y coordinates", 145 "Range of y coordinates",
83 "Range of intensities") 146 "Range of intensities",
147 "Number of NA intensities",
148 "Number of Inf intensities")
84 149
85 values = c(paste0(maxfeatures), 150 values = c(paste0(maxfeatures),
86 paste0(minmz, " - ", maxmz), 151 paste0(minmz, " - ", maxmz),
87 paste0(pixelcount), 152 paste0(pixelcount),
88 paste0(minimumx, " - ", maximumx), 153 paste0(minimumx, " - ", maximumx),
89 paste0(minimumy, " - ", maximumy), 154 paste0(minimumy, " - ", maximumy),
90 paste0(minint, " - ", maxint)) 155 paste0(minint, " - ", maxint),
156 paste0(NAcount),
157 paste0(infcount))
91 158
92 property_df = data.frame(properties, values) 159 property_df = data.frame(properties, values)
93 ]]></token> 160 ]]></token>
94 161
95 <token name="@CARDINAL_DESCRIPTION@"><![CDATA[ 162 <token name="@CARDINAL_DESCRIPTION@"><![CDATA[
142 209
143 ]]></token> 210 ]]></token>
144 <token name="@SPECTRA_TABULAR_INPUT_DESCRIPTION@"><![CDATA[ 211 <token name="@SPECTRA_TABULAR_INPUT_DESCRIPTION@"><![CDATA[
145 - Optional file with pixel coordinates and annotation: 212 - Optional file with pixel coordinates and annotation:
146 213
147 - Tabular file: One column with x values, one column wiht y values and one column with annotations 214 - Tabular file: One column with x values, one column with y values and one column with annotations
148 - The file is allowed to have any column names as header (in this case set "Tabular file contains a header line" to yes) 215 - The file is allowed to have any column names as header (in this case set "Tabular file contains a header line" to yes)
149 - Pixel with coordinates outside the coordinates of the input file are ignored 216 - Pixel with coordinates outside the coordinates of the input file are ignored
150 217
151 :: 218 ::
152 219
153 x_coord y_coord annotation 220 x_coord y_coord annotation
154 1 1 healthy 221 1 1 healthy
159 226
160 ]]></token> 227 ]]></token>
161 228
162 <xml name="reading_msidata"> 229 <xml name="reading_msidata">
163 <param name="infile" type="data" format="imzml,rdata,analyze75" 230 <param name="infile" type="data" format="imzml,rdata,analyze75"
164 label="Input file as imzML, Analyze7.5 or Cardinal MSImageSet saved as RData" 231 label="MSI data"
165 help="Upload composite datatype imzML (ibd+imzML) or analyze75 (hdr+img+t2m) or regular upload .RData (Cardinal MSImageSet)"/> 232 help="Input file as imzML (composite upload), or Cardinal MSImageSet saved as RData (regular upload)"/>
166 <param name="centroids" type="boolean" label="Is the input data centroided (picked)" help="Choose Yes if peak detection has already been done." truevalue="TRUE" falsevalue="FALSE"/> 233 <param name="centroids" type="boolean" label="Centroided input" help="Choose Yes if peak detection has already been done." truevalue="TRUE" falsevalue="FALSE"/>
167 <conditional name="processed_cond"> 234 <conditional name="processed_cond">
168 <param name="processed_file" type="select" label="Processed imzML file" help="Choose no if your input is an Analyze7.5 or continuous imzML file"> 235 <param name="processed_file" type="select" label="Processed imzML file" help="Choose no if your input is an Analyze7.5 or continuous imzML file">
169 <option value="no_processed" selected="True">no</option> 236 <option value="no_processed" selected="True">no</option>
170 <option value="processed">yes</option> 237 <option value="processed">yes</option>
171 </param> 238 </param>