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
This commit is contained in:
parent
e21376219d
commit
b0b37c3476
|
|
@ -206,8 +206,6 @@ public static VariantContext simpleMerge(Collection<VariantContext> unsortedVCs,
|
||||||
if ( genotypeMergeOptions == GenotypeMergeType.REQUIRE_UNIQUE )
|
if ( genotypeMergeOptions == GenotypeMergeType.REQUIRE_UNIQUE )
|
||||||
verifyUniqueSampleNames(unsortedVCs);
|
verifyUniqueSampleNames(unsortedVCs);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
List<VariantContext> prepaddedVCs = sortVariantContextsByPriority(unsortedVCs, priorityListOfVCs, genotypeMergeOptions);
|
List<VariantContext> prepaddedVCs = sortVariantContextsByPriority(unsortedVCs, priorityListOfVCs, genotypeMergeOptions);
|
||||||
// Make sure all variant contexts are padded with reference base in case of indels if necessary
|
// Make sure all variant contexts are padded with reference base in case of indels if necessary
|
||||||
List<VariantContext> VCs = new ArrayList<VariantContext>();
|
List<VariantContext> VCs = new ArrayList<VariantContext>();
|
||||||
|
|
@ -231,8 +229,8 @@ public static VariantContext simpleMerge(Collection<VariantContext> unsortedVCs,
|
||||||
String rsID = null;
|
String rsID = null;
|
||||||
int depth = 0;
|
int depth = 0;
|
||||||
|
|
||||||
// filtering values
|
// counting the number of filtered and varint VCs
|
||||||
int nFiltered = 0;
|
int nFiltered = 0, nVariant = 0;
|
||||||
|
|
||||||
Allele refAllele = determineReferenceAllele(VCs);
|
Allele refAllele = determineReferenceAllele(VCs);
|
||||||
boolean remapped = false;
|
boolean remapped = false;
|
||||||
|
|
@ -247,6 +245,7 @@ public static VariantContext simpleMerge(Collection<VariantContext> unsortedVCs,
|
||||||
loc = vc.getLocation(); // get the longest location
|
loc = vc.getLocation(); // get the longest location
|
||||||
|
|
||||||
nFiltered += vc.isFiltered() ? 1 : 0;
|
nFiltered += vc.isFiltered() ? 1 : 0;
|
||||||
|
nVariant += vc.isVariant() ? 1 : 0;
|
||||||
|
|
||||||
AlleleMapper alleleMapping = resolveIncompatibleAlleles(refAllele, vc, alleles);
|
AlleleMapper alleleMapping = resolveIncompatibleAlleles(refAllele, vc, alleles);
|
||||||
remapped = remapped || alleleMapping.needsRemapping();
|
remapped = remapped || alleleMapping.needsRemapping();
|
||||||
|
|
@ -259,7 +258,6 @@ public static VariantContext simpleMerge(Collection<VariantContext> unsortedVCs,
|
||||||
|
|
||||||
filters.addAll(vc.getFilters());
|
filters.addAll(vc.getFilters());
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// add attributes
|
// add attributes
|
||||||
//
|
//
|
||||||
|
|
@ -299,14 +297,15 @@ public static VariantContext simpleMerge(Collection<VariantContext> unsortedVCs,
|
||||||
// we care about where the call came from
|
// we care about where the call came from
|
||||||
if ( annotateOrigin ) {
|
if ( annotateOrigin ) {
|
||||||
String setValue;
|
String setValue;
|
||||||
if ( nFiltered == 0 && VCs.size() == priorityListOfVCs.size() ) // nothing was unfiltered
|
if ( nFiltered == 0 && nVariant == priorityListOfVCs.size() ) // nothing was unfiltered
|
||||||
setValue = "Intersection";
|
setValue = "Intersection";
|
||||||
else if ( nFiltered == VCs.size() ) // everything was filtered out
|
else if ( nFiltered == VCs.size() ) // everything was filtered out
|
||||||
setValue = "FilteredInAll";
|
setValue = "FilteredInAll";
|
||||||
else { // we are filtered in some subset
|
else { // we are filtered in some subset
|
||||||
List<String> s = new ArrayList<String>();
|
List<String> s = new ArrayList<String>();
|
||||||
for ( VariantContext vc : VCs )
|
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);
|
setValue = Utils.join("-", s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue