View source: R/PlotFunctions.R
plotGBSR | R Documentation |
Draw line plots of specified statistics
plotGBSR(
x,
stats = c("dp", "missing", "het"),
coord = NULL,
lwd = 0.5,
binwidth = NULL,
color = c(Marker = "darkblue", Ref = "darkgreen", Het = "magenta", Alt = "blue")
)
x |
A GbsrGenotypeData object. |
stats |
A string to specify statistics to be drawn. |
coord |
A vector with two integer specifying the number of rows and columns to draw faceted line plots for chromosomes. |
lwd |
A numeric value to specify the line width in plots. |
binwidth |
An integer to specify bin width of the histogram.
This argument only work with |
color |
A strings vector named "Marker", "Ref", "Het", "Alt"
to specify line colors. |
You can draw line plots of several summary statistics of genotype counts and read counts per sample and per marker. The "stats" argument can take the following values:
Marker density.
Proportion of missing genotype calls.
Proportion of missing genotype calls.
Proportion of heterozygote calls.
Reference allele frequency.
Total read counts.
Reference allele read counts.
Alternative allele read counts.
Reference allele read frequency.
Mean of reference allele read counts.
Standard deviation of reference allele read counts.
Quantile of reference allele read counts.
Mean of alternative allele read counts.
Standard deviation of alternative allele read counts.
Quantile of alternative allele read counts.
Mapping quality.
Phred-scaled p-value (strand bias)
Variant Quality by Depth
Symmetric Odds Ratio (strand bias)
Alt vs. Ref read mapping qualities
Alt vs. Ref read position bias
Alt Vs. Ref base qualities
To draw line plots for "missing", "het", "raf", you need to run
countGenotype()
first to obtain statistics. Similary, "dp",
"ad_ref", "ad_alt", "rrf" requires values obtained via countRead()
.
"mq", "fs", "qd", "sor", "mqranksum", "readposranksum",
#' and "baseqranksum" only work with target = "marker"
, if your data
contains those values supplied via SNP calling tools like
GATK.
A ggplot object.
# Load data in the GDS file and instantiate a [GbsrGenotypeData] object.
gds_fn <- system.file("extdata", "sample.gds", package = "GBScleanR")
gds <- loadGDS(gds_fn)
# Summarize genotype count information to be used in `plotGBSR()`
gds <- countGenotype(gds)
# Draw line plots of missing rate, heterozygosity, proportion of genotype
# calls per SNP.
plotGBSR(gds, stats = "missing")
# Close the connection to the GDS file
closeGDS(gds)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.