Mercurial > repos > lecorguille > xcms_xcmsset
diff lib.r @ 21:87df3692c68d draft
planemo upload for repository https://github.com/workflow4metabolomics/xcms commit f0d42bca2f34c58c04b55e5990058d479c0ae639
author | lecorguille |
---|---|
date | Mon, 11 Feb 2019 05:51:25 -0500 |
parents | 41cf6f56d1b6 |
children | 5c62dfdb64f4 |
line wrap: on
line diff
--- a/lib.r Fri Nov 09 15:10:13 2018 -0500 +++ b/lib.r Mon Feb 11 05:51:25 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)