|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.unibi.techfak.jpredictor.motifs.MotifSearchAdapter
de.unibi.techfak.jpredictor.motifs.Motif
public abstract class Motif
Abstract superclass of all classes representing a motif. A motif is defined as a (short) nucleotide or amino-acid sequence pattern that is widespread and has, or is conjectured to have, a biological significance (WikiPedia). The single nucleotides or amino-acids are either represented by characters or by probabilities.
Subclasses must provide the methods print,
createReversedComplement and clone.
Furthermore, the class implements the interface Comparable
and thus subclasses must override compareTo. The method
equals returns true, if compareTo
returns zero. Thus, the natural ordering is consistent with equals.
It is stronly recommended for subclasses to override the methods
getConsensusSequence and getRegularExpression
as well, as they will return null on any call.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class de.unibi.techfak.jpredictor.motifs.MotifSearchAdapter |
|---|
MotifSearchAdapter.SearchFields |
| Field Summary | |
|---|---|
private java.lang.String |
description
The motif's description |
(package private) static java.lang.String |
DNA_DEGENERATED_CODE
The degenerated code of DNA, expressed as a string for fast access while matching. |
(package private) static char[] |
DNA_DEGENERATED_CODE_JOINING
The degenerated code of DNA, expressed are the resulting Regular Expressions when joining two chars. |
private int |
mark
The mark variable containing the markers set. |
static int |
MARK_USABLE
This mark means, that the corresponding motif, marked so, can be used for all operations like weighting or scoring. |
private java.lang.String |
name
Name of the motif |
private double |
weight
The weight of a motif. |
| Fields inherited from class de.unibi.techfak.jpredictor.motifs.MotifSearchAdapter |
|---|
searchFields |
| Fields inherited from interface de.unibi.techfak.jpredictor.motifs.MotifSearcher |
|---|
SEARCH_ALL_ORIENTATIONS, SEARCH_DIRECTION_MAX, SEARCH_DIRECTION_MINUS, SEARCH_DIRECTION_PLUS |
| Fields inherited from interface de.unibi.techfak.misc.Markable |
|---|
MARK_BASIC, MARK_DELETED, MARK_EXP, MARK_MOVED, MARK_REPLACED, MARK_SELECTED, MARK_TOBEDELETED, MARK_TOBEMOVED, MARK_TOBEREPLACED |
| Constructor Summary | |
|---|---|
protected |
Motif(java.lang.String motifName,
java.lang.String description)
Constructs a motif by setting a name and a description. |
| Method Summary | |
|---|---|
void |
clearMark()
The mark of the object is cleared, thus it is not marked anymore. |
void |
clearMark(int mark)
Clears a special mark. |
abstract java.lang.Object |
clone()
Clones the motif by creating the same motif again and copying all importent fields. |
abstract int |
compareTo(java.lang.Object o)
Compares this motif with the specified object. |
abstract Motif |
createReversedComplement()
Creates the reversed complementary motif. |
boolean |
equals(java.lang.Object o)
Indicates whether some other motif is equal to this one. |
java.lang.String |
getConsensusSequence()
Creates or calculates the consensus sequence from the motif, which is returned. |
java.lang.String |
getDescription()
|
int |
getMark()
Gets the complete mark for the object. |
java.lang.String |
getName()
|
java.lang.String |
getRegularExpression()
Represents the motif as a regular expression. |
double |
getWeight()
Gets the previously set weight or Double.NaN. |
boolean |
isMarked()
Tests, whether any mark is set. |
boolean |
isMarked(int mark)
Tests a special mark, whether it is set. |
void |
print()
Prints the motif to System.out |
abstract void |
print(java.io.PrintStream out)
Prints the motif to the given stream, e.g. |
double |
scoreSequenceWindow(int seqStart,
int seqLength)
Scores a sequence window. |
void |
setDescription(java.lang.String description)
Sets the description of the motif |
void |
setMark(int mark)
Sets a mark for the object. |
void |
setName(java.lang.String name)
Sets the name of the motif |
void |
setWeight(double weight)
Sets the weight for the motif. |
java.lang.String |
toString()
|
| Methods inherited from class de.unibi.techfak.jpredictor.motifs.MotifSearchAdapter |
|---|
getSearchMode, initSearch, length, searchAll, setSearchMode |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface de.unibi.techfak.jpredictor.motifs.MotifSearcher |
|---|
getSearchMode, initSearch, search, searchAll, setSearchMode |
| Field Detail |
|---|
public static final int MARK_USABLE
static final java.lang.String DNA_DEGENERATED_CODE
RegularExpressionMotif.match(char, char),
Constant Field Valuesstatic final char[] DNA_DEGENERATED_CODE_JOINING
RegularExpressionMotif.getRegularExpressionChar(char, char)private java.lang.String name
private java.lang.String description
private double weight
Double.NaN stands for default and to
show, that no score is present.
private int mark
| Constructor Detail |
|---|
protected Motif(java.lang.String motifName,
java.lang.String description)
motifName - The motifs name (identifier).description - A short description of the motif.MotifSearcher.SEARCH_ALL_ORIENTATIONS,
MARK_USABLE| Method Detail |
|---|
public final java.lang.String getName()
public final void setName(java.lang.String name)
name - The new name of the motif.public final java.lang.String getDescription()
public final void setDescription(java.lang.String description)
description - The new description.public java.lang.String getConsensusSequence()
null in case no
motif presentpublic java.lang.String getRegularExpression()
getConsensusSequence().
null
in case of no motif presentpublic abstract Motif createReversedComplement()
public abstract void print(java.io.PrintStream out)
Motif.print(
new PrintStream( new FileOutputStream ( name )))
out - The stream to print the motif to.public void print()
System.out.
public java.lang.String toString()
toString in class java.lang.Objectpublic double getWeight()
SequenceWindowScorerDouble.NaN.
getWeight in interface SequenceWindowScorerDouble.NaN, if
the weight was not set yet.public void setWeight(double weight)
SequenceWindowScorer
setWeight in interface SequenceWindowScorerweight - The new weight to set.
public double scoreSequenceWindow(int seqStart,
int seqLength)
SequenceWindowScorer
scoreSequenceWindow in interface SequenceWindowScorerseqStart - The start point on the CharSequence.seqLength - The length of the window on the CharSequence.
Double.NaN
in case of error or if the score was not yet set.MotifSearcher.search(int, int),
MotifSearcher.searchAll(int, int)public abstract java.lang.Object clone()
Clones the motif by creating the same motif again and copying all
importent fields. The result is at least of class Motif.
When cloning a MultiMotif the referred single motifs
are not cloned.
The fields that are copied are: Name, Description, the Motif itself,
errorNumberAllowedForMatch or Threshold, respectively, Weight and
searchMode (altogether 6 fields by now). What is not copied are the
fields of the MotifSearchAdapter.
Note, that any matrices are not cloned. Thus, if cloning a
PSPMotif or a PSSMotif the cloned motif does
contain a reference to the matrix of the old motif. This was done
to preserve memory.
clone in class java.lang.ObjectObject.clone()public void setMark(int mark)
Markable
setMark in interface Markablemark - The mark to set.public int getMark()
Markable
getMark in interface Markablepublic void clearMark(int mark)
Markable
clearMark in interface Markablemark - The mark to be deleted.public void clearMark()
MarkableisMarked() and
isMarked(int) should return false.
clearMark in interface MarkableMarkable.isMarked(),
Markable.isMarked(int)public boolean isMarked()
Markable
isMarked in interface Markabletrue iff a mark is set, false
otherwise.public boolean isMarked(int mark)
Markable
isMarked in interface Markablemark - The mark to be tested.
true iff the mark is set, false
otherwise.public abstract int compareTo(java.lang.Object o)
Compares this motif with the specified object. The Object
given must be a Motif and must not be null,
otherwise a ClassCastException is thrown. If for this
motif or the given one, the motif representation was not set, a
ClassCastException is thrown as well.
Two motifs are compared for their representations, both plus and
minus depending on the search direction. Both motifs must be of the
same type, otherwise the following relation is considered:
SequenceMotif < PSPMotif < MultiMotif and returned
without further investigations. Note, that RegularExpressionMotif
s count as SequenceMotifs and that PSSMotif
s count as PSPMotifs. In case of comparing two
MultiMotifs, after comparing the comprised single motifs
the distance informations are taken into account: first minimum vs.
first minimum, then first maximum, second minimum, and so on. In the
last instance two sequence motifs are compared for their error number
allowed for match, whereas two position specific matrix motifs are
compared for their threshold.
More formaly, this motif is less than the specified one if this reg-exp string is less than the one from the specified motif.
compareTo in interface java.lang.Comparableo - The motif this method is compared to.
java.lang.ClassCastException - If the specified object is not a
Motif or nullpublic boolean equals(java.lang.Object o)
compareTo(Object) and
true is returned only iff compareTo
yielded a zero.
equals in class java.lang.Objecto - The motif this method is compared to.
true, iff this object equals the given one,
false otherwise.compareTo(Object)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||