public class RandomAccessSequenceCache extends Object implements RandomAccessSequenceInterface
| Constructor and Description |
|---|
RandomAccessSequenceCache() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canLoad(String basename) |
char |
get(int referenceIndex,
int position)
Return the base in the specified reference at the given position.
|
char |
get(String referenceName,
int position) |
String |
getBasename() |
int |
getLength(int targetIndex)
Returns the length of the target sequence at index targetIndex.
|
void |
getRange(int referenceIndex,
int position,
int length,
it.unimi.dsi.lang.MutableString bases)
Return bases from a range of positions in the cache.
|
int |
getRange(int referenceIndex,
int position,
int length,
String referenceName) |
int |
getRange(String referenceName,
int position,
int length) |
int |
getReferenceIndex(String referenceName)
Return the index of the reference sequence identified by name, or -1 if the sequence name
is not in the cache.
|
String |
getReferenceName(int index)
Return the reference name corresponding to this index.
|
int |
getSequenceSize(int referenceIndex) |
void |
load(String basename) |
void |
load(String basename,
String minRefId,
String maxRefId)
Load a slice of this genome, contained between minReferenceId position 0 and max referenceId position 0.
|
void |
loadCompact(InputStream compactInput)
Load a fasta file into this cache.
|
void |
loadFasta(Reader reader)
Load a fasta file into this cache.
|
static void |
main(String[] args) |
int |
numberOfSequences() |
void |
save(String basename) |
void |
setBasename(String basename) |
int |
size()
Return the number of sequences in the cache.
|
public void loadFasta(Reader reader) throws IOException
reader - IOExceptionpublic void loadCompact(InputStream compactInput) throws IOException
compactInput - inputstream for a compact reads file.IOExceptionpublic void save(String basename) throws IOException
IOExceptionpublic void load(String basename) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionpublic void load(String basename, String minRefId, String maxRefId) throws IOException, ClassNotFoundException
basename - minRefId - maxRefId - IOExceptionClassNotFoundExceptionpublic boolean canLoad(String basename)
public final char get(String referenceName, int position)
public final int getRange(String referenceName, int position, int length)
public void getRange(int referenceIndex,
int position,
int length,
it.unimi.dsi.lang.MutableString bases)
RandomAccessSequenceInterfacegetRange in interface RandomAccessSequenceInterfacereferenceIndex - Name of the reference sequenceposition - position where the range startslength - length of the range for which bases should be returned.bases - where the bases will be written.public int getRange(int referenceIndex,
int position,
int length,
String referenceName)
public final int getReferenceIndex(String referenceName)
getReferenceIndex in interface RandomAccessSequenceInterfacereferenceName - The name of the sequence to get the index forpublic final String getReferenceName(int index)
getReferenceName in interface RandomAccessSequenceInterfaceindex - for the specified referencepublic int size()
RandomAccessSequenceInterfacesize in interface RandomAccessSequenceInterfacepublic final char get(int referenceIndex,
int position)
RandomAccessSequenceInterfaceget in interface RandomAccessSequenceInterfacereferenceIndex - index of the reference sequence.position - zero-based position in the reference for which the base is sought.public int getLength(int targetIndex)
RandomAccessSequenceInterfacegetLength in interface RandomAccessSequenceInterfacetargetIndex - Index of the target sequence.public static void main(String[] args) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionpublic int numberOfSequences()
public int getSequenceSize(int referenceIndex)
public String getBasename()
public void setBasename(String basename)
Copyright © 2018 Campagne Laboratory. All rights reserved.