View source: R/standardization.R
get_baf | R Documentation |
This function calculates the B-allele frequency (BAF) from normalized theta values, using cluster centers that represent genotype classes. BAF is computed by linearly interpolating the theta values between adjacent genotype cluster centroids.
get_baf(theta_subject, centers_theta, ploidy)
theta_subject |
A numeric vector of theta values to be standardized. These typically represent allelic ratios or normalized intensity values for a set of samples. |
centers_theta |
A numeric vector of length 'ploidy + 1', representing the estimated cluster centers (centroids) for each genotype class. These values should be sorted in increasing order from homozygous reference to homozygous alternative. |
ploidy |
An integer indicating the ploidy level of the organism (e.g., '2' for diploid). |
The approach is based on the methodology described by Wang et al. (2007), and is commonly used in SNP genotyping to infer allele-specific signal intensities.
A numeric vector of BAF values ranging from 0 to 1
The 'centers_theta' vector must contain exactly 'ploidy + 1' values, and must be sorted in ascending order. If 'theta_subject' values fall outside the range, BAFs are capped at 0 or 1 accordingly.
Wang, K., Li, M., Hadley, D., Liu, R., Glessner, J., Grant, S. F. A., Hakonarson, H., & Bucan, M. (2007). PennCNV: An integrated hidden Markov model designed for high-resolution copy number variation detection in whole-genome SNP genotyping data. Genome Research, 17(11), 1665–1674. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1101/gr.6861907")}
theta <- c(0.1, 0.35, 0.6, 0.95)
centers <- c(0.1, 0.5, 0.9)
get_baf(theta, centers, ploidy = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.