Re-enabling indels for the Genomic Annotator as per Steve's patch. Steve assures me that he will test this out really well.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4139 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
ebanks 2010-08-27 15:01:25 +00:00
parent 6f4af47aac
commit dda84a0e54
2 changed files with 41 additions and 43 deletions

View File

@ -122,11 +122,9 @@ public class GenomicAnnotation implements InfoFieldAnnotation {
//The HAPLOTYPE_REFERENCE_COLUMN matches the variant's reference allele based on a case-insensitive string comparison. //The HAPLOTYPE_REFERENCE_COLUMN matches the variant's reference allele based on a case-insensitive string comparison.
//The HAPLOTYPE_ALTERNATE_COLUMN can optionally list more than allele separated by one of these chars: ,\/:| //The HAPLOTYPE_ALTERNATE_COLUMN can optionally list more than allele separated by one of these chars: ,\/:|
String hapAltValue = annotationsForRecord.get( generateInfoFieldKey(name, HAPLOTYPE_ALTERNATE_COLUMN) ); // only check this value for SNPs
if(hapAltValue != null) String hapAltValue = vc.isSNP() ? annotationsForRecord.get( generateInfoFieldKey(name, HAPLOTYPE_ALTERNATE_COLUMN) ) : null;
{ if ( hapAltValue != null && !hapAltValue.equals("*") ) {
if(!hapAltValue.equals("*"))
{
Set<Allele> alternateAlleles = vc.getAlternateAlleles(); Set<Allele> alternateAlleles = vc.getAlternateAlleles();
//if(alternateAlleles.isEmpty()) { //if(alternateAlleles.isEmpty()) {
//handle a site that has been called monomorphic reference //handle a site that has been called monomorphic reference
@ -171,9 +169,9 @@ public class GenomicAnnotation implements InfoFieldAnnotation {
continue; //skip record - none of its alternate alleles match the variant's alternate allele continue; //skip record - none of its alternate alleles match the variant's alternate allele
} }
} }
}
String hapRefValue = annotationsForRecord.get( generateInfoFieldKey(name, HAPLOTYPE_REFERENCE_COLUMN) ); // only check this value for SNPs
String hapRefValue = vc.isSNP() ? annotationsForRecord.get( generateInfoFieldKey(name, HAPLOTYPE_REFERENCE_COLUMN) ) : null;
if(hapRefValue != null) if(hapRefValue != null)
{ {
hapRefValue = hapRefValue.trim(); hapRefValue = hapRefValue.trim();

View File

@ -241,7 +241,7 @@ public class GenomicAnnotator extends RodWalker<Integer, Integer> implements Tre
Set<VariantContext> results = new LinkedHashSet<VariantContext>(); Set<VariantContext> results = new LinkedHashSet<VariantContext>();
for (VariantContext vc : tracker.getVariantContexts(ref, "variant", null, context.getLocation(), true, false)) { for (VariantContext vc : tracker.getVariantContexts(ref, "variant", null, context.getLocation(), true, false)) {
if ( vc.isFiltered() || if ( vc.isFiltered() ||
(vc.isVariant() && (!vc.isSNP() || !vc.isBiallelic())) ) { (vc.isVariant() && !vc.isBiallelic()) ) {
results.add(vc); results.add(vc);
} else { } else {
Map<String, StratifiedAlignmentContext> stratifiedContexts = StratifiedAlignmentContext.splitContextBySample(context.getBasePileup()); Map<String, StratifiedAlignmentContext> stratifiedContexts = StratifiedAlignmentContext.splitContextBySample(context.getBasePileup());