zhanxw / rvtests

Rare variant test software for next generation sequencing data
129 stars 41 forks source link

Fix issue #92. #93

Closed the-x-at closed 4 years ago

the-x-at commented 4 years ago

Fixes a kinship calculation issue with VCF files containing missing data for individuals (#92). Now calling vcf2kinship with the input file as mentioned in #92 returns expected results:

./rvtests/executable/vcf2kinship --inVcf rvtest-oneline.vcf --ibs --maxMiss 0.5 --out rvtest-online

File rvtest-online.kinship contains

FID     IID     X       Y       Z
X       X       0       0       0
Y       Y       0       2       1
Z       Z       0       1       2

Running the same command for the Balding-Nicols method (replacing --ibs by --bn in the command above) gives the following output:

FID     IID     X       Y       Z
X       X       0       0       0
Y       Y       0       0.666667        -0.666667
Z       Z       0       -0.666667       0.666667

which has zeroes for those pairs that involve the individual with the missing variant, X, in line with the output of the fixed IBS method. From looking at the source code, neither class BaldingNicolsKinship nor currently unused class IBSKinshipImpute appear to have the issue encountered in class IBSKinship, so the fix should be complete and consistent.

the-x-at commented 4 years ago

Travis CI fails because file rvtests/vcfUtils/Makefile has a non-existing target createBCF2Index, which was added in commit 007841885. I am testing the fix with this line commented out. However, I did not want to check it in, as the main author's intentions for including this target are not clear to me.