From f859090a5d0705aa9572f70dd2dce78339a8cd93 Mon Sep 17 00:00:00 2001 From: huangyh09 Date: Tue, 29 Oct 2019 20:34:10 +0000 Subject: [PATCH] fix the bug for matching donor VCF to cell VCF --- doc/release.rst | 4 ++++ vireoSNP/version.py | 2 +- vireoSNP/vireo.py | 8 ++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/release.rst b/doc/release.rst index b7e3b04..91debb6 100644 --- a/doc/release.rst +++ b/doc/release.rst @@ -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 diff --git a/vireoSNP/version.py b/vireoSNP/version.py index 283b03a..a23ef3f 100644 --- a/vireoSNP/version.py +++ b/vireoSNP/version.py @@ -1 +1 @@ -__version__ = "0.1.7" \ No newline at end of file +__version__ = "0.1.8" \ No newline at end of file diff --git a/vireoSNP/vireo.py b/vireoSNP/vireo.py index d46bd59..e95e513 100644 --- a/vireoSNP/vireo.py +++ b/vireoSNP/vireo.py @@ -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, :, :]