Skip to content

Commit

Permalink
fix the bug for matching donor VCF to cell VCF
Browse files Browse the repository at this point in the history
  • Loading branch information
huangyh09 committed Oct 29, 2019
1 parent 1342b7f commit f859090
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions doc/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
History
=======

Release v0.1.8 (29/10/2019)
===========================
* Further fix the bug when variants in donor genotype are not in cell vcf file

Release v0.1.7 (05/10/2019)
===========================
* Support donor genotype vcf file with different FORMAT for different variants
Expand Down
2 changes: 1 addition & 1 deletion vireoSNP/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1.7"
__version__ = "0.1.8"
8 changes: 8 additions & 0 deletions vireoSNP/vireo.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,15 @@ def main():
options.geno_tag)

mm_idx = match(cell_vcf['variants'], donor_vcf['variants'])
mm_idx = mm_idx.astype(float)
idx1 = np.where(mm_idx == mm_idx)[0] #remove None
# TODO: check when chr is not compatible! given warning.
if len(idx1) == 0:
print("[vireo] warning: no variants matched to donor VCF, " +
"please check chr format!")
else:
print("[vireo] %d out %d variants matched to donor VCF"
%(len(idx1), len(cell_vcf['variants'])))
idx2 = mm_idx[idx1].astype(int)

donor_GPb = donor_GPb[idx2, :, :]
Expand Down

0 comments on commit f859090

Please sign in to comment.