Package sequence
Class MemorySequence
- java.lang.Object
-
- sequence.MemorySequence
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildIndex(long k)Builds the index based on the length of the k-mer.static MemorySequencefromString(String sequence)Constructs a new MemorySequence from the input sequence string that contains A, G, T, and C.BasegetBase(long position)List<Long>getMatchingPositions(Sequence kmer)Gets positions of the sequence that matches with k-mer.longgetSize()static MemorySequencerandom(int k)Generates a random MemorySequence of length k.
-
-
-
Method Detail
-
fromString
public static MemorySequence fromString(String sequence)
Constructs a new MemorySequence from the input sequence string that contains A, G, T, and C. Note that there should be no white space between any of the bases.- Parameters:
sequence- input sequence- Returns:
- new MemorySequence
-
random
public static MemorySequence random(int k)
Generates a random MemorySequence of length k.- Parameters:
k- length of the MemorySequence- Returns:
- new MemorySequence
-
buildIndex
public void buildIndex(long k)
Description copied from interface:SequenceBuilds the index based on the length of the k-mer.- Specified by:
buildIndexin interfaceSequence- Parameters:
k- length of the k-mer
-
getMatchingPositions
public List<Long> getMatchingPositions(Sequence kmer) throws Exception
Description copied from interface:SequenceGets positions of the sequence that matches with k-mer. If an index has been built, then this method tries to use that index to perform faster look-up.- Specified by:
getMatchingPositionsin interfaceSequence- Parameters:
kmer- sub-sequence to search for- Returns:
- list of matching starting positions in this sequence
- Throws:
Exception- throws exception
-
getSize
public long getSize()
-
-