Bringing VQSR up to date with the 1000G v2b changes
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@6000 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
04ecbf10ab
commit
d7430c23f8
|
|
@ -47,10 +47,9 @@ public class FisherStrand implements InfoFieldAnnotation, StandardAnnotation {
|
||||||
private static final double MIN_PVALUE = 1E-320;
|
private static final double MIN_PVALUE = 1E-320;
|
||||||
|
|
||||||
public Map<String, Object> annotate(RefMetaDataTracker tracker, ReferenceContext ref, Map<String, AlignmentContext> stratifiedContexts, VariantContext vc) {
|
public Map<String, Object> annotate(RefMetaDataTracker tracker, ReferenceContext ref, Map<String, AlignmentContext> stratifiedContexts, VariantContext vc) {
|
||||||
if ( ! vc.isVariant() || vc.isFiltered() )
|
if ( ! vc.isVariant() || vc.isFiltered() )
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
|
||||||
int[][] table;
|
int[][] table;
|
||||||
|
|
||||||
if (vc.isBiallelic() && vc.isSNP())
|
if (vc.isBiallelic() && vc.isSNP())
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,6 @@ public class HaplotypeScore implements InfoFieldAnnotation, StandardAnnotation {
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -168,13 +167,13 @@ public class HaplotypeScore implements InfoFieldAnnotation, StandardAnnotation {
|
||||||
|
|
||||||
// Now retrieve the N most popular haplotypes
|
// Now retrieve the N most popular haplotypes
|
||||||
if (consensusHaplotypeQueue.size() > 0) {
|
if (consensusHaplotypeQueue.size() > 0) {
|
||||||
// Since the consensus haplotypes are in a quality-ordered priority queue, the two best haplotypes are just the first two in the queue
|
// The consensus haplotypes are in a quality-ordered priority queue, so the best haplotypes are just the ones at the front of the queue
|
||||||
final Haplotype haplotype1 = consensusHaplotypeQueue.poll();
|
final Haplotype haplotype1 = consensusHaplotypeQueue.poll();
|
||||||
|
|
||||||
List<Haplotype>hlist = new ArrayList<Haplotype>();
|
List<Haplotype>hlist = new ArrayList<Haplotype>();
|
||||||
hlist.add(new Haplotype(haplotype1.getBasesAsBytes(), 60));
|
hlist.add(new Haplotype(haplotype1.getBasesAsBytes(), 60));
|
||||||
|
|
||||||
for (int k=1;k < haplotypesToCompute; k++) {
|
for (int k=1; k < haplotypesToCompute; k++) {
|
||||||
Haplotype haplotype2 = consensusHaplotypeQueue.poll();
|
Haplotype haplotype2 = consensusHaplotypeQueue.poll();
|
||||||
if(haplotype2 == null ) { haplotype2 = haplotype1; } // Sometimes only the reference haplotype can be found
|
if(haplotype2 == null ) { haplotype2 = haplotype1; } // Sometimes only the reference haplotype can be found
|
||||||
hlist.add(new Haplotype(haplotype2.getBasesAsBytes(), 20));
|
hlist.add(new Haplotype(haplotype2.getBasesAsBytes(), 20));
|
||||||
|
|
|
||||||
|
|
@ -211,14 +211,17 @@ public class VariantDataManager {
|
||||||
try {
|
try {
|
||||||
if( annotationKey.equalsIgnoreCase("QUAL") ) {
|
if( annotationKey.equalsIgnoreCase("QUAL") ) {
|
||||||
value = vc.getPhredScaledQual();
|
value = vc.getPhredScaledQual();
|
||||||
|
} else if( annotationKey.equalsIgnoreCase("DP") ) {
|
||||||
|
value = Double.parseDouble( (String)vc.getAttribute( "DP" ) ) / Double.parseDouble( (String)vc.getAttribute( "AN" ) );
|
||||||
} else {
|
} else {
|
||||||
value = Double.parseDouble( (String)vc.getAttribute( annotationKey ) );
|
value = Double.parseDouble( (String)vc.getAttribute( annotationKey ) );
|
||||||
if( Double.isInfinite(value) ) { value = Double.NaN; }
|
if( Double.isInfinite(value) ) { value = Double.NaN; }
|
||||||
if( annotationKey.equalsIgnoreCase("InbreedingCoeff") && value > 0.01 ) { value = Double.NaN; }
|
if( annotationKey.equalsIgnoreCase("InbreedingCoeff") && value > 0.05 ) { value = Double.NaN; }
|
||||||
if( jitter && annotationKey.equalsIgnoreCase("HRUN") ) { // Integer valued annotations must be jittered a bit to work in this GMM
|
if( jitter && annotationKey.equalsIgnoreCase("HRUN") ) { // Integer valued annotations must be jittered a bit to work in this GMM
|
||||||
value += -0.25 + 0.5 * GenomeAnalysisEngine.getRandomGenerator().nextDouble();
|
value += -0.25 + 0.5 * GenomeAnalysisEngine.getRandomGenerator().nextDouble();
|
||||||
}
|
}
|
||||||
if( annotationKey.equalsIgnoreCase("HaplotypeScore") && MathUtils.compareDoubles(value, 0.0, 0.0001) == 0 ) { value = -0.2 + 0.4*GenomeAnalysisEngine.getRandomGenerator().nextDouble(); }
|
if( annotationKey.equalsIgnoreCase("HaplotypeScore") && MathUtils.compareDoubles(value, 0.0, 0.0001) == 0 ) { value = -0.2 + 0.4*GenomeAnalysisEngine.getRandomGenerator().nextDouble(); }
|
||||||
|
if( annotationKey.equalsIgnoreCase("FS") && MathUtils.compareDoubles(value, 0.0, 0.01) == 0 ) { value = -0.2 + 0.4*GenomeAnalysisEngine.getRandomGenerator().nextDouble(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch( final Exception e ) {
|
} catch( final Exception e ) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue