R/plotLadderVariation.R

Defines functions .plotLadderVariation plotLadderVariation

.plotLadderVariation <- function(copy, pos, mean, sd, xl, yl, title)
{
    data <- data.table(Copy=copy, Position=pos, Mean=mean, SD=sd)
    p <- ggplot(data, aes(Position, Mean, colour=factor(Copy))) +
                scale_colour_manual(values=c("1"="#DF3416", "2"="#FFCF22", "4"="#009239", "8"="#6F9CD0")) +
                geom_errorbar(width=.1, aes(ymin=Mean-SD, ymax=Mean+SD), color="gray") +
                geom_line() + theme_bw() + theme(legend.position="none") + labs(x=xl, y=xl)
    print(p <- .transformPlot(p))
    p
}

plotLadderVariation <- function(copy, pos, mean, sd, xl="Cn Position (nt)", yl="Mean K-mer Count", title="Ladder variation")
{
    tryCatch({ .plotLadderVariation(copy, pos, mean, sd, xl, yl, title) }, error=function(x) { print(x); emptyPlot(xl, yl, title) })
}
sequinstandards/RAnaquin documentation built on Aug. 9, 2019, 2:46 p.m.