hapLrt - zeeev/vcflib GitHub Wiki

HapLRT is a likelihood ratio test that models the haplotype length distributions of the target and background populations. For variant site hapLRT measures the number of SNPs required to ablate haplotype sharing in each population (target and background). This distributions of haplotypes lengths are modeled by the exponential distribution (wiki link). A p-value is calculated using a likelihood ratio test, which is chi-Squared distributed with one degree of freedom.

Usage statement for hapLrt:

 INFO: help
INFO: description:
     HapLRT is a likelihood ratio test for haplotype lengths.  The lengths are modeled with an exponential distribtuion.
     The sign denotes if the target has longer haplotypes (1) or the background (-1).

Output : 4 columns :
     1. seqid
     2. position
     3. mean target haplotype length
     4. mean background haplotype length
     5. p-value from LRT
     6. sign

INFO: hapLRT  --target 0,1,2,3,4,5,6,7 --background 11,12,13,16,17,19,22 --type GP --file my.vcf

INFO: required: t,target     -- argument: a zero base comma seperated list of target individuals corrisponding to VCF columns
INFO: required: b,background -- argument: a zero base comma seperated list of background individuals corrisponding to VCF columns
INFO: required: f,file       -- argument: a properly formatted phased VCF file
INFO: required: y,type       -- argument: type of genotype likelihood: PL, GL or GP
INFO: optional: r,region     -- argument: a genomice range to calculate hapLrt on in the format : "seqid:start-end" or "seqid"

Running the provided example:

bin/hapLrt --target  1,20,25,29,30,38,43,46  --background 2,3,4,5,6,7,21,22,22,23,24,26,26,28,31,32,33,34,35,36,37,39,40,41,42,44,45 --file samples/scaffold612.phased.vcf.gz --type GP > t.hapLRT.txt
R --vanilla < bin/plotHapLrt.R --args ~/gpat/t.hapLRT.txt

The resulting plot: hapLRT

Negative values are SNPs where the background haplotypes are longer than the target haplotypes. For comparison XP-EHH is plotted below. The signal to noise ratio is much higher in hapLrt when compared to XP-EHH.

xpehh