Modifier and Type | Field and Description |
---|---|
private java.util.ArrayList<Motif> |
list |
static java.lang.String |
MOTIF_DELIMITER |
private double |
score |
Constructor and Description |
---|
MotifList()
Creates a new empty motif list.
|
MotifList(int n)
Creates a new empty motif list with initial capacity set to n.
|
MotifList(Motif m)
Initializes this motif list to contain m; the score is initialized to the score of m.
|
MotifList(Motif[] m)
Creates a new motif list filled with the given array of motifs.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Motif m) |
double |
avgLength()
Returns the average length of the component motifs.
|
java.lang.Object |
clone()
Returns a deep copy of this motif list.
|
int |
compareTo(MotifList ml)
Allows Arrays.sort() to sort MotifList objects by score in descending order.
|
boolean |
equals(java.lang.Object o)
Returns true if and only if the to motif lists are the same size and each motif in order is equal to the motif in the same position in
the other motif list, as determined by the motif equals method; score is NOT taken into account.
|
Motif |
get(int i) |
double |
getScore() |
java.lang.String |
getSequence()
Returns the
getFlaggedSequence() versions of the motifs in this list, separated by
MOTIF_DELIMITER . |
double |
getValue()
Same as getScore().
|
int |
hashCode()
Simply returns the hashCode value of the
getSequence() representation. |
boolean |
isEmpty() |
void |
removeDuplicates()
Removes duplicate entries, as judged by a
SequenceComparator . |
void |
set(int i,
Motif m) |
void |
setScore(double s) |
int |
size() |
Motif[] |
toArray() |
java.lang.String |
toString()
Returns score [tab]
getSequence() . |
MotifList |
unionWith(MotifList m)
Returns the union of this motif list with the given motif list; ensures that there are no duplicates, as given by the motif equals
method, so long as the motifs in both this list and the given list are sorted by score.
|
Motif |
uniteMotifs()
Collapses this motif list into a single, ambiguous motif that represents the union of all the motifs in the list; the score of the
returned motif is set to be the current score of the MotifList; strip is set to true.
|
Motif |
uniteMotifs(boolean strip)
Collapses this motif list into a single, ambiguous motif that represents the union of all the motifs in the list; the score of the
returned motif is set to be the current score of the MotifList.
|
public static final java.lang.String MOTIF_DELIMITER
private java.util.ArrayList<Motif> list
private double score
public MotifList()
public MotifList(int n)
public MotifList(Motif m)
public MotifList(Motif[] m)
public void add(Motif m)
public double avgLength()
public java.lang.Object clone()
clone
in class java.lang.Object
public int compareTo(MotifList ml)
compareTo
in interface java.lang.Comparable<MotifList>
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public Motif get(int i)
public double getScore()
public java.lang.String getSequence()
getFlaggedSequence()
versions of the motifs in this list, separated by
MOTIF_DELIMITER
.public int hashCode()
getSequence()
representation.hashCode
in class java.lang.Object
public boolean isEmpty()
public void removeDuplicates()
SequenceComparator
.public void set(int i, Motif m)
public void setScore(double s)
public int size()
public Motif[] toArray()
public java.lang.String toString()
getSequence()
.toString
in class java.lang.Object
public MotifList unionWith(MotifList m)
public Motif uniteMotifs()
Motif.unionWith(Motif)
to merge the first motif with the second, then merge the result with the third, and so on. N's are
stripped off the final result. Note that the result returned is dependent on the order of the motifs in the list, in the same way that
Motif.unionWith(Motif) is dependent on order.public Motif uniteMotifs(boolean strip)
Motif.unionWith(Motif)
to merge
the first motif with the second, then merge the result with the third, and so on. N's are stripped off the final result. Note that the
result returned is dependent on the order of the motifs in the list, in the same way that Motif.unionWith(Motif) is dependent on order.strip
- If true, leading and trailing Ns will be stripped.