Okay, finished up the ability to cap a base's qual by its read's mapping quality.
This is experimental - I have not tested its performance on SNP calling, or even played around with it. If you want to test it out, go nuts. But don't come running to me if your results are not good. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3282 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
850f36aa61
commit
0e10359a5e
|
|
@ -76,7 +76,7 @@ public class DiploidGenotypeCalculationModel extends JointEstimateGenotypeCalcul
|
|||
// create the GenotypeLikelihoods object
|
||||
GenotypeLikelihoods GL = new GenotypeLikelihoods(UAC.baseModel, priors, UAC.defaultPlatform);
|
||||
|
||||
GL.add(pileup, true);
|
||||
GL.add(pileup, true, UAC.CAP_BASE_QUALITY);
|
||||
GLs.put(sample, GL);
|
||||
|
||||
double[] posteriors = GL.getPosteriors();
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ public class GenotypeLikelihoods implements Cloneable {
|
|||
}
|
||||
|
||||
public int add(ReadBackedPileup pileup) {
|
||||
return add(pileup, false);
|
||||
return add(pileup, false, false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -271,11 +271,12 @@ public class GenotypeLikelihoods implements Cloneable {
|
|||
* read-based pileup up by calling add(observedBase, qualityScore) for each base / qual in the
|
||||
* pileup
|
||||
*
|
||||
* @param pileup read pileup
|
||||
* @param ignoreBadBases should we ignore bad bases
|
||||
* @param pileup read pileup
|
||||
* @param ignoreBadBases should we ignore bad bases?
|
||||
* @param capBaseQualsAtMappingQual should we cap a base's quality by its read's mapping quality?
|
||||
* @return the number of good bases found in the pileup
|
||||
*/
|
||||
public int add(ReadBackedPileup pileup, boolean ignoreBadBases) {
|
||||
public int add(ReadBackedPileup pileup, boolean ignoreBadBases, boolean capBaseQualsAtMappingQual) {
|
||||
int n = 0;
|
||||
|
||||
for ( PileupElement p : pileup ) {
|
||||
|
|
@ -285,7 +286,8 @@ public class GenotypeLikelihoods implements Cloneable {
|
|||
|
||||
char base = (char)p.getBase();
|
||||
if ( ! ignoreBadBases || ! badBase(base) ) {
|
||||
n += add(base, p.getQual(), p.getRead(), p.getOffset());
|
||||
byte qual = capBaseQualsAtMappingQual ? (byte)Math.min((int)p.getQual(), p.getMappingQual()) : p.getQual();
|
||||
n += add(base, qual, p.getRead(), p.getOffset());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue