callGtFromAd: call genotype from Allele depth by Frequency

View source: R/callGtFromAd.R

callGtFromAdR Documentation

call genotype from Allele depth by Frequency

Description

call genotype from Allele depth by Frequency

Usage

callGtFromAd(x, min.depth = 10, max.depth = 200, low = 0.2, high = 0.8)

Arguments

x

a binmapr object

min.depth

minimum depth to infer the genotype, if depth lower than it, it will be conside as NA

max.depth

maximum depth to infer the genotype, if depth larger than it, it will be conside as NA

low

threshold to infer one parent, encoded as 0

high

threshold to infer another parent, encoded as 2

Details

The original GT in VCF may be wrong, if the variant is sequencing error. To avoid this kind of error, we used the ALT/(REF + ALT) to infer the genotype. If the ratio <= 0.2, it will be encoded as 0. If the ratio >= 0.8, it will be encoded as 2. Otherwise, it will be encoded as 1.

Value

binmapr object, containing genotype slot

Author(s)

Zhougeng Xu

Examples

AD <- matrix(data = c("30,1","1,30","0,0","15,15"), nrow = 2)
row.names(AD) <- c("chr1_1","chr1_100")
colnames(AD) <- c("A","B")
geno <- callGtFromAd(AD)


xuzhougeng/binmapr documentation built on Aug. 25, 2023, 6:44 a.m.