|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javagene.io.Fasta
public class Fasta
Read and write sequences as Fasta files. A Fasta file has a single header line of the following format:
>id descriptionwhere the > symbol is required, the id is a single word, and the description can be many words, extending to the end of line. The proper interpretation of the id and description fields is not fixed. Data lines immediately follow the header line. Multiple sequences in a single file are separated from one another by a blank line.
Method Summary | |
---|---|
static SeqI |
read(java.lang.String filename,
int bufferSize)
Read a file containing a single sequence. |
static SeqBig |
readBig(java.lang.String filename)
Read a Fasta file containing a single sequence into a SeqBig object. |
static java.util.ArrayList<SeqI> |
readMany(java.lang.String filename,
int bufferSize)
Read a file containing (possibly) multiple sequences. |
static void |
write(java.util.ArrayList<SeqI> sequences,
java.lang.String filename)
Write an ArrayList of sequences to file. |
static void |
write(SeqI sequence,
java.lang.String filename)
Write a sequence to file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static SeqI read(java.lang.String filename, int bufferSize) throws java.io.IOException
filename
- The path to the file.bufferSize
- An estimate of the size of the sequence (hint: unless
you're short on RAM, generously round up. )
java.io.IOException
- Something went wrong -- check exception detail message.public static SeqBig readBig(java.lang.String filename) throws java.io.IOException
filename
- The path to the file.
java.io.IOException
- Something went wrong -- check exception detail message.public static java.util.ArrayList<SeqI> readMany(java.lang.String filename, int bufferSize) throws java.io.IOException
filename
- The path to the file.bufferSize
- An estimate of the size of the largest sequence (hint: unless
you're short on RAM, generously round up. )
java.io.IOException
- Something went wrong -- check exception detail message.public static void write(java.util.ArrayList<SeqI> sequences, java.lang.String filename) throws java.io.IOException
sequences
- The ArrayList of SeqI sequences.filename
- The path to the file.
java.io.IOException
- Something went wrong -- check exception detail message.public static void write(SeqI sequence, java.lang.String filename) throws java.io.IOException
sequence
- The SeqI object to write.filename
- The path to the file.
java.io.IOException
- Something went wrong -- check exception detail message.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |