1. Don't print out values in filter field of the VCF.
2. Fix ratio printouts (for params file) 3. Rename ratio filter's get counts method to avoid confusion; more changes on the way this week. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1616 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
436f543b3b
commit
01e7b39c8d
|
|
@ -37,7 +37,7 @@ public abstract class RatioFilter implements VariantExclusionCriterion {
|
||||||
highThreshold = threshold;
|
highThreshold = threshold;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract Pair<Integer, Integer> scoreVariant(char ref, ReadBackedPileup pileup, RodGeliText variant);
|
protected abstract Pair<Integer, Integer> getRatioCounts(char ref, ReadBackedPileup pileup, RodGeliText variant);
|
||||||
protected abstract boolean excludeHetsOnly();
|
protected abstract boolean excludeHetsOnly();
|
||||||
|
|
||||||
public boolean useZeroQualityReads() { return false; }
|
public boolean useZeroQualityReads() { return false; }
|
||||||
|
|
@ -48,7 +48,7 @@ public abstract class RatioFilter implements VariantExclusionCriterion {
|
||||||
char ref = context.getReferenceContext().getBase();
|
char ref = context.getReferenceContext().getBase();
|
||||||
|
|
||||||
ReadBackedPileup pileup = new ReadBackedPileup(ref, context.getAlignmentContext(useZeroQualityReads()));
|
ReadBackedPileup pileup = new ReadBackedPileup(ref, context.getAlignmentContext(useZeroQualityReads()));
|
||||||
Pair<Integer, Integer> counts = scoreVariant(ref, pileup, variant);
|
Pair<Integer, Integer> counts = getRatioCounts(ref, pileup, variant);
|
||||||
|
|
||||||
boolean highGenotypeConfidence = variant.getConsensusConfidence() > minGenotypeConfidenceToTest;
|
boolean highGenotypeConfidence = variant.getConsensusConfidence() > minGenotypeConfidenceToTest;
|
||||||
boolean excludable = !excludeHetsOnly() || GenotypeUtils.isHet((AllelicVariant)variant);
|
boolean excludable = !excludeHetsOnly() || GenotypeUtils.isHet((AllelicVariant)variant);
|
||||||
|
|
@ -68,10 +68,10 @@ public abstract class RatioFilter implements VariantExclusionCriterion {
|
||||||
|
|
||||||
// TODO - this whole calculation needs to be redone correctly
|
// TODO - this whole calculation needs to be redone correctly
|
||||||
private boolean pointEstimateExclude(Pair<Integer, Integer> counts) {
|
private boolean pointEstimateExclude(Pair<Integer, Integer> counts) {
|
||||||
if ( counts.first + counts.second < minDepthOfCoverage )
|
int n = counts.first + counts.second;
|
||||||
|
if ( n < minDepthOfCoverage )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
int n = counts.first + counts.second;
|
|
||||||
double ratio = counts.first.doubleValue() / (double)n;
|
double ratio = counts.first.doubleValue() / (double)n;
|
||||||
return !passesThreshold(ratio);
|
return !passesThreshold(ratio);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ public class VECAlleleBalance extends RatioFilter {
|
||||||
* Return the count of bases matching the major (first) and minor (second) alleles as a pair.
|
* Return the count of bases matching the major (first) and minor (second) alleles as a pair.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
protected Pair<Integer, Integer> scoreVariant(char ref, ReadBackedPileup pileup, RodGeliText variant) {
|
protected Pair<Integer, Integer> getRatioCounts(char ref, ReadBackedPileup pileup, RodGeliText variant) {
|
||||||
final String genotype = variant.getBestGenotype();
|
final String genotype = variant.getBestGenotype();
|
||||||
final String bases = pileup.getBases();
|
final String bases = pileup.getBases();
|
||||||
|
|
||||||
|
|
@ -47,7 +47,7 @@ public class VECAlleleBalance extends RatioFilter {
|
||||||
int refCount = a == ref ? aCount : bCount;
|
int refCount = a == ref ? aCount : bCount;
|
||||||
int altCount = a == ref ? bCount : aCount;
|
int altCount = a == ref ? bCount : aCount;
|
||||||
|
|
||||||
ratio = (double)refCount / (double)altCount;
|
ratio = (double)refCount / (double)(refCount + altCount);
|
||||||
return new Pair<Integer, Integer>(refCount, altCount);
|
return new Pair<Integer, Integer>(refCount, altCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -69,7 +69,7 @@ public class VECAlleleBalance extends RatioFilter {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getVCFFilterString() {
|
public String getVCFFilterString() {
|
||||||
return "AlleleBalance" + ratio;
|
return "AlleleBalance";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ public class VECDepthOfCoverage implements VariantExclusionCriterion {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getVCFFilterString() {
|
public String getVCFFilterString() {
|
||||||
return "DoC" + depth;
|
return "DoC";
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean useZeroQualityReads() { return false; }
|
public boolean useZeroQualityReads() { return false; }
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ public class VECFisherStrand implements VariantExclusionCriterion {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getVCFFilterString() {
|
public String getVCFFilterString() {
|
||||||
return "strand" + pValue;
|
return "strand";
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean useZeroQualityReads() { return false; }
|
public boolean useZeroQualityReads() { return false; }
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,6 @@ public class VECLodThreshold implements VariantExclusionCriterion {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getVCFFilterString() {
|
public String getVCFFilterString() {
|
||||||
return "LOD" + lod;
|
return "LOD";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ public class VECMappingQuality implements VariantExclusionCriterion {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getVCFFilterString() {
|
public String getVCFFilterString() {
|
||||||
return "MQ" + rms;
|
return "MQ";
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean useZeroQualityReads() { return true; }
|
public boolean useZeroQualityReads() { return true; }
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ public class VECMappingQualityZero implements VariantExclusionCriterion {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getVCFFilterString() {
|
public String getVCFFilterString() {
|
||||||
return "MQzero" + mq0Count;
|
return "MQzero";
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean useZeroQualityReads() { return true; }
|
public boolean useZeroQualityReads() { return true; }
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ public class VECOnOffGenotypeRatio extends RatioFilter {
|
||||||
* best genotype). On are in the first field, off in the second.
|
* best genotype). On are in the first field, off in the second.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
protected Pair<Integer, Integer> scoreVariant(char ref, ReadBackedPileup pileup, RodGeliText variant) {
|
protected Pair<Integer, Integer> getRatioCounts(char ref, ReadBackedPileup pileup, RodGeliText variant) {
|
||||||
final String genotype = variant.getBestGenotype().toUpperCase();
|
final String genotype = variant.getBestGenotype().toUpperCase();
|
||||||
final String bases = pileup.getBases();
|
final String bases = pileup.getBases();
|
||||||
|
|
||||||
|
|
@ -44,7 +44,7 @@ public class VECOnOffGenotypeRatio extends RatioFilter {
|
||||||
//System.out.printf("count = %d, on=%d, off=%d for %c in %s%n", count, on, off, base, genotype);
|
//System.out.printf("count = %d, on=%d, off=%d for %c in %s%n", count, on, off, base, genotype);
|
||||||
}
|
}
|
||||||
|
|
||||||
ratio = (double)on / (double)off;
|
ratio = (double)on / (double)(on + off);
|
||||||
return new Pair<Integer, Integer>(on, off);
|
return new Pair<Integer, Integer>(on, off);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -65,6 +65,6 @@ public class VECOnOffGenotypeRatio extends RatioFilter {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getVCFFilterString() {
|
public String getVCFFilterString() {
|
||||||
return "onOffGenotype" + ratio;
|
return "onOffGenotype";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue