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: ...@@ -23,4 +23,5 @@ Imports:
RMassBank, RMassBank,
parallel, parallel,
yaml, 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 ...@@ -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 ##' @title Plot the Output of Prescreen
##' @param wd Sequence of data dirs containing the prescreen subdir. ##' @param wd Sequence of data dirs containing the prescreen subdir.
##' @param out The name of the output file. ##' @param out The name of the output file.
##' @param pal ColorBrewer palette name.
##' @return Nothing useful. ##' @return Nothing useful.
##' @author Todor Kondić ##' @author Todor Kondić
##' @export ##' @export
presc.plot <- function(wd,out="prescreen.pdf") { presc.plot <- function(wd,out="prescreen.pdf",pal="Accent") {
dfdir <- file.path(wd,"prescreen") dfdir <- file.path(wd,"prescreen")
pdf(out) pdf(out)
## Get the basenames of eic files. ## Get the basenames of eic files.
...@@ -569,10 +570,12 @@ presc.plot <- function(wd,out="prescreen.pdf") { ...@@ -569,10 +570,12 @@ presc.plot <- function(wd,out="prescreen.pdf") {
int_rng <- range(sapply(dfs,function(x) x$intensity)) int_rng <- range(sapply(dfs,function(x) x$intensity))
plot.window(rt_rng,int_rng) plot.window(rt_rng,int_rng)
box() box()
cols <- RColorBrewer::brewer.pal(n=length(dfs),name=pal)
## Plot eic across the directory set. ## Plot eic across the directory set.
for (df in dfs) { for (n in seq(length(dfs))) {
lines(df$intensity ~ df$rt) df <- dfs[[n]]
col <- cols[[n]]
lines(df$intensity ~ df$rt,col=col)
} }
## Find existing children and plot them across the directory ## Find existing children and plot them across the directory
......
...@@ -4,12 +4,14 @@ ...@@ -4,12 +4,14 @@
\alias{presc.plot} \alias{presc.plot}
\title{Plot the Output of Prescreen} \title{Plot the Output of Prescreen}
\usage{ \usage{
presc.plot(wd, out = "prescreen.pdf") presc.plot(wd, out = "prescreen.pdf", pal = "Accent")
} }
\arguments{ \arguments{
\item{wd}{Sequence of data dirs containing the prescreen subdir.} \item{wd}{Sequence of data dirs containing the prescreen subdir.}
\item{out}{The name of the output file.} \item{out}{The name of the output file.}
\item{pal}{ColorBrewer palette name.}
} }
\value{ \value{
Nothing useful. 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