Cleaned code and reorganized -- moving in the right direction for v2
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1052 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
9fe330cdf1
commit
d748c85dc4
|
|
@ -1,4 +1,4 @@
|
||||||
package org.broadinstitute.sting.playground.gatk.walkers.recalibration;
|
package org.broadinstitute.sting.gatk.walkers.recalibration;
|
||||||
|
|
||||||
import net.sf.samtools.SAMRecord;
|
import net.sf.samtools.SAMRecord;
|
||||||
import net.sf.samtools.SAMReadGroupRecord;
|
import net.sf.samtools.SAMReadGroupRecord;
|
||||||
|
|
@ -43,8 +43,9 @@ public class CovariateCounterWalker extends LocusWalker<Integer, Integer> {
|
||||||
@Argument(fullName="MAX_READ_GROUPS", shortName="mrg", required=false, doc="Abort if number of read groups in input file exceeeds this count.")
|
@Argument(fullName="MAX_READ_GROUPS", shortName="mrg", required=false, doc="Abort if number of read groups in input file exceeeds this count.")
|
||||||
public int MAX_READ_GROUPS = 100;
|
public int MAX_READ_GROUPS = 100;
|
||||||
|
|
||||||
@Argument(fullName="PLATFORM", shortName="pl", required=false, doc="Only calibrate read groups generated from the given platform (default = Illumina)")
|
@Argument(fullName="PLATFORM", shortName="pl", required=false, doc="Only calibrate read groups generated from the given platform (default = * for all platforms)")
|
||||||
public List<String> platforms = Collections.singletonList("ILLUMINA");
|
public List<String> platforms = Collections.singletonList("*");
|
||||||
|
//public List<String> platforms = Collections.singletonList("ILLUMINA");
|
||||||
|
|
||||||
@Argument(fullName="rawData", shortName="raw", required=false, doc="If true, raw mismatch observations will be output to a file")
|
@Argument(fullName="rawData", shortName="raw", required=false, doc="If true, raw mismatch observations will be output to a file")
|
||||||
public boolean outputRawData = true;
|
public boolean outputRawData = true;
|
||||||
|
|
@ -380,7 +381,9 @@ public class CovariateCounterWalker extends LocusWalker<Integer, Integer> {
|
||||||
private boolean isSupportedReadGroup( SAMReadGroupRecord readGroup ) {
|
private boolean isSupportedReadGroup( SAMReadGroupRecord readGroup ) {
|
||||||
for( String platform: platforms ) {
|
for( String platform: platforms ) {
|
||||||
platform = platform.trim();
|
platform = platform.trim();
|
||||||
if( readGroup.getAttribute("PL") == null || readGroup.getAttribute("PL").toString().equalsIgnoreCase(platform) )
|
if( readGroup.getAttribute("PL") == null ||
|
||||||
|
platform.equals("*") ||
|
||||||
|
readGroup.getAttribute("PL").toString().equalsIgnoreCase(platform) )
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package org.broadinstitute.sting.playground.gatk.walkers.recalibration;
|
package org.broadinstitute.sting.gatk.walkers.recalibration;
|
||||||
|
|
||||||
import net.sf.samtools.*;
|
import net.sf.samtools.*;
|
||||||
import org.broadinstitute.sting.gatk.walkers.WalkerName;
|
import org.broadinstitute.sting.gatk.walkers.WalkerName;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package org.broadinstitute.sting.playground.gatk.walkers.recalibration;
|
package org.broadinstitute.sting.gatk.walkers.recalibration;
|
||||||
|
|
||||||
import org.broadinstitute.sting.utils.QualityUtils;
|
import org.broadinstitute.sting.utils.QualityUtils;
|
||||||
import org.broadinstitute.sting.utils.BaseUtils;
|
import org.broadinstitute.sting.utils.BaseUtils;
|
||||||
|
|
@ -38,7 +38,7 @@ public class RecalData {
|
||||||
|
|
||||||
public double empiricalQualDouble() {
|
public double empiricalQualDouble() {
|
||||||
double empiricalQual = -10 * Math.log10((double)B / N);
|
double empiricalQual = -10 * Math.log10((double)B / N);
|
||||||
if (empiricalQual > QualityUtils.MAX_QUAL_SCORE) empiricalQual = QualityUtils.MAX_QUAL_SCORE;
|
if (empiricalQual > QualityUtils.MAX_REASONABLE_Q_SCORE) empiricalQual = QualityUtils.MAX_REASONABLE_Q_SCORE;
|
||||||
return empiricalQual;
|
return empiricalQual;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package org.broadinstitute.sting.playground.gatk.walkers.recalibration;
|
package org.broadinstitute.sting.gatk.walkers.recalibration;
|
||||||
|
|
||||||
import org.broadinstitute.sting.utils.QualityUtils;
|
import org.broadinstitute.sting.utils.QualityUtils;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package org.broadinstitute.sting.playground.gatk.walkers.recalibration;
|
package org.broadinstitute.sting.gatk.walkers.recalibration;
|
||||||
|
|
||||||
import net.sf.samtools.*;
|
import net.sf.samtools.*;
|
||||||
import org.broadinstitute.sting.gatk.walkers.WalkerName;
|
import org.broadinstitute.sting.gatk.walkers.WalkerName;
|
||||||
|
|
@ -7,7 +7,6 @@ import org.broadinstitute.sting.gatk.walkers.Requires;
|
||||||
import org.broadinstitute.sting.gatk.walkers.DataSource;
|
import org.broadinstitute.sting.gatk.walkers.DataSource;
|
||||||
import org.broadinstitute.sting.utils.cmdLine.Argument;
|
import org.broadinstitute.sting.utils.cmdLine.Argument;
|
||||||
import org.broadinstitute.sting.utils.*;
|
import org.broadinstitute.sting.utils.*;
|
||||||
import org.broadinstitute.sting.playground.gatk.walkers.recalibration.RecalData;
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,8 @@ package org.broadinstitute.sting.utils;
|
||||||
*/
|
*/
|
||||||
public class QualityUtils {
|
public class QualityUtils {
|
||||||
public final static byte MAX_QUAL_SCORE = 63;
|
public final static byte MAX_QUAL_SCORE = 63;
|
||||||
|
public final static double MIN_REASONABLE_ERROR = 0.0001;
|
||||||
|
public final static byte MAX_REASONABLE_Q_SCORE = 40;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Private constructor. No instantiating this class!
|
* Private constructor. No instantiating this class!
|
||||||
|
|
@ -47,7 +49,7 @@ public class QualityUtils {
|
||||||
* @return a quality score (0-40)
|
* @return a quality score (0-40)
|
||||||
*/
|
*/
|
||||||
static public byte probToQual(double prob) {
|
static public byte probToQual(double prob) {
|
||||||
return probToQual(prob, 0.0001);
|
return probToQual(prob, MIN_REASONABLE_ERROR);
|
||||||
//return (byte) Math.round(-10.0*Math.log10(1.0 - prob + 0.0001));
|
//return (byte) Math.round(-10.0*Math.log10(1.0 - prob + 0.0001));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue