public final class PairHMMModel
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
deletionToDeletion
Position in the transition probability array for the Deletion-to-Deletion transition.
|
static int |
indelToMatch
Position in the transition probability array for the Indel-to-Match transition.
|
static int |
insertionToInsertion
Position in the transition probability array for the Insertion-to-Insertion transition.
|
static int |
matchToDeletion
Position in the transition probability array for the Match-to-Deletion transition.
|
static int |
matchToInsertion
Position in the transition probability array for the Match-to-Insertion transition.
|
static int |
matchToMatch
Position in the transition probability array for the Match-to-Match transition.
|
static int |
TRANS_PROB_ARRAY_LENGTH
Length of the standard transition probability array.
|
Modifier and Type | Method and Description |
---|---|
static double[][] |
createTransitionMatrix(int maxReadLength)
Creates a transition probability matrix large enough to work with sequences of a particular length.
|
static double |
matchToMatchProb(byte insQual,
byte delQual)
Returns the probability that neither of two event takes place.
|
static double |
matchToMatchProb(int insQual,
int delQual)
Returns the probability that neither of two events, insertion and deletion, takes place.
|
static double |
matchToMatchProbLog10(byte insQual,
byte delQual)
Returns the log10 probability that neither of two events, insertion and deletion, takes place.
|
static double |
matchToMatchProbLog10(int insQual,
int delQual)
Returns the log-probability that neither of two events takes place.
|
static double[][] |
qualToTransProbs(byte[] insQuals,
byte[] delQuals,
byte[] gcps)
Returns a matrix with the transition probabilities for a number of bases.
|
static double[] |
qualToTransProbs(byte insQual,
byte delQual,
byte gcp)
Returns a transition probability array given the different quality scores affecting a read site.
|
static void |
qualToTransProbs(double[][] dest,
byte[] insQuals,
byte[] delQuals,
byte[] gcps)
Fills ax matrix with the transition probabilities for a number of bases.
|
static void |
qualToTransProbs(double[] dest,
byte insQual,
byte delQual,
byte gcp)
Fills a transition probability array given the different quality scores affecting a read site
|
static double[][] |
qualToTransProbsLog10(byte[] insQuals,
byte[] delQuals,
byte[] gcps)
Returns a matrix with the log10 transition probabilities for a number of bases.
|
static double[] |
qualToTransProbsLog10(byte insQual,
byte delQual,
byte gcp)
Returns a transition log10 probability array given the different quality scores affecting a read site.
|
static void |
qualToTransProbsLog10(double[][] dest,
byte[] insQuals,
byte[] delQuals,
byte[] gcps)
Fills a matrix with the log10 transition probabilities for a number of bases.
|
static void |
qualToTransProbsLog10(double[] dest,
byte insQual,
byte delQual,
byte gcp)
Fills a transition log10-probability array given the different quality scores affecting a read site.
|
public static final int TRANS_PROB_ARRAY_LENGTH
public static final int matchToMatch
public static final int indelToMatch
public static final int matchToInsertion
public static final int insertionToInsertion
public static final int matchToDeletion
public static final int deletionToDeletion
public static void qualToTransProbs(double[] dest, byte insQual, byte delQual, byte gcp)
insQual
- the insertion quality score as a byte.delQual
- the deletion quality score as a byte.gcp
- the gap-continuation-penalty score as a byte.java.lang.NullPointerException
- if dest
is null
.java.lang.ArrayIndexOutOfBoundsException
- if dest
is not large enough.java.lang.IllegalArgumentException
- if insQual
, delQual
or gcp
is less than negative.public static double[] qualToTransProbs(byte insQual, byte delQual, byte gcp)
insQual
- the insertion quality score as a byte.delQual
- the deletion quality score as a byte.gcp
- the gap-continuation-penalty score as a byte.null
. An array of length TRANS_PROB_ARRAY_LENGTH
.java.lang.NullPointerException
- if dest
is null
.java.lang.ArrayIndexOutOfBoundsException
- if dest
is not large enough.java.lang.IllegalArgumentException
- if insQual
, delQual
or gcp
is less than negative.public static void qualToTransProbs(double[][] dest, byte[] insQuals, byte[] delQuals, byte[] gcps)
insQual.length + 1
.
Each entry is the transition probability array for that base with a length of TRANS_PROB_ARRAY_LENGTH
.dest
- the matrix to updateinsQuals
- insertion qualities.delQuals
- deletion qualities.gcps
- gap-continuation penalty qualities.java.lang.NullPointerException
- if any of the input arrays, matrices is null
or any entry in dest
is null
.java.lang.IllegalArgumentException
- if IllegalArgumentException
if the input array don't have the same length.java.lang.ArrayIndexOutOfBoundsException
- if dest
or any of its elements is not large enough to contain the
transition matrix.public static double[][] qualToTransProbs(byte[] insQuals, byte[] delQuals, byte[] gcps)
insQual.length + 1
.
Each entry is the transition probability array for that base with a length of TRANS_PROB_ARRAY_LENGTH
.insQuals
- insertion qualities.delQuals
- deletion qualities.gcps
- gap-continuation penalty qualities.null
, an matrix of the dimensions explained above.java.lang.NullPointerException
- if any of the input arrays is null
.java.lang.IllegalArgumentException
- if IllegalArgumentException
if the input array don't have the same length.public static void qualToTransProbsLog10(double[] dest, byte insQual, byte delQual, byte gcp)
insQual
- the insertion quality score as a byte.delQual
- the deletion quality score as a byte.gcp
- the gap-continuation-penalty score as a byte.java.lang.NullPointerException
- if dest
is null
.java.lang.ArrayIndexOutOfBoundsException
- if dest
is not large enough.java.lang.IllegalArgumentException
- if insQual
, delQual
or gcp
is less than negative.public static double[] qualToTransProbsLog10(byte insQual, byte delQual, byte gcp)
insQual
- the insertion quality score as a byte.delQual
- the deletion quality score as a byte.gcp
- the gap-continuation-penalty score as a byte.null
. An array of length TRANS_PROB_ARRAY_LENGTH
.java.lang.NullPointerException
- if dest
is null
.java.lang.ArrayIndexOutOfBoundsException
- if dest
is not large enough.java.lang.IllegalArgumentException
- if insQual
, delQual
or gcp
is less than negative.public static void qualToTransProbsLog10(double[][] dest, byte[] insQuals, byte[] delQuals, byte[] gcps)
insQual.length + 1
.
Each entry is the transition probability array for that base with a length of TRANS_PROB_ARRAY_LENGTH
.insQuals
- insertion qualities.delQuals
- deletion qualities.gcps
- gap-continuation penalty qualities.java.lang.NullPointerException
- if any of the input arrays, matrices is null
or any entry in dest
is null
.java.lang.IllegalArgumentException
- if IllegalArgumentException
if the input array don't have the same length.java.lang.ArrayIndexOutOfBoundsException
- if dest
or any of its elements is not large enough to contain the
transition matrix.public static double[][] qualToTransProbsLog10(byte[] insQuals, byte[] delQuals, byte[] gcps)
insQual.length + 1
.
Each entry is the transition probability array for that base with a length of TRANS_PROB_ARRAY_LENGTH
.insQuals
- insertion qualities.delQuals
- deletion qualities.gcps
- gap-continuation penalty qualities.null
, an matrix of the dimensions explained above.java.lang.NullPointerException
- if any of the input arrays is null
.java.lang.IllegalArgumentException
- if IllegalArgumentException
if the input array don't have the same length.public static double[][] createTransitionMatrix(int maxReadLength)
maxReadLength
- the maximum read length for the transition matrix.null
. A matrix of maxReadLength + 1
by TRANS_PROB_ARRAY_LENGTH
positions.public static double matchToMatchProb(byte insQual, byte delQual)
1 - ProbErr(insQual) - ProbErr(delQual)
insQual
- PhRED scaled quality/probability of the first event.delQual
- PhRED scaled quality/probability of the second event.public static double matchToMatchProbLog10(byte insQual, byte delQual)
1 - ProbErr(insQual) - ProbErr(delQual)
insQual
- PhRED scaled quality/probability of an insertion.delQual
- PhRED scaled quality/probability of a deletion.public static double matchToMatchProb(int insQual, int delQual)
1 - ProbErr(insQual) - ProbErr(delQual)
insQual
- PhRED scaled quality/probability of an insertion.delQual
- PhRED scaled quality/probability of a deletion.public static double matchToMatchProbLog10(int insQual, int delQual)
1 - ProbErr(insQual) - ProbErr(delQual)
insQual
- PhRED scaled quality/probability of an insertion.delQual
- PhRED scaled quality/probability of a deletion.