dropInfo-methods: Remove INFO keys from VCF objects

dropInfo-methodsR Documentation

Remove INFO keys from VCF objects

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

## 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

# 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")

kevinrue/TVTB documentation built on July 9, 2024, 11:42 p.m.