Modifier and Type | Field and Description |
---|---|
private int |
k |
private Motif |
m |
private static java.lang.String |
scoreDataInfo
Returns the number of mismatches between s and this model, normalized by the length of the model.
|
DEFAULT_RC
Constructor and Description |
---|
KMismatchModel(Motif m,
int k)
Creates a new k-mismatch model using the given Motif as the model and k as the number of allowable mismatches.
|
KMismatchModel(java.lang.String consensus,
boolean rc,
java.lang.String[] sequences)
Creates a new k-mismatch model from a consensus sequence and the array of actual binding site sequences, setting k to the max hamming
distance of any of the binding sites from the consensus; uses the given reverse complement flag.
|
KMismatchModel(java.lang.String seq,
int k)
Creates a new k-mismatch model.
|
KMismatchModel(java.lang.String consensus,
java.lang.String[] sequences)
Creates a new k-mismatch model from a consensus sequence and the array of actual binding site sequences, setting k to the max hamming
distance of any of the binding sites from the consensus; reverse complement flag is set to true if this results in a smaller k than
does false, but otherwise it is set to false.
|
Modifier and Type | Method and Description |
---|---|
double |
approximateExpansionSize()
Returns an approximation of the number of strings of primary bases that this k-mismatch model represents.
|
MotifList |
expandAsMotifList()
Returns a MotifList containing the unambiguous Motifs that this k-mismatch model represents.
|
java.lang.String[] |
expandAsStrings()
Returns an array of the strings of primary bases that this k-mismatch model represents.
|
boolean |
generatesString(java.lang.String s)
Returns true if this string is generated by this KMM model.
|
java.util.Comparator<Motif> |
getComparator()
Comparator sorts arrays from least to greatest by the
scoreString(String) method. |
MotifList |
getHits(java.lang.String seq)
Returns a MotifList of all Motifs (r) in seq that match this model.
|
int |
getK() |
private static int |
getMaxHammingDistance(Motif m,
java.lang.String[] sequences)
Returns the max hamming distance between m and any string in the array.
|
java.lang.String |
getName()
Return a name that will be uniq to this type of model.
|
CREModel |
newInstanceOf(MotifList ml)
Creates a new KMM where the motif and k value represent that motif from the MotifList ml that has the lowest k with respect to all the
other motifs in ml.
|
Motif.ScoreData |
scoreString(java.lang.String s)
Returns the score that a given model would give to a sequence.
|
void |
setK(int k) |
void |
setStringency(double s)
Sets k to be s*length().
|
java.lang.String |
toString()
Returns a string of the sequence.
|
private int k
private Motif m
private static final java.lang.String scoreDataInfo
public KMismatchModel(Motif m, int k)
public KMismatchModel(java.lang.String consensus, boolean rc, java.lang.String[] sequences)
public KMismatchModel(java.lang.String seq, int k)
public KMismatchModel(java.lang.String consensus, java.lang.String[] sequences)
private static int getMaxHammingDistance(Motif m, java.lang.String[] sequences)
public double approximateExpansionSize()
public MotifList expandAsMotifList()
expandAsMotifList
in interface CREModel
public java.lang.String[] expandAsStrings()
expandAsStrings
in interface CREModel
public boolean generatesString(java.lang.String s)
generatesString
in interface CREModel
public java.util.Comparator<Motif> getComparator()
scoreString(String)
method. This is because the score returned by
scoreString is the number of mismatches per base. Obviously fewer is better.getComparator
in interface CREModel
public MotifList getHits(java.lang.String seq)
public int getK()
public java.lang.String getName()
CREModel
public CREModel newInstanceOf(MotifList ml)
newInstanceOf
in interface CREModel
public Motif.ScoreData scoreString(java.lang.String s)
CREModel
scoreString
in interface CREModel
public void setK(int k)
public void setStringency(double s)
setStringency
in interface CREModel