Mercurial > repos > lecorguille > xcms_plot_chromatogram
changeset 11:37d31fd64eb4 draft
"planemo upload for repository https://github.com/workflow4metabolomics/xcms commit 0dcc8bcb1e645574c7f81ec1a43f86be38acd065"
author | workflow4metabolomics |
---|---|
date | Tue, 21 Jul 2020 09:17:54 -0400 |
parents | dbd877060ac3 |
children | 0cab69429e1e |
files | lib.r macros_xcms.xml xcms_plot_chromatogram.xml |
diffstat | 3 files changed, 21 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/lib.r Wed Feb 12 08:30:06 2020 -0500 +++ b/lib.r Tue Jul 21 09:17:54 2020 -0400 @@ -149,14 +149,20 @@ par(mfrow = c(3, 1), mar = c(4, 4, 1, 0.5)) - group_colors <- brewer.pal(length(unique(xdata$sample_group)), "Set1") + if(length(unique(xdata$sample_group))<10){ + group_colors <- brewer.pal(length(unique(xdata$sample_group)), "Set1") + }else{ + group_colors <- hcl.colors(length(unique(xdata$sample_group)), palette="Dark 3") + } names(group_colors) <- unique(xdata$sample_group) + col_per_samp <- as.character(xdata$sample_group) + for(i in 1:length(group_colors)){col_per_samp[col_per_samp==(names(group_colors)[i])]<-group_colors[i]} xlim <- c(min(featureDefinitions(xdata)$rtmin), max(featureDefinitions(xdata)$rtmax)) for (i in 1:nrow(featureDefinitions(xdata))) { mzmin = featureDefinitions(xdata)[i,]$mzmin mzmax = featureDefinitions(xdata)[i,]$mzmax - plotChromPeakDensity(xdata, param = param, 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=col_per_samp, 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) } @@ -170,7 +176,11 @@ pdf(file="raw_vs_adjusted_rt.pdf", width=16, height=12) # Color by group - group_colors <- brewer.pal(length(unique(xdata$sample_group)), "Set1") + if(length(unique(xdata$sample_group))<10){ + group_colors <- brewer.pal(length(unique(xdata$sample_group)), "Set1") + }else{ + group_colors <- hcl.colors(length(unique(xdata$sample_group)), palette="Dark 3") + } if (length(group_colors) > 1) { names(group_colors) <- unique(xdata$sample_group) plotAdjustedRtime(xdata, col = group_colors[xdata$sample_group]) @@ -239,7 +249,11 @@ pdf(pdfname, width=16, height=10) # Color by group - group_colors <- brewer.pal(length(unique(xdata$sample_group)), "Set1") + if(length(unique(xdata$sample_group))<10){ + group_colors <- brewer.pal(length(unique(xdata$sample_group)), "Set1") + }else{ + group_colors <- hcl.colors(length(unique(xdata$sample_group)), palette="Dark 3") + } if (length(group_colors) > 1) { names(group_colors) <- unique(xdata$sample_group) plot(chrom, col = group_colors[as.factor(chrom$sample_group)], main=main, peakType = "none")
--- a/macros_xcms.xml Wed Feb 12 08:30:06 2020 -0500 +++ b/macros_xcms.xml Tue Jul 21 09:17:54 2020 -0400 @@ -98,7 +98,7 @@ <option value="maxo">maxo</option> <option value="intb">intb</option> </param> - <param name="naTOzero" type="boolean" checked="true" truevalue="TRUE" falsevalue="FALSE" label="Replace the remain NA by 0 in the dataMatrix" help="Rather mandatory for some downstream statistical steps"/> + <param name="naTOzero" type="boolean" checked="true" truevalue="TRUE" falsevalue="FALSE" label="If NA values remain, replace them by 0 in the dataMatrix" help="Mandatory for some of the downstream tools (data processing, statistics) that do not accept NA values"/> </xml> <xml name="input_peaklist_section"> @@ -193,7 +193,7 @@ <option value="wMean">intensity weighted mean of the peak's m/z values</option> <option value="mean">mean of the peak's m/z values</option> <option value="apex">use the m/z value at the peak apex</option> - <option value="wMeanApex3">ntensity weighted mean of the m/z value at the peak apex and the m/z values left and right of it</option> + <option value="wMeanApex3">intensity weighted mean of the m/z value at the peak apex and the m/z values left and right of it</option> <option value="meanApex3">mean of the m/z value of the peak apex and the m/z values left and right of it</option> </param> <param argument="integrate" type="select" label="Integration method" >
--- a/xcms_plot_chromatogram.xml Wed Feb 12 08:30:06 2020 -0500 +++ b/xcms_plot_chromatogram.xml Tue Jul 21 09:17:54 2020 -0400 @@ -1,4 +1,4 @@ -<tool id="xcms_plot_chromatogram" name="xcms plot chromatogram" version="@TOOL_VERSION@.0"> +<tool id="xcms_plot_chromatogram" name="xcms plot chromatogram" version="@TOOL_VERSION@+galaxy1"> <description>Plots base peak intensity chromatogram (BPI) and total ion current chromatogram (TIC) from MSnbase or xcms experiment(s)</description> <macros>