Mercurial > repos > galaxyp > cardinal_data_exporter
diff macros.xml @ 2:e30d8b72415f 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:17:43 -0500 |
parents | 65ef413a35f3 |
children | e521b5767819 |
line wrap: on
line diff
--- a/macros.xml Thu Oct 25 07:26:29 2018 -0400 +++ b/macros.xml Fri Feb 15 10:17:43 2019 -0500 @@ -69,25 +69,92 @@ ## Range y coordinates minimumy = min(coord(msidata)[,2]) maximumy = max(coord(msidata)[,2]) + + + properties = c("Number of m/z features", + "Range of m/z values", + "Number of pixels", + "Range of x coordinates", + "Range of y coordinates") + + values = c(paste0(maxfeatures), + paste0(minmz, " - ", maxmz), + paste0(pixelcount), + paste0(minimumx, " - ", maximumx), + paste0(minimumy, " - ", maximumy)) + + property_df = data.frame(properties, values) + ]]></token> + + <token name="@READING_MSIDATA_INRAM@"><![CDATA[ + ## importing MSI data files + + ## function to read RData files independent of filename + loadRData <- function(fileName){ + load(fileName) + get(ls()[ls() != "fileName"]) + } + + #if $infile.ext == 'imzml' + #if str($processed_cond.processed_file) == "processed": + msidata <- readImzML('infile', mass.accuracy=$processed_cond.accuracy, units.accuracy = "$processed_cond.units") + centroided(msidata) = $centroids + #else + msidata <- readImzML('infile') + centroided(msidata) = $centroids + #end if + #elif $infile.ext == 'analyze75' + msidata = readAnalyze('infile') + centroided(msidata) = $centroids + #else + msidata = loadRData('infile.RData') + #end if + + ]]></token> + + <token name="@DATA_PROPERTIES_INRAM@"><![CDATA[ +########################### QC numbers ######################## +## including intensity calculations which need data in RAM + ## Number of features (mz) + maxfeatures = length(features(msidata)) + ## Range mz + minmz = round(min(mz(msidata)), digits=2) + maxmz = round(max(mz(msidata)), digits=2) + ## Number of spectra (pixels) + pixelcount = length(pixels(msidata)) + ## Range x coordinates + minimumx = min(coord(msidata)[,1]) + maximumx = max(coord(msidata)[,1]) + ## Range y coordinates + minimumy = min(coord(msidata)[,2]) + maximumy = max(coord(msidata)[,2]) ## Range of intensities minint = round(min(spectra(msidata)[], na.rm=TRUE), digits=2) maxint = round(max(spectra(msidata)[], na.rm=TRUE), digits=2) ## Number of intensities > 0, for if conditions npeaks= sum(spectra(msidata)[]>0, na.rm=TRUE) + ## Number of NA in spectra matrix + NAcount = sum(is.na(spectra(msidata)[])) + ## Number of NA in spectra matrix + infcount = sum(is.infinite(spectra(msidata)[])) properties = c("Number of m/z features", "Range of m/z values", "Number of pixels", "Range of x coordinates", "Range of y coordinates", - "Range of intensities") + "Range of intensities", + "Number of NA intensities", + "Number of Inf intensities") values = c(paste0(maxfeatures), paste0(minmz, " - ", maxmz), paste0(pixelcount), paste0(minimumx, " - ", maximumx), paste0(minimumy, " - ", maximumy), - paste0(minint, " - ", maxint)) + paste0(minint, " - ", maxint), + paste0(NAcount), + paste0(infcount)) property_df = data.frame(properties, values) ]]></token> @@ -144,9 +211,9 @@ <token name="@SPECTRA_TABULAR_INPUT_DESCRIPTION@"><![CDATA[ - Optional file with pixel coordinates and annotation: - - Tabular file: One column with x values, one column wiht y values and one column with annotations + - Tabular file: One column with x values, one column with y values and one column with annotations - The file is allowed to have any column names as header (in this case set "Tabular file contains a header line" to yes) - - Pixel with coordinates outside the coordinates of the input file are ignored + - Pixel with coordinates outside the coordinates of the input file are ignored :: @@ -161,9 +228,9 @@ <xml name="reading_msidata"> <param name="infile" type="data" format="imzml,rdata,analyze75" - label="Input file as imzML, Analyze7.5 or Cardinal MSImageSet saved as RData" - help="Upload composite datatype imzML (ibd+imzML) or analyze75 (hdr+img+t2m) or regular upload .RData (Cardinal MSImageSet)"/> - <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"/> + label="MSI data" + help="Input file as imzML (composite upload), or Cardinal MSImageSet saved as RData (regular upload)"/> + <param name="centroids" type="boolean" label="Centroided input" help="Choose Yes if peak detection has already been done." truevalue="TRUE" falsevalue="FALSE"/> <conditional name="processed_cond"> <param name="processed_file" type="select" label="Processed imzML file" help="Choose no if your input is an Analyze7.5 or continuous imzML file"> <option value="no_processed" selected="True">no</option>