autodetectGenotypes: Define genotypes in the TVTBparam metadata slot

Description Usage Arguments Value Warning Author(s) Examples

Description

This method attempts to auto-detect genotypes (i.e. homozygote reference, heterozygote, and homozygote alternate) in a VCF object, and sets or creates a TVTBparam object accordingly, in the metadata slot.

Usage

1
2
## S4 method for signature 'VCF'
autodetectGenotypes(vcf)

Arguments

vcf

VCF object.

Value

VCF object including a new or updated TVTBparam object in metadata(vcf)[["TVTBparam"]] .

Warning

A warning message is issued if genotypes cannot be fully defined.

Author(s)

Kevin Rue-Albrecht

Examples

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

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

# TVTB parameters
tparam <- TVTBparam()

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


# Example usage ----

vcf <- autodetectGenotypes(vcf)

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