|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.unc.csbio.util.BigFaReader
public class BigFaReader
this class is for reading data from a fasta file, and reading/generating an index file
Field Summary | |
---|---|
private static java.lang.String |
dataFile
name of fasta file |
private static java.lang.String |
ENDOFLINE
end of line character |
private static int |
EXTRA
length end of line character |
private static java.io.FileInputStream |
fis
obtains input bytes from given fasta in a file system |
private java.lang.String |
indexFile
name of index file |
private static java.util.TreeMap<java.lang.String,java.lang.String[]> |
indexMap
this maps a chromosome name to its starting offset and line length |
Constructor Summary | |
---|---|
BigFaReader(java.lang.String _dataFile)
This is the constructor of object BigFaReader . |
Method Summary | |
---|---|
private static void |
buildIndex(java.lang.String dataFile)
This method will generate an index file from dataFile . |
static java.lang.String |
getData(java.lang.String chr,
int start,
int end)
this method is for getting data given start and end position in one chromosome |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String ENDOFLINE
private static int EXTRA
private static java.lang.String dataFile
private java.lang.String indexFile
private static java.io.FileInputStream fis
fasta
in a file system
private static java.util.TreeMap<java.lang.String,java.lang.String[]> indexMap
Constructor Detail |
---|
public BigFaReader(java.lang.String _dataFile) throws java.io.IOException
BigFaReader
. It will
access given fasta file. If there is a corresponding index file, it will
read index data from the file; else, it will generate an index file.
_dataFile
- name of fasta file
java.io.IOException
- if an input or output exception occurredMethod Detail |
---|
private static void buildIndex(java.lang.String dataFile)
dataFile
. For
every chromomsome in the dataFile
, the method will append
chromomsome's size, starting offset, line length and line length
including the new line character.
dataFile
- fasta filepublic static java.lang.String getData(java.lang.String chr, int start, int end) throws java.io.IOException
chr
- chromosome IDstart
- start postionend
- end position
java.io.IOException
- if an input or output exception occurred
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |