dropInfo-methods: Remove INFO keys from VCF objects

Description Usage Arguments Value Note Author(s) See Also Examples

Description

Given a character vector of INFO keys, removes either the associated header, data, or both from a VCF object. If no INFO key is given (the default), all INFO keys are checked and removed from the given slot if they do not have a matching entry in the other slot.

Usage

1
2
3
## S4 method for signature 'VCF'
dropInfo(
    vcf, key = NULL, slot = "both")

Arguments

vcf

VCF object.

key

character vector of INFO keys to remove.

If NULL (the default), all keys are checked, and removed from the given slot if they do not have a matching entry in the other slot.

slot

Should the INFO keys be removed from the "header", the "data", or "both" (the default)?

Value

An integer vector representing the aggregated count of the given genotypes in each row.

Note

In the future, x should also support genotype quality (GQ) to consider only genotypes above a given quality cut-off.

Author(s)

Kevin Rue-Albrecht

See Also

VCF

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# Example data ----

# VCF file
vcfFile <- system.file("extdata", "moderate.vcf", package = "TVTB")

# TVTB parameters
tparam <- TVTBparam(Genotypes("0|0", c("0|1", "1|0"), "1|1"))

# Pre-process variants
vcf <- VariantAnnotation::readVcf(
    vcfFile, param = tparam)
vcf <- VariantAnnotation::expand(vcf, row.names = TRUE)


# Example usage ----

dropInfo(vcf)
dropInfo(vcf, "CSQ")

TVTB documentation built on Nov. 8, 2020, 6:09 p.m.