Class Pwm

java.lang.Object
org.snpeff.motif.Pwm
Direct Known Subclasses:
PwmAndSeqs

public class Pwm extends Object
Create a DNA motif count matrix Refrence http://en.wikipedia.org/wiki/Position-specific_scoring_matrix
Author:
pcingola
  • Field Details

    • SCALE

      public static final int SCALE
      See Also:
    • BASES

      public static final char[] BASES
  • Constructor Details

    • Pwm

      public Pwm(int length)
    • Pwm

      public Pwm(String file)
  • 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

      public String getBestSequenceStr()
    • getCount

      public int getCount(char base, int position)
      Get counts for a given position
    • getId

      public String getId()
    • getLogOdds

      public double getLogOdds(char base, int position)
    • getName

      public String 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

      public double score(String dna)
      Calculate PWM score for a string
    • set

      public void set(String dna)
      Set PWM as a perfect match to a dna sequence
    • setCounts

      public void setCounts(char base, int[] counts)
      Set counts for one base
    • setId

      public void setId(String id)
    • setName

      public void setName(String name)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • updateCounts

      public void updateCounts(String dna)
    • updateCounts

      public void updateCounts(String dna, int inc)
      Update counts matrix.