Files
ROBITools/man/plot.PCRplate.Rd

66 lines
2.2 KiB
R

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot.PCRplate.R
\name{plot.PCRplate}
\alias{plot.PCRplate}
\title{Plot PCR plates}
\usage{
\method{plot}{PCRplate}(x, samples = NULL, col = "cyan2", different = T,
...)
}
\arguments{
\item{x}{a \code{\link{metabarcoding.data}} object}
\item{samples}{a character vector containing names of problematic samples. Default is \code{NULL}}
\item{different}{a boolean indicating whether different tags where used in forward and reverse to identify samples. Default is \code{TRUE}}
\item{...}{arguments ot be passed to methods, such as graphical parameters}
}
\value{
\code{\link{plot.PCRplate}} returns a plot displaying no more than 4 PCR plates, with problematic sample localization
}
\description{
Plots samples localization in PCR plates, and points out problematic samples if provided.
}
\examples{
\dontshow{# switch the working directory to the data package directory}
\dontshow{setwd(system.file("extdata", package="ROBITools"))}
data(termes)
# reading the termes_ngsfilt.txt file
termes.ngs=import.ngsfilter.data('termes_ngsfilt.txt', platewell="position")
# including ngsfilter data into termes data
attr(termes, "samples") = termes.ngs[rownames(termes),]
#plot PCR plate plan
col = rep("green", nrow(termes))
col[grep("r", rownames(termes))] = "red"
plot.PCRplate(termes, col=col)
#highlighting location of samples with low identification score
#low quality taxonomic assignements identification
library(plotrix)
weighted.hist(termes$motus$best_identity, colSums(termes$reads), breaks = 20, ylab = "Nb reads", xlab = "Ecotag scores", xaxis=F)
axis(1, labels = T)
lowqual.seq = rownames(termes$motus)[termes$motus$best_identity < 0.7]
#identification and localization (in PCR plate) of samples with high proportions of low quality taxonomic assignements
termes.freq= normalize(termes, MARGIN=1)$reads
hist(log10(rowSums(termes.freq[,lowqual.seq]) + 1e-05), breaks = 20, xlab = "Prop low quality reads")
lowqual.sample = rownames(termes)[log10(rowSums(termes.freq[, lowqual.seq]) + 1e-05) > -0.5]
plot.PCRplate(termes, lowqual.sample, col=col)
}
\seealso{
\code{\link{import.metabarcoding.data}}
}
\author{
Lucie Zinger
}
\keyword{DNA}
\keyword{metabarcoding}