From 4ca1ab81edc3d9704baa934f5a56b209b053c361 Mon Sep 17 00:00:00 2001 From: Petr Danecek Date: Wed, 5 Nov 2014 13:51:59 +0000 Subject: [PATCH] call: -A must not include records discarded by -v with -m --- mcall.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/mcall.c b/mcall.c index f99fc8c3d..359b8be68 100644 --- a/mcall.c +++ b/mcall.c @@ -1390,7 +1390,15 @@ int mcall(call_t *call, bcf1_t *rec) #endif // Find the best combination of alleles - int out_als, nout = mcall_find_best_alleles(call, nals, &out_als); + int out_als, nout = mcall_find_best_alleles(call, nals, &out_als); + + // Make sure the REF allele is always present + if ( !(out_als&1) ) + { + out_als |= 1; + nout++; + } + if ( call->flag & CALL_VARONLY && nout==1 ) return 0; // With -A, keep all ALTs except X if ( call->flag & CALL_KEEPALT ) @@ -1404,14 +1412,7 @@ int mcall(call_t *call, bcf1_t *rec) nout++; } } - // Make sure the REF allele is always present - else if ( !(out_als&1) ) - { - out_als |= 1; - nout++; - } - if ( call->flag & CALL_VARONLY && out_als==1 ) return 0; int nAC = 0; if ( out_als==1 ) {