pairsInfo-methods: Plot an INFO metric on a genomic axis.

Description Usage Arguments Value Author(s) See Also Examples

Description

Make a matrix of plots that display a metric calculated in levels of a given phenotype, and stored in columns of the info slot of a VCF object.

Usage

1
2
## S4 method for signature 'VCF'
pairsInfo(vcf, metric, phenotype, ..., title = metric)

Arguments

vcf

VCF object.

metric

Metric to plot on the Y axis. All columns in the info slot of hte vcf object that match the pattern "phenotype_(.*)_metric" are plotted in the DataTrack. An error is thrown if no such column is found.

phenotype

Column in the phenoData slot of the vcf object. Levels of this phenotype are plotted and contrasted in the DataTrack. See argument metric for details.

...

Additional arguments, passed to the ggpairs method.

title

Title for the graph, passed to the ggpairs method.

Value

gg object returned by the ggpairs method.

Author(s)

Kevin Rue-Albrecht

See Also

ggpairs, addPhenoLevelFrequencies,ExpandedVCF-method, and VCF.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# 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 ----

pairsInfo(vcf, "MAF", "super_pop")

kevinrue/TVTB documentation built on Sept. 6, 2021, 10:52 p.m.