Minor reformating for pooled calling

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2063 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
depristo 2009-11-17 22:06:11 +00:00
parent ec1a870905
commit 42a0bbaf46
4 changed files with 15 additions and 7 deletions

View File

@ -18,6 +18,10 @@ public class DiploidGenotypeCalculationModel extends JointEstimateGenotypeCalcul
return splitContextBySample(context); return splitContextBySample(context);
} }
protected int getNSamples(HashMap<String, AlignmentContextBySample> contexts) {
return contexts.size();
}
protected void initializeLikelihoods(char ref, HashMap<String, AlignmentContextBySample> contexts, StratifiedContext contextType) { protected void initializeLikelihoods(char ref, HashMap<String, AlignmentContextBySample> contexts, StratifiedContext contextType) {
GLs.clear(); GLs.clear();

View File

@ -36,7 +36,7 @@ public abstract class JointEstimateGenotypeCalculationModel extends GenotypeCalc
protected abstract void initializeLikelihoods(char ref, HashMap<String, AlignmentContextBySample> contexts, StratifiedContext contextType); protected abstract void initializeLikelihoods(char ref, HashMap<String, AlignmentContextBySample> contexts, StratifiedContext contextType);
protected abstract double computeLog10PofDgivenAFi(DiploidGenotype refGenotype, DiploidGenotype hetGenotype, DiploidGenotype homGenotype, double f); protected abstract double computeLog10PofDgivenAFi(DiploidGenotype refGenotype, DiploidGenotype hetGenotype, DiploidGenotype homGenotype, double f);
protected abstract List<Genotype> makeGenotypeCalls(char ref, HashMap<String, AlignmentContextBySample> contexts, GenomeLoc loc); protected abstract List<Genotype> makeGenotypeCalls(char ref, HashMap<String, AlignmentContextBySample> contexts, GenomeLoc loc);
protected abstract int getNSamples(HashMap<String, AlignmentContextBySample> contexts);
public Pair<List<Genotype>, GenotypeLocusData> calculateGenotype(RefMetaDataTracker tracker, char ref, AlignmentContext context, DiploidGenotypePriors priors) { public Pair<List<Genotype>, GenotypeLocusData> calculateGenotype(RefMetaDataTracker tracker, char ref, AlignmentContext context, DiploidGenotypePriors priors) {
@ -45,7 +45,7 @@ public abstract class JointEstimateGenotypeCalculationModel extends GenotypeCalc
if ( contexts == null ) if ( contexts == null )
return null; return null;
int numSamples = contexts.size(); int numSamples = getNSamples(contexts);
int frequencyEstimationPoints = (2 * numSamples) + 1; // (add 1 for allele frequency of zero) int frequencyEstimationPoints = (2 * numSamples) + 1; // (add 1 for allele frequency of zero)
initializeAlleleFrequencies(frequencyEstimationPoints); initializeAlleleFrequencies(frequencyEstimationPoints);

View File

@ -10,9 +10,13 @@ import net.sf.samtools.SAMRecord;
public class PooledCalculationModel extends JointEstimateGenotypeCalculationModel { public class PooledCalculationModel extends JointEstimateGenotypeCalculationModel {
protected PooledCalculationModel() {} protected PooledCalculationModel() {
}
protected int getNSamples(HashMap<String, AlignmentContextBySample> contexts) {
return POOL_SIZE;
}
protected HashMap<String, AlignmentContextBySample> createContexts(AlignmentContext context) { protected HashMap<String, AlignmentContextBySample> createContexts(AlignmentContext context) {
// for testing purposes, we may want to throw multi-samples at pooled mode, // for testing purposes, we may want to throw multi-samples at pooled mode,
// so we can't use the standard splitContextBySample() method here // so we can't use the standard splitContextBySample() method here
@ -48,10 +52,10 @@ public class PooledCalculationModel extends JointEstimateGenotypeCalculationMode
} }
protected double computeLog10PofDgivenAFi(DiploidGenotype refGenotype, DiploidGenotype hetGenotype, DiploidGenotype homGenotype, double f) { protected double computeLog10PofDgivenAFi(DiploidGenotype refGenotype, DiploidGenotype hetGenotype, DiploidGenotype homGenotype, double f) {
System.out.printf("%s %.2f%n", hetGenotype, f);
// TODO -- IMPLEMENT ME // TODO -- IMPLEMENT ME
return 0.0; return -100.0;
} }
protected List<Genotype> makeGenotypeCalls(char ref, HashMap<String, AlignmentContextBySample> contexts, GenomeLoc loc) { protected List<Genotype> makeGenotypeCalls(char ref, HashMap<String, AlignmentContextBySample> contexts, GenomeLoc loc) {

View File

@ -77,7 +77,7 @@ public class UnifiedArgumentCollection {
@Argument(fullName = "max_deletions", shortName = "deletions", doc = "Maximum reads with deletions spanning this locus for it to be callable [to disable, set to < 0; default:1]", required = false) @Argument(fullName = "max_deletions", shortName = "deletions", doc = "Maximum reads with deletions spanning this locus for it to be callable [to disable, set to < 0; default:1]", required = false)
public Integer MAX_DELETIONS = 1; public Integer MAX_DELETIONS = 1;
@Argument(fullName = "max_coverage", shortName = "coverage", doc = "Maximum reads at this locus for it to be callable; to disable, provide value < 1 [default:10,000]", required = false) @Argument(fullName = "max_coverage", shortName = "mc", doc = "Maximum reads at this locus for it to be callable; to disable, provide value < 1 [default:10,000]", required = false)
public Integer MAX_READS_IN_PILEUP = 10000; public Integer MAX_READS_IN_PILEUP = 10000;
@Argument(fullName = "min_allele_frequency", shortName = "min_freq", doc = "The minimum possible allele frequency in a population (advanced)", required = false) @Argument(fullName = "min_allele_frequency", shortName = "min_freq", doc = "The minimum possible allele frequency in a population (advanced)", required = false)