diff lib.r @ 19:c8f8d598f562 draft

planemo upload for repository https://github.com/workflow4metabolomics/xcms commit f0d42bca2f34c58c04b55e5990058d479c0ae639
author lecorguille
date Mon, 11 Feb 2019 06:02:39 -0500
parents 7a19925478e8
children 2d94a873d649
line wrap: on
line diff
--- a/lib.r	Fri Nov 09 15:14:35 2018 -0500
+++ b/lib.r	Mon Feb 11 06:02:39 2019 -0500
@@ -144,7 +144,7 @@
 
 #@author G. Le Corguille
 # Draw the plotChromPeakDensity 3 per page in a pdf file
-getPlotChromPeakDensity <- function(xdata, mzdigit=4) {
+getPlotChromPeakDensity <- function(xdata, param = NULL, mzdigit=4) {
     pdf(file="plotChromPeakDensity.pdf", width=16, height=12)
 
     par(mfrow = c(3, 1), mar = c(4, 4, 1, 0.5))
@@ -156,7 +156,7 @@
     for (i in 1:nrow(featureDefinitions(xdata))) {
         mzmin = featureDefinitions(xdata)[i,]$mzmin
         mzmax = featureDefinitions(xdata)[i,]$mzmax
-        plotChromPeakDensity(xdata, mz=c(mzmin,mzmax), col=group_colors, pch=16, xlim=xlim, main=paste(round(mzmin,mzdigit),round(mzmax,mzdigit)))
+        plotChromPeakDensity(xdata, param = param, mz=c(mzmin,mzmax), col=group_colors, pch=16, xlim=xlim, main=paste(round(mzmin,mzdigit),round(mzmax,mzdigit)))
         legend("topright", legend=names(group_colors), col=group_colors, cex=0.8, lty=1)
     }
 
@@ -189,10 +189,10 @@
 getPeaklistW4M <- function(xdata, intval="into", convertRTMinute=F, numDigitsMZ=4, numDigitsRT=0, naTOzero=T, variableMetadataOutput, dataMatrixOutput, sampleNamesList) {
     dataMatrix <- featureValues(xdata, method="medret", value=intval)
     colnames(dataMatrix) <- make.names(tools::file_path_sans_ext(colnames(dataMatrix)))
-    dataMatrix = cbind(name=groupnamesW4M(xdata), dataMatrix)
+    dataMatrix = cbind(name=groupnames(xdata), dataMatrix)
     variableMetadata <- featureDefinitions(xdata)
     colnames(variableMetadata)[1] = "mz"; colnames(variableMetadata)[4] = "rt"
-    variableMetadata = data.frame(name=groupnamesW4M(xdata), variableMetadata)
+    variableMetadata = data.frame(name=groupnames(xdata), variableMetadata)
 
     variableMetadata <- RTSecondToMinute(variableMetadata, convertRTMinute)
     variableMetadata <- formatIonIdentifiers(variableMetadata, numDigitsRT=numDigitsRT, numDigitsMZ=numDigitsMZ)