comparison lib.r @ 31:eb15a3841da4 draft

"planemo upload for repository https://github.com/workflow4metabolomics/xcms commit 42a0bcde81726702194f1b4ecd741d0545648d40"
author workflow4metabolomics
date Tue, 28 Apr 2020 09:35:10 -0400
parents 14b1c52fae62
children b02d1992a43a
comparison
equal deleted inserted replaced
30:14b1c52fae62 31:eb15a3841da4
149 149
150 par(mfrow = c(3, 1), mar = c(4, 4, 1, 0.5)) 150 par(mfrow = c(3, 1), mar = c(4, 4, 1, 0.5))
151 151
152 group_colors <- brewer.pal(length(unique(xdata$sample_group)), "Set1") 152 group_colors <- brewer.pal(length(unique(xdata$sample_group)), "Set1")
153 names(group_colors) <- unique(xdata$sample_group) 153 names(group_colors) <- unique(xdata$sample_group)
154 col_per_samp <- as.character(xdata$sample_group)
155 for(i in 1:length(group_colors)){col_per_samp[col_per_samp==(names(group_colors)[i])]<-group_colors[i]}
154 156
155 xlim <- c(min(featureDefinitions(xdata)$rtmin), max(featureDefinitions(xdata)$rtmax)) 157 xlim <- c(min(featureDefinitions(xdata)$rtmin), max(featureDefinitions(xdata)$rtmax))
156 for (i in 1:nrow(featureDefinitions(xdata))) { 158 for (i in 1:nrow(featureDefinitions(xdata))) {
157 mzmin = featureDefinitions(xdata)[i,]$mzmin 159 mzmin = featureDefinitions(xdata)[i,]$mzmin
158 mzmax = featureDefinitions(xdata)[i,]$mzmax 160 mzmax = featureDefinitions(xdata)[i,]$mzmax
159 plotChromPeakDensity(xdata, param = param, mz=c(mzmin,mzmax), col=group_colors, pch=16, xlim=xlim, main=paste(round(mzmin,mzdigit),round(mzmax,mzdigit))) 161 plotChromPeakDensity(xdata, param = param, mz=c(mzmin,mzmax), col=col_per_samp, pch=16, xlim=xlim, main=paste(round(mzmin,mzdigit),round(mzmax,mzdigit)))
160 legend("topright", legend=names(group_colors), col=group_colors, cex=0.8, lty=1) 162 legend("topright", legend=names(group_colors), col=group_colors, cex=0.8, lty=1)
161 } 163 }
162 164
163 dev.off() 165 dev.off()
164 } 166 }