plot.PCRplate.Rd 2.2 KB
Newer Older
1 2 3 4 5 6
% 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{
7 8
\method{plot}{PCRplate}(x, samples = NULL, col = "cyan2",
  different = T, ...)
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
}
\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}