Hideous, horrible, hairy mutant bug: when we annotate ID field in indels, we were looking for SNP records matching the position, instead of indel records.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5509 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
delangel 2011-03-25 12:04:08 +00:00
parent 3e3ff4a9e7
commit 8701dfe8d3
2 changed files with 35 additions and 1 deletions

View File

@ -56,6 +56,28 @@ public class DbSNPHelper {
return rsID;
}
public static String rsIDOfFirstRealIndel(List<Object> featureList) {
if (featureList == null)
return null;
String rsID = null;
for ( Object d : featureList ) {
if ( d instanceof DbSNPFeature ) {
if ( DbSNPHelper.isIndel((DbSNPFeature)d) ) {
rsID = ((DbSNPFeature)d).getRsID();
break;
}
} else if ( d instanceof VariantContext) {
if ( ((VariantContext)d).isIndel() ) {
rsID = ((VariantContext)d).getID();
break;
}
}
}
return rsID;
}
/**
* get the -1 * (log 10 of the error value)
*

View File

@ -160,6 +160,12 @@ public class UnifiedGenotyperEngine {
if ( UAC.COVERAGE_AT_WHICH_TO_ABORT > 0 && rawContext.size() > UAC.COVERAGE_AT_WHICH_TO_ABORT )
return null;
// special case handling - avoid extended event pileups when calling indels if we're genotyping given alleles
// TODO - is this the right solution? otherwise we trigger twice and we get duplicate entries
/* if ( UAC.GLmodel == GenotypeLikelihoodsCalculationModel.Model.DINDEL && rawContext.hasExtendedEventPileup()
&& UAC.GenotypingMode == GenotypeLikelihoodsCalculationModel.GENOTYPING_MODE.GENOTYPE_GIVEN_ALLELES)
return null;
*/
Map<String, StratifiedAlignmentContext> stratifiedContexts = getFilteredAndStratifiedContexts(UAC, refContext, rawContext);
if ( stratifiedContexts == null )
return (UAC.OutputMode != OUTPUT_MODE.EMIT_ALL_SITES ? null : new VariantCallContext(generateEmptyContext(tracker, refContext, stratifiedContexts, rawContext), refContext.getBase(), false));
@ -349,7 +355,13 @@ public class UnifiedGenotyperEngine {
// *** note that calculating strand bias involves overwriting data structures, so we do that last
HashMap<String, Object> attributes = new HashMap<String, Object>();
String rsID = DbSNPHelper.rsIDOfFirstRealSNP(tracker.getReferenceMetaData(DbSNPHelper.STANDARD_DBSNP_TRACK_NAME));
String rsID = null;
if (vc.isSNP())
rsID = DbSNPHelper.rsIDOfFirstRealSNP(tracker.getReferenceMetaData(DbSNPHelper.STANDARD_DBSNP_TRACK_NAME));
else if (vc.isIndel())
rsID = DbSNPHelper.rsIDOfFirstRealIndel(tracker.getReferenceMetaData(DbSNPHelper.STANDARD_DBSNP_TRACK_NAME));
if ( rsID != null )
attributes.put(VariantContext.ID_KEY, rsID);