|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjbil.sequence.Trie
jbil.sequence.FactorTrie
public class FactorTrie
A factor trie is a trie representing all factors of a given length of a set of sequences.
Constructor Summary | |
---|---|
FactorTrie(Alphabet alphabet,
int factorLength)
Creates an empty factor trie. |
|
FactorTrie(Sequence baseSequence,
int factorLength)
Creates a factor trie representing the factors of a given sequence. |
Method Summary | |
---|---|
void |
addBaseSequence(Sequence baseSequence)
Adds a base sequence to the factor trie, i.e., add all factors of the adequate size of this sequence to the trie. |
Pair<java.lang.Integer,java.lang.Integer> |
countOccurrences(Sequence pattern,
int beginIndex,
int endIndex,
int offset)
Counts the number of occurrences of the patterns pattern[beginIndex..endIndex-2] and pattern[beginIndex..endIndex-1] respectively, as prefixes of the words represented by the subtries rooted at nodes at a given height. |
void |
removeBaseSequence(Sequence baseSequence)
Removes one occurrence of a base sequence from the factor trie, that is, removes one occurrence of each factor of the appropriate length of this base sequence from the factor trie. |
Methods inherited from class jbil.sequence.Trie |
---|
addSequence, addSequence, countOccurrences, deleteSequence, deleteSequence, getAlphabet, getHeight, getSequenceList, print, reset, sequenceCount |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FactorTrie(Alphabet alphabet, int factorLength)
alphabet
- The base alphabet.factorLength
- The length of the represented factors.public FactorTrie(Sequence baseSequence, int factorLength)
baseSequence
- The base sequence whose factors are to be represented.factorLength
- The length of the represented factors.Method Detail |
---|
public void addBaseSequence(Sequence baseSequence)
baseSequence
- The new base sequence.public void removeBaseSequence(Sequence baseSequence)
baseSequence
- The base sequence whose factors are to be removed.public Pair<java.lang.Integer,java.lang.Integer> countOccurrences(Sequence pattern, int beginIndex, int endIndex, int offset)
Trie
countOccurrences
in interface KMerCounter
countOccurrences
in class Trie
pattern
- The base pattern.beginIndex
- The start position of the subpattern to be counted.endIndex
- The end position (not inclusive) of the subpattern to be counted.offset
- The height of the nodes at which the search must begin.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |