|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface MotifSearcher
This interface should be implemented by classes that wants to define
methods for searching motifs. If possible, classes should extend the
MotifSearchAdapter-class, where all methods except the
search(int, int)-method are implemented.
MotifSearchAdapter| Field Summary | |
|---|---|
static int |
SEARCH_ALL_ORIENTATIONS
This flag is used when the motif is to search or when the motif was found. |
static int |
SEARCH_DIRECTION_MAX
Gives the highest free power of two. |
static int |
SEARCH_DIRECTION_MINUS
This flag is used when the motif is to search or when the motif was found. |
static int |
SEARCH_DIRECTION_PLUS
This flag is used when the motif is to search or when the motif was found. |
| Method Summary | |
|---|---|
int |
getSearchMode()
The returned bit field holds a set bit if the appropriate search mode is used or a zero otherwise. |
int |
initSearch(java.lang.CharSequence sequence)
Inits the search by saving a reference on the search sequence. |
FoundMotifStruct |
search(int seqStart,
int seqWidth)
Runs through the sequence already given in the initialization method initSearch and matches the motif on this
CharSequence with respect to the search mode and the
search window determined by the two parameters seqStart
and seqWidth. |
java.util.LinkedList |
searchAll(int seqStart,
int seqWidth)
Runs through the sequence already given in the initialization method initSearch and matches the motif on that
CharSequence with respect to the search mode and the
sequence window. |
void |
setSearchMode(int searchMode)
Sets the mode how a motif is searched. |
| Field Detail |
|---|
static final int SEARCH_DIRECTION_PLUS
setSearchMode(int),
getSearchMode(),
Constant Field Valuesstatic final int SEARCH_DIRECTION_MINUS
setSearchMode(int),
getSearchMode(),
Constant Field Valuesstatic final int SEARCH_ALL_ORIENTATIONS
SEARCH_DIRECTION_MINUS and
SEARCH_DIRECTION_PLUS.
setSearchMode(int),
getSearchMode(),
SEARCH_DIRECTION_MINUS,
SEARCH_DIRECTION_PLUS,
Constant Field Valuesstatic final int SEARCH_DIRECTION_MAX
| Method Detail |
|---|
int initSearch(java.lang.CharSequence sequence)
null and the
search window, which is set to the maximum width.
sequence - the sequence for all search methods to search on.
search(int, int),
searchAll(int, int)
FoundMotifStruct search(int seqStart,
int seqWidth)
throws MissingCharSequenceException,
MissingMotifException
initSearch and matches the motif on this
CharSequence with respect to the search mode and the
search window determined by the two parameters seqStart
and seqWidth.
FoundMotifStruct with positions absolute to the
sequence window. Note, that this method verifies no previous
searches, instead it searches always new. If the motif was not
found, null is returned.
id of the returned struct is misused as a flag
determining the search direction (search mode) the found motif was
(any combination of SEARCH_DIRECTION_PLUS and
SEARCH_DIRECTION_MINUS). Note, that it is possible,
that a motif can occur more than once at the same position, e.g. the
regular expression motif CNGCCATNDNND and its reversed complemented
part HNNHNATGGCTG can both be matched on the sequence CGGCCATGGCTG.
In case both search direction occur, the motif start and end position
is always for plus direction. For a reversed complemented motif
end is less than start.
null is returned.
seqStart - Search starts with this index.seqWidth - The width of the subsequence to search on.
null if the motif could not be found on the sequence.
MissingCharSequenceException - If no sequence to search on was
set.
MissingMotifException - If no motif to search for was set.initSearch(CharSequence),
SEARCH_DIRECTION_PLUS,
SEARCH_DIRECTION_MINUS
java.util.LinkedList searchAll(int seqStart,
int seqWidth)
throws MissingCharSequenceException,
MissingMotifException
initSearch and matches the motif on that
CharSequence with respect to the search mode and the
sequence window.
A LinkedList of all occurances found is generated and returned.
That list is ordered. Every element in that list is of
FoundMotifStruct
seqStart - Search starts with this index.seqWidth - The width of the subsequence to search on.
FoundMotifStruct's of
all positions in the sequence' window, where the motif matches. If
the motif is a MultiMotif there is one struct per whole
match with the starting positions of all single motifs. The list is
empty, if no match was found.
MissingCharSequenceException - If no sequence to search on was
set previously.
MissingMotifException - If no motif to search for is set.initSearch(CharSequence),
search(int, int)
void setSearchMode(int searchMode)
throws java.lang.IllegalArgumentException
SEARCH_DIRECTION_PLUS, SEARCH_DIRECTION_MINUS
or SEARCH_ALL_ORIENTATIONS as parameters.
searchMode - The search mode.
java.lang.IllegalArgumentException - If searchMode is
unknown.SEARCH_DIRECTION_PLUS,
SEARCH_DIRECTION_MINUS,
SEARCH_ALL_ORIENTATIONSint getSearchMode()
SEARCH_DIRECTION_PLUS
, SEARCH_DIRECTION_MINUS, or
SEARCH_ALL_ORIENTATIONS. Use the IOTools.test(int,int)
to test for various bits.
setSearchMode(int),
SEARCH_DIRECTION_PLUS,
SEARCH_DIRECTION_MINUS,
SEARCH_ALL_ORIENTATIONS,
IOTools.test(int, int)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||