Skip to content
Snippets Groups Projects
Commit 33c79f2d authored by Todor Kondic's avatar Todor Kondic
Browse files

Update presc.plot

* R/mix.R(presc.plot): New argument.
  [pal] Colorbrewer palette.
parent 28121410
No related branches found
No related tags found
No related merge requests found
......@@ -23,4 +23,5 @@ Imports:
RMassBank,
parallel,
yaml,
mzR
mzR,
RColorBrewer
......@@ -542,10 +542,11 @@ presc.p<-function(fn_data,fn_cmpd_l,mode,cl=NULL,ppm_lim_fine=10,EIC_limit=0.001
##' @title Plot the Output of Prescreen
##' @param wd Sequence of data dirs containing the prescreen subdir.
##' @param out The name of the output file.
##' @param pal ColorBrewer palette name.
##' @return Nothing useful.
##' @author Todor Kondić
##' @export
presc.plot <- function(wd,out="prescreen.pdf") {
presc.plot <- function(wd,out="prescreen.pdf",pal="Accent") {
dfdir <- file.path(wd,"prescreen")
pdf(out)
## Get the basenames of eic files.
......@@ -569,10 +570,12 @@ presc.plot <- function(wd,out="prescreen.pdf") {
int_rng <- range(sapply(dfs,function(x) x$intensity))
plot.window(rt_rng,int_rng)
box()
cols <- RColorBrewer::brewer.pal(n=length(dfs),name=pal)
## Plot eic across the directory set.
for (df in dfs) {
lines(df$intensity ~ df$rt)
for (n in seq(length(dfs))) {
df <- dfs[[n]]
col <- cols[[n]]
lines(df$intensity ~ df$rt,col=col)
}
## Find existing children and plot them across the directory
......
......@@ -4,12 +4,14 @@
\alias{presc.plot}
\title{Plot the Output of Prescreen}
\usage{
presc.plot(wd, out = "prescreen.pdf")
presc.plot(wd, out = "prescreen.pdf", pal = "Accent")
}
\arguments{
\item{wd}{Sequence of data dirs containing the prescreen subdir.}
\item{out}{The name of the output file.}
\item{pal}{ColorBrewer palette name.}
}
\value{
Nothing useful.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment