public final class BAQ
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
BAQ.BAQCalculationResult |
static class |
BAQ.CalculationMode |
static class |
BAQ.QualityMode
these are features that only the walker can override
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BAQ_TAG |
double |
cd |
static int |
DEFAULT_BANDWIDTH |
static double |
DEFAULT_GOP |
Constructor and Description |
---|
BAQ()
Use defaults for everything
|
BAQ(double gapOpenPenalty)
Use defaults for everything
|
BAQ(double d,
double e,
int b,
byte minBaseQual)
Create a new HmmGlocal object with specified parameters
|
Modifier and Type | Method and Description |
---|---|
static void |
addBAQTag(GATKRead read,
byte[] baq) |
byte[] |
baqRead(GATKRead read,
ReferenceDataSource refDS,
BAQ.CalculationMode calculationType,
BAQ.QualityMode qmode)
Modifies read in place so that the base quality scores are capped by the BAQ calculation.
|
BAQ.BAQCalculationResult |
calcBAQFromHMM(byte[] ref,
byte[] query,
byte[] quals,
int queryStart,
int queryEnd) |
BAQ.BAQCalculationResult |
calcBAQFromHMM(GATKRead read,
byte[] ref,
int refOffset) |
BAQ.BAQCalculationResult |
calcBAQFromHMM(GATKRead read,
ReferenceDataSource refDS) |
static byte[] |
calcBAQFromTag(GATKRead read,
boolean overwriteOriginalQuals,
boolean useRawQualsIfNoBAQTag)
Returns a new qual array for read that includes the BAQ adjustment.
|
static byte |
calcBAQFromTag(GATKRead read,
int offset,
boolean useRawQualsIfNoBAQTag)
Returns the BAQ adjusted quality score for this read at this offset.
|
protected double |
calcEpsilon(byte ref,
byte read,
byte qualB) |
byte |
capBaseByBAQ(byte oq,
byte bq,
int state,
int expectedPos) |
static java.lang.String |
encodeBQTag(GATKRead read,
byte[] baq) |
boolean |
excludeReadFromBAQ(GATKRead read)
Returns true if we don't think this read is eligible for the BAQ calculation.
|
int |
getBandWidth() |
static byte[] |
getBAQTag(GATKRead read)
Get the BAQ attribute from the tag in read.
|
double |
getGapExtensionProb() |
double |
getGapOpenProb() |
byte |
getMinBaseQual() |
static SimpleInterval |
getReferenceWindowForRead(GATKRead read,
int bandWidth)
Given a read, get an interval representing the span of reference bases required by BAQ for that read
|
static boolean |
hasBAQTag(GATKRead read)
Returns true if the read has a BAQ tag, or false otherwise
|
int |
hmm_glocal(byte[] ref,
byte[] query,
int qstart,
int l_query,
byte[] _iqual,
int[] state,
byte[] q) |
static int |
stateAlignedPosition(int state)
decode the bit encoded state array values
|
static boolean |
stateIsIndel(int state)
decode the bit encoded state array values
|
public static final java.lang.String BAQ_TAG
public static final double DEFAULT_GOP
public static final int DEFAULT_BANDWIDTH
public double cd
public BAQ()
public BAQ(double gapOpenPenalty)
public BAQ(double d, double e, int b, byte minBaseQual)
d
- gap open prob (not phred scaled!).e
- gap extension prob.b
- band widthminBaseQual
- All bases with Q < minBaseQual are up'd to this valuepublic byte getMinBaseQual()
public double getGapOpenProb()
public double getGapExtensionProb()
public int getBandWidth()
protected double calcEpsilon(byte ref, byte read, byte qualB)
public int hmm_glocal(byte[] ref, byte[] query, int qstart, int l_query, byte[] _iqual, int[] state, byte[] q)
public static boolean stateIsIndel(int state)
public static int stateAlignedPosition(int state)
public static byte[] getBAQTag(GATKRead read)
read
- public static java.lang.String encodeBQTag(GATKRead read, byte[] baq)
public static void addBAQTag(GATKRead read, byte[] baq)
public static boolean hasBAQTag(GATKRead read)
public static byte[] calcBAQFromTag(GATKRead read, boolean overwriteOriginalQuals, boolean useRawQualsIfNoBAQTag)
read
- the GATKRead to operate onoverwriteOriginalQuals
- If true, we replace the original qualities scores in the read with their BAQ'd versionuseRawQualsIfNoBAQTag
- If useRawQualsIfNoBAQTag is true, then if there's no BAQ annotation we just use the raw quality scores. Throws IllegalStateException is false and no BAQ tag is presentpublic static byte calcBAQFromTag(GATKRead read, int offset, boolean useRawQualsIfNoBAQTag)
read
- the GATKRead to operate onoffset
- the offset of operate onuseRawQualsIfNoBAQTag
- If useRawQualsIfNoBAQTag is true, then if there's no BAQ annotation we just use the raw quality scores. Throws IllegalStateException is false and no BAQ tag is presentpublic static SimpleInterval getReferenceWindowForRead(GATKRead read, int bandWidth)
read
- read that is going to be input to BAQbandWidth
- band width being used by the BAQ algorithmpublic BAQ.BAQCalculationResult calcBAQFromHMM(GATKRead read, ReferenceDataSource refDS)
public BAQ.BAQCalculationResult calcBAQFromHMM(byte[] ref, byte[] query, byte[] quals, int queryStart, int queryEnd)
public BAQ.BAQCalculationResult calcBAQFromHMM(GATKRead read, byte[] ref, int refOffset)
public byte capBaseByBAQ(byte oq, byte bq, int state, int expectedPos)
public byte[] baqRead(GATKRead read, ReferenceDataSource refDS, BAQ.CalculationMode calculationType, BAQ.QualityMode qmode)
public boolean excludeReadFromBAQ(GATKRead read)
read
-