comments for eric
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2035 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
234bb71747
commit
cff31f2d06
|
|
@ -45,6 +45,18 @@ public class JointEstimateGenotypeCalculationModel extends GenotypeCalculationMo
|
||||||
if ( contexts == null )
|
if ( contexts == null )
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
// todo -- eric, can you refactor this into a superclass the manages the i over 2n calculation?
|
||||||
|
//
|
||||||
|
// The only thing that's different from pools and msg should be the calls to
|
||||||
|
// initializeGenotypeLikelihoods and calculateAlleleFrequencyPosteriors
|
||||||
|
// There's a lot of functionality here that can be separated into a superclass that requires
|
||||||
|
// a few methods be overridden and it'll magically work for all data types, etc.
|
||||||
|
//
|
||||||
|
// Here are some examples:
|
||||||
|
// getNumberSamples() ->
|
||||||
|
// likelihoodsOfDGivenF() -> for MSG, pools, etc -- see below
|
||||||
|
//
|
||||||
|
|
||||||
initializeAlleleFrequencies(contexts.size());
|
initializeAlleleFrequencies(contexts.size());
|
||||||
|
|
||||||
// run joint estimation for the full GL contexts
|
// run joint estimation for the full GL contexts
|
||||||
|
|
@ -124,6 +136,13 @@ public class JointEstimateGenotypeCalculationModel extends GenotypeCalculationMo
|
||||||
}
|
}
|
||||||
DiploidGenotype refGenotype = DiploidGenotype.createHomGenotype(ref);
|
DiploidGenotype refGenotype = DiploidGenotype.createHomGenotype(ref);
|
||||||
|
|
||||||
|
//
|
||||||
|
// todo -- if you invert this loop
|
||||||
|
// foreach frequnecy
|
||||||
|
// foreach altAllele
|
||||||
|
//
|
||||||
|
// then the pooled vs. msg calculation is just a function call difference
|
||||||
|
|
||||||
// for each minor allele frequency
|
// for each minor allele frequency
|
||||||
for (int i = 0; i < frequencyEstimationPoints; i++) {
|
for (int i = 0; i < frequencyEstimationPoints; i++) {
|
||||||
double f = (double)i / (double)(frequencyEstimationPoints-1);
|
double f = (double)i / (double)(frequencyEstimationPoints-1);
|
||||||
|
|
@ -162,6 +181,7 @@ public class JointEstimateGenotypeCalculationModel extends GenotypeCalculationMo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// todo -- shouldn't this be in a function for clarity?
|
||||||
// for each alternate allele
|
// for each alternate allele
|
||||||
for ( char altAllele : BaseUtils.BASES ) {
|
for ( char altAllele : BaseUtils.BASES ) {
|
||||||
if ( altAllele == ref )
|
if ( altAllele == ref )
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package org.broadinstitute.sting.utils;
|
||||||
import org.broadinstitute.sting.gatk.CommandLineGATK;
|
import org.broadinstitute.sting.gatk.CommandLineGATK;
|
||||||
import org.broadinstitute.sting.gatk.GATKArgumentCollection;
|
import org.broadinstitute.sting.gatk.GATKArgumentCollection;
|
||||||
import org.simpleframework.xml.Element;
|
import org.simpleframework.xml.Element;
|
||||||
import org.simpleframework.xml.ElementList;
|
import org.simpleframework. xml.ElementList;
|
||||||
import org.simpleframework.xml.Serializer;
|
import org.simpleframework.xml.Serializer;
|
||||||
import org.simpleframework.xml.core.Persister;
|
import org.simpleframework.xml.core.Persister;
|
||||||
import org.simpleframework.xml.stream.Format;
|
import org.simpleframework.xml.stream.Format;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue