get_likelihood_vcf: Function to get Likelihoods for all possible genotypes given...

Description Usage Arguments Value

Description

This function fetches the genotype likelihoods from the VCF file (wo header) for the analysis. The first step is to read the vcf file as a matrix and outputs an R object with 6 lists including 5 vectors and 1 list including 3 matrix: 5 vectors: chr (1st column of VCF file), position (2nd column of VCF file, POS),ref allele (4th column, REF), alt allele (5th column, ALT), filter indicator (7th column, FILT) 1 list: likelihood of L(00|ref,alt), L(01|ref,alt), L(11|ref,alt), which are three matrix with row for sample and col for variants. They are calculated by get_lsingle_vcf from the PL part of the 10th column and onwards of VCF in format of GT:AD:DP:GQ:PL, example: 0/0:2,0:4:6:0,6,42 GL = genotype likelihoods for all possible genotypes given the set of alleles defined in the REF and ALT fields in the form of log10-scale, also called as Phred-scaled likelihoods: -log10(L(00|ref,alt)), -log10(L(01|ref,alt)), -log10(L(11|ref,alt)). PL : the phred-scaled genotype likelihoods rounded to the closest integer (and otherwise defined precisely as the GL field) (Integers)

Usage

1
get_likelihood_vcf(M, ncol_ID)

Arguments

M

The vcf file without the headers in a matrix, each row stands for a variant with number of columns = ncol_ID + number of sampls.

ncol_ID

the number of columns before the data for each individual

Value

Outputs an R object with 1. vector for chromosome of variants 2. vector for the position of variant location 3. vector for the reference allele 4. ALT allele (vector)
5. FILTER indicator for 'PASS' (vector)
6. likelihoods: L(D|0), L(D|1), L(D|2). List of 3 matrix: L0 - matrix of P(D|0), rows are individuals and columns are SNPS
L1 - matrix of P(D|1), rows are individuals and columns are SNPS
L2 - matrix of P(D|2), rows are individuals and columns are SNPS


Struglab/RVS documentation built on May 9, 2019, 3:11 p.m.