autodetectGenotypes: Define genotypes in the TVTBparam metadata slot

autodetectGenotypes-methodsR Documentation

Define genotypes in the TVTBparam metadata slot

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

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

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

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