plotInfo-methods | R Documentation |
Plot, on a genomic axis, a metric calculated in levels of a given phenotype,
and stored in columns of the info
slot of a VCF
object.
## S4 method for signature 'VCF'
plotInfo(
vcf, metric, range, annotation, phenotype, type = c("p", "heatmap"),
zero.rm = FALSE)
vcf |
|
metric |
Metric to plot on the Y axis.
All columns in the |
range |
A |
annotation |
An |
phenotype |
Column in the |
type |
Plotting type(s), as listed in |
zero.rm |
If |
list
returned by the plotTracks
method.
Kevin Rue-Albrecht
plotTracks
,
addPhenoLevelFrequencies,ExpandedVCF-method
,
and VCF
.
# Example data ----
# VCF file
vcfFile <- system.file("extdata", "moderate.vcf", package = "TVTB")
# Phenotype file
phenoFile <- system.file("extdata", "moderate_pheno.txt", package = "TVTB")
phenotypes <- S4Vectors::DataFrame(read.table(phenoFile, TRUE, row.names = 1))
# TVTB parameters
tparam <- TVTBparam(Genotypes("0|0", c("0|1", "1|0"), "1|1"))
# Pre-process variants
vcf <- VariantAnnotation::readVcf(
vcfFile, param = tparam, colData = phenotypes)
vcf <- VariantAnnotation::expand(vcf, row.names = TRUE)
vcf <- addFrequencies(vcf, "super_pop")
# Example usage ----
if (requireNamespace("EnsDb.Hsapiens.v75")){
plotInfo(
vcf, "MAF",
range(GenomicRanges::granges(vcf)),
EnsDb.Hsapiens.v75::EnsDb.Hsapiens.v75,
"super_pop"
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.