Package org.snpeff.motif
Class Pwm
java.lang.Object
org.snpeff.motif.Pwm
- Direct Known Subclasses:
PwmAndSeqs
Create a DNA motif count matrix
Refrence http://en.wikipedia.org/wiki/Position-specific_scoring_matrix
- Author:
- pcingola
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Calculate log odds matrix from counts Reference: http://en.wikipedia.org/wiki/Position-specific_scoring_matrixchar[]
Get best matching sequence (highest score)int
getCount
(char base, int position) Get counts for a given positiongetId()
double
getLogOdds
(char base, int position) getName()
int
boolean
isConserved
(int pos) Is position 'pos' conserved (only one base has non-zero counts)int
length()
double
Calculate PWM score for a stringvoid
Set PWM as a perfect match to a dna sequencevoid
setCounts
(char base, int[] counts) Set counts for one basevoid
void
toString()
void
updateCounts
(String dna) void
updateCounts
(String dna, int inc) Update counts matrix.
-
Field Details
-
SCALE
public static final int SCALE- See Also:
-
BASES
public static final char[] BASES
-
-
Constructor Details
-
Pwm
public Pwm(int length) -
Pwm
-
-
Method Details
-
calcLogOddsWeight
public void calcLogOddsWeight()Calculate log odds matrix from counts Reference: http://en.wikipedia.org/wiki/Position-specific_scoring_matrix -
getBestSequence
public char[] getBestSequence()Get best matching sequence (highest score)- Returns:
-
getBestSequenceStr
-
getCount
public int getCount(char base, int position) Get counts for a given position -
getId
-
getLogOdds
public double getLogOdds(char base, int position) -
getName
-
getTotalCount
public int getTotalCount() -
isConserved
public boolean isConserved(int pos) Is position 'pos' conserved (only one base has non-zero counts) -
length
public int length() -
score
Calculate PWM score for a string -
set
Set PWM as a perfect match to a dna sequence -
setCounts
public void setCounts(char base, int[] counts) Set counts for one base -
setId
-
setName
-
toString
-
updateCounts
-
updateCounts
Update counts matrix.
-