Package sequence
Class DiskSequence
- java.lang.Object
-
- sequence.DiskSequence
-
-
Constructor Summary
Constructors Constructor Description DiskSequence(File file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildIndex(long k)Builds the index based on the length of the k-mer.voidclearTable(int k)Clears table corresponding to the length of the k-mer.voidclose()BasegetBase(long position)List<Long>getMatchingPositions(Sequence kmer)Gets positions of the sequence that matches with k-mer.longgetSize()StringtoString()
-
-
-
Constructor Detail
-
DiskSequence
public DiskSequence(File file) throws FileNotFoundException, SQLException, ClassNotFoundException
-
-
Method Detail
-
buildIndex
public void buildIndex(long k) throws ExceptionDescription 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- Throws:
Exception- throws exception when errors occur on database end
-
clearTable
public void clearTable(int k) throws ExceptionClears table corresponding to the length of the k-mer.- Parameters:
k- length of the k-mer- Throws:
Exception- when there is no such table exists
-
getSize
public long getSize()
-
getBase
public Base getBase(long position)
-
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
-
-