From b0b37c34768742b817b8706c733d5fb2526af223 Mon Sep 17 00:00:00 2001 From: depristo Date: Fri, 23 Jul 2010 23:09:23 +0000 Subject: [PATCH] No handles (I believe) reference only VCs correctly git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3871 348d0f76-0448-11de-a6fe-93d51630548a --- .../variantcontext/VariantContextUtils.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/java/src/org/broadinstitute/sting/gatk/contexts/variantcontext/VariantContextUtils.java b/java/src/org/broadinstitute/sting/gatk/contexts/variantcontext/VariantContextUtils.java index 303a975cc..547d4d344 100755 --- a/java/src/org/broadinstitute/sting/gatk/contexts/variantcontext/VariantContextUtils.java +++ b/java/src/org/broadinstitute/sting/gatk/contexts/variantcontext/VariantContextUtils.java @@ -206,8 +206,6 @@ public static VariantContext simpleMerge(Collection unsortedVCs, if ( genotypeMergeOptions == GenotypeMergeType.REQUIRE_UNIQUE ) verifyUniqueSampleNames(unsortedVCs); - - List prepaddedVCs = sortVariantContextsByPriority(unsortedVCs, priorityListOfVCs, genotypeMergeOptions); // Make sure all variant contexts are padded with reference base in case of indels if necessary List VCs = new ArrayList(); @@ -231,8 +229,8 @@ public static VariantContext simpleMerge(Collection unsortedVCs, String rsID = null; int depth = 0; - // filtering values - int nFiltered = 0; + // counting the number of filtered and varint VCs + int nFiltered = 0, nVariant = 0; Allele refAllele = determineReferenceAllele(VCs); boolean remapped = false; @@ -247,6 +245,7 @@ public static VariantContext simpleMerge(Collection unsortedVCs, loc = vc.getLocation(); // get the longest location nFiltered += vc.isFiltered() ? 1 : 0; + nVariant += vc.isVariant() ? 1 : 0; AlleleMapper alleleMapping = resolveIncompatibleAlleles(refAllele, vc, alleles); remapped = remapped || alleleMapping.needsRemapping(); @@ -259,7 +258,6 @@ public static VariantContext simpleMerge(Collection unsortedVCs, filters.addAll(vc.getFilters()); - // // add attributes // @@ -299,14 +297,15 @@ public static VariantContext simpleMerge(Collection unsortedVCs, // we care about where the call came from if ( annotateOrigin ) { String setValue; - if ( nFiltered == 0 && VCs.size() == priorityListOfVCs.size() ) // nothing was unfiltered + if ( nFiltered == 0 && nVariant == priorityListOfVCs.size() ) // nothing was unfiltered setValue = "Intersection"; else if ( nFiltered == VCs.size() ) // everything was filtered out setValue = "FilteredInAll"; else { // we are filtered in some subset List s = new ArrayList(); for ( VariantContext vc : VCs ) - s.add( vc.isFiltered() ? "filterIn" + vc.getName() : vc.getName() ); + if ( vc.isVariant() ) + s.add( vc.isFiltered() ? "filterIn" + vc.getName() : vc.getName() ); setValue = Utils.join("-", s); }