avoid an out of memory error by no putting more than 5000 reads in the cache. on pilot1 at least those are crazy loci anyway.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1802 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
jmaguire 2009-10-09 14:56:55 +00:00
parent f4b6afb42c
commit d9f5a314ac
1 changed files with 14 additions and 3 deletions

View File

@ -242,7 +242,7 @@ public class MultiSampleCaller2 extends LocusWalker<MultiSampleCaller2.MultiSamp
if (SAMPLE_NAME_REGEX != null) { sample_name = sample_name.replaceAll(SAMPLE_NAME_REGEX, "$1"); }
System.out.printf("SAMPLE: %s %s\n", sample_name, platform);
//System.out.printf("SAMPLE: %s %s\n", sample_name, platform);
if (unique_sample_names.contains(sample_name)) { continue; }
unique_sample_names.add(sample_name);
@ -362,6 +362,7 @@ public class MultiSampleCaller2 extends LocusWalker<MultiSampleCaller2.MultiSamp
}
HashMap<AlignmentContext, ClassicGenotypeLikelihoods> glCache = new HashMap<AlignmentContext, ClassicGenotypeLikelihoods>();
int cache_size = 0;
ClassicGenotypeLikelihoods GenotypeOld(AlignmentContext context, double[] allele_likelihoods, double indel_alt_freq) {
//ReadBackedPileup pileup = new ReadBackedPileup(ref, context);
@ -441,7 +442,16 @@ public class MultiSampleCaller2 extends LocusWalker<MultiSampleCaller2.MultiSamp
G = (ClassicGenotypeLikelihoods)cached.clone();
} else {
G = reallyMakeGenotypeLikelihood(context);
glCache.put(context, G.clone());
if (cache_size < 5000)
{
//System.out.printf("cache add (%d)\n", cache_size);
glCache.put(context, G.clone());
cache_size += context.getReads().size();
}
else
{
//System.out.printf("cache skip (%d)\n", cache_size);
}
}
G.ApplyPrior(ref, allele_likelihoods);
}
@ -827,7 +837,8 @@ public class MultiSampleCaller2 extends LocusWalker<MultiSampleCaller2.MultiSamp
if (tracker.lookup("DBSNP", null) != null) { in_dbsnp = "known"; } else { in_dbsnp = "novel"; }
AlignmentContext[] contexts = filterAlignmentContext(context, sample_names, 0);
glCache.clear(); // reset the contexts
glCache.clear(); // reset the cache
cache_size = 0;
double lod = LOD(contexts);