object LogProbability
Provides a set of operations for working with probabilities stored as (natural) logs. Operations are named based on logical operations (e.g. probability of a 'and' b) vs. mathematical operations (a * b or a + b).
Most operations perform bounds and argument checking to ensure that nonsensical operations (e.g. divide by zero) don't proceed silently.
- Alphabetic
- By Inheritance
- LogProbability
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
aOrNotB(a: LogProbability, b: LogProbability): LogProbability
Computes the probability Pr(A OR not B) = Pr(A) - Pr(B).
Computes the probability Pr(A OR not B) = Pr(A) - Pr(B). While this could be computed using or(a, not(b)), this form is more efficient and more precise.
-
def
and(values: Array[Double]): LogProbability
Computes the probability of the given independent events co-occurring: Pr(AB..N) = Pr(A)*Pr(B)*...*Pr(N).
-
def
and(a: LogProbability, b: LogProbability): LogProbability
Computes the probability of a and b, where a and b are independent events: Pr(AB) = Pr(A)*Pr(B).
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
expProb(p: LogProbability): Double
Exponentiates a LogProbability and limits the return to the range 0-1 to gracefully handle probabilities with minor numerical imprecisions.
Exponentiates a LogProbability and limits the return to the range 0-1 to gracefully handle probabilities with minor numerical imprecisions. If the LogProbability does not represent a probability between 0 and 1 Math.exp should be used instead.
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
fromPhredScore(s: Int): LogProbability
Takes a phred score and converts it into the natural log of the probability of error.
-
def
fromPhredScore(s: PhredScore): LogProbability
Takes a phred score and converts it into the natural log of the probability of error.
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
normalizeByLogProbability(p: LogProbability, divideBy: LogProbability): LogProbability
Normalizes a probability.
-
def
normalizeByScalar(p: LogProbability, divideBy: Int): LogProbability
Normalizes a probability.
-
def
not(a: LogProbability): LogProbability
Returns the probability of Pr(not A) = 1 - Pr(A).
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
or(values: Array[LogProbability]): LogProbability
Computes the probability of any of the given independent events occurring: Pr(AB..N) = Pr(A)+Pr(B)+...+Pr(N).
-
def
or(a: LogProbability, b: LogProbability): LogProbability
Computes the probability of a or b, where a and b are independent events: Pr(A or B) = Pr(A) + Pr(B).
-
def
probabilityOfErrorTwoTrials(prErrorTrialOne: LogProbability, prErrorTrialTwo: LogProbability): LogProbability
Computes the probability of seeing an error in the base sequence if there are two independent error processes.
Computes the probability of seeing an error in the base sequence if there are two independent error processes. We sum three terms: 1. the probability of an error in trial one and no error in trial two: Pr(A=Error, B=NoError). 2. the probability of no error in trial one and an error in trial two: Pr(A=NoError, B=Error). 3. the probability of an error in both trials, but when the second trial does not reverse the error in first one, which for DNA (4 bases) would only occur 2/3 times: Pr(A=x->y, B=y->z) * Pr(x!=z | x!=y, y!=z, x,y,z \in {A,C,G,T})
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toLogProbability(value: Double): LogProbability
Converts the double to log-space.
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )