the "-genotype" option now acts correctly as a discovery mode caller in SSG

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1359 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
aaron 2009-07-31 18:31:45 +00:00
parent c2c80dd946
commit 9dfee7a75c
4 changed files with 22 additions and 10 deletions

View File

@ -135,11 +135,9 @@ public class SingleSampleGenotyper extends LocusWalker<SSGGenotypeCall, Genotype
*/
public SSGGenotypeCall map(RefMetaDataTracker tracker, char ref, LocusContext context) {
rationalizeSampleName(context.getReads().get(0));
if (context.getLocation().getStart() == 73) {
int stop = 1;
}
ReadBackedPileup pileup = new ReadBackedPileup(ref, context);
GenotypeLikelihoods G = callGenotype(tracker);
G.setDiscovery(GENOTYPE); // set it to discovery mode or variant detection mode
SSGGenotypeCall geno = (SSGGenotypeCall)G.callGenotypes(tracker, ref, pileup);
if (geno != null) {
metricsOut.nextPosition(geno, tracker);
@ -238,8 +236,8 @@ public class SingleSampleGenotyper extends LocusWalker<SSGGenotypeCall, Genotype
*
* @return an empty string
*/
public GenotypeWriter reduce(org.broadinstitute.sting.utils.genotype.calls.SSGGenotypeCall call, GenotypeWriter sum) {
if (call != null && call.isVariation()) {
public GenotypeWriter reduce(SSGGenotypeCall call, GenotypeWriter sum) {
if (call != null && (GENOTYPE || call.isVariation())) {
if (call.getConfidenceScore().getScore() > LOD_THRESHOLD)
sum.addGenotypeCall(call);
}

View File

@ -88,7 +88,7 @@ public class SSGGenotypeCall implements GenotypeCall, GenotypeOutput {
// reset the confidence based on either the discovery mode or the genotype mode
for (Genotype g : genotypes) {
double val = (discoveryMode) ? Math.abs(likelihoods[index] - best) : Math.abs(likelihoods[index] - ref);
double val = (discoveryMode) ? Math.abs(likelihoods[index] - next) : Math.abs(likelihoods[index] - ref);
((BasicGenotype) g).setConfidenceScore(new BayesianConfidenceScore(val));
mGenotypes.put(likelihoods[index], g);
index++;

View File

@ -12,8 +12,11 @@ public abstract class ConfidenceScore implements Comparable<ConfidenceScore> {
// the general error of a floating point value
private static final Double EPSILON = 1.0e-15;
/**
* the method we use to generate this confidence
*/
public enum SCORE_METHOD {
LOD_SCORE, UNKNOWN;
LOD_SCORE, CHIP, UNKNOWN;
}
private Double mScore;

View File

@ -1,6 +1,7 @@
package org.broadinstitute.sting.utils.genotype.variant;
import org.broadinstitute.sting.utils.GenomeLoc;
import org.broadinstitute.sting.utils.genotype.confidence.ConfidenceScore;
/**
* @author aaron
@ -12,7 +13,7 @@ import org.broadinstitute.sting.utils.GenomeLoc;
public interface Variant {
// the types of variants we currently allow
public enum VARIANT_TYPE {
SNP, INDEL, DELETION, REFERENCE
SNP, INDEL, DELETION, REFERENCE // though reference is not really a variant
}
/**
@ -22,6 +23,13 @@ public interface Variant {
*/
public VariantFrequency getFrequency();
/**
* get the confidence score for this variance
*
* @return the confidence score
*/
public ConfidenceScore getConfidenceScore();
/** @return the VARIANT_TYPE of the current variant */
public VARIANT_TYPE getType();
@ -57,7 +65,10 @@ public interface Variant {
* @return a GenomeLoc
*/
public GenomeLoc getLocation();
/**
* get the reference base(s) at this position
* @return the reference base or bases, as a string
*/
public String getReference();
}