public class PLConsensusModel extends ConsensusSequence
WH Day and FR McMorris (1992) "Critical comparison of consensus methods for molecular sequences." Nucleic Acids Research, 20, 1093.
To compute the appropriate ambiguous base, the method sorts all the bases by their frequencey: eg
P=(A,A,A,C,C,G)Then return all ambiguous bases that represent profiles that are the minimum distance from P, where distance is defined as the hamming distance. So the distance between P and W is
P=(A,A,A,C,C,G), W=(A,A,A,C,C,C) --> distance of 1. This rule means that multiple degenerate bases may have the minimum distance. In this case, the following heuristic is used: The shortest (ie, most specific) degenerate base is used, so long as only one degenerate base of that length is returned. @author Jonathan M. Carlson
DEFAULT_RC
Constructor and Description |
---|
PLConsensusModel(Motif m)
Creates a consensus sequence from the given sequence with the reverse complement flag set to m's reverse compliment.
|
PLConsensusModel(java.lang.String seq)
Creates a consensus sequence from the given sequence with the reverse complement flag set to
CREModel.DEFAULT_RC . |
PLConsensusModel(java.lang.String seq,
boolean rc)
Creates a consensus sequence from the given sequence with the given reverse complemnt flag.
|
Modifier and Type | Method and Description |
---|---|
static char |
bestChar(int[] f) |
static char[] |
bestChars(int[] f)
Given a frequency vector f, returns those IUPAC chars over the FULL Alphabet that are closest to f.
|
static int[] |
charToDist(char b,
int[] f)
Converts a character b over the FULL alphabet to an array of frequencies that most closely matches the given array of frequencies.
|
static int |
distance(int[] a,
int[] b)
Returns the minimum number of changes needed to turn a into b (or vice versa).
|
java.lang.String |
getName()
Return a name that will be uniq to this type of model.
|
CREModel |
newInstanceOf(MotifList ml)
Creates a new PLConsensusModel as the union of all the motifs in ml, as specified by
MotifList.uniteMotifs() . |
expandAsMotifList, expandAsStrings, generatesString, getComparator, getHits, getSequence, scoreString, setStringency, toString, useRevComp
public PLConsensusModel(Motif m)
public PLConsensusModel(java.lang.String seq)
CREModel.DEFAULT_RC
.public PLConsensusModel(java.lang.String seq, boolean rc)
public static char bestChar(int[] f)
public static char[] bestChars(int[] f)
PWM.BASE_KEY
. Distance is specified by distance(int[], int[])
. If
multiple bases are at the same minimum distance, then all of them will be returned.public static int[] charToDist(char b, int[] f)
PWM.BASE_KEY
.public static int distance(int[] a, int[] b)
public java.lang.String getName()
CREModel
getName
in interface CREModel
getName
in class ConsensusSequence
public CREModel newInstanceOf(MotifList ml)
MotifList.uniteMotifs()
.newInstanceOf
in interface CREModel
newInstanceOf
in class ConsensusSequence