public class FastaReader extends java.lang.Object implements java.util.Iterator<FastaSequence>
>zedpshvyzg GCQDKNNIAELNEIMGTTRSPSDWQHMKGASPRAEIGLTGKKDSWWRHCCSKEFNKTPPPIHPDMKRWGWMWNRENFEKFLIDNFLNPPCPRLMLTKGTWWRHEDLCHEIFWSTLRWLCLGNQSFSAMIWGHLCECHRMIWWESNEHMFWLKFRRALKKMNSNGPCMGPDNREWMITNRMGKEFCGPAFAGDCQSCWRKCHKTNKICFNEKKGTPTKIDHEQKDIMDILKDIDNHRNWKQCQLWLLTSKSTDQESTTMLTWSTWRDFFIIIKQPFDHKCRGALDANGDFQIAAELKWPAPMIILRQNQKTMHDKSCHHFFTNRCPLMHTTRANDKQCSWHTRKQFICQQDFTTWQHRPDTHRILPSWCMSTRRKNHIKNTPALAFSTCEMGDLPNGWAPGTIILQRQFTQAIKLPQETTGWPRCDPKFDHWNMSKWLRQLLGRDDEMIPPQCD >xovkactesa CPLSKWWNRRAFLSHTANHWMILMTWEGPHDGESKMRIAMMKWSPCKPTMSHFRCGLDAWAEPIRQIACESTFRM FCTTPRPIHKLTEMWGHMNGWTGAFCRQLECEWMMPPRHPHPCTSTFNNNKKRLIGQIPNEGKQLFINFQKPQHG FSESDIWIWKDNPTAWHEGLTIAGIGDGQHCWNWMPMPWSGAPTSNALIEFWTWLGMIGTRCKTQGMWWDAMNHH DQFELSANAHIAAHHMEKKMILKPDDRNLGDDTWMPPGKIWMRMFAKNTNACWPEGCRDDNEEDDCGTHNLHRMC >ntazzewyvv CGCKIF D D NMKDNNRHG TDIKKHGFMH IRHPE KRDDC FDNHCIMPKHRRWGLWD EASINM AQQWRSLPPSRIMKLNG HGCDCMHSHMEAD DTKQSGIKGTFWNG HDAQWLCRWG EFITEA WWGRWGAITFFHAH ENKNEIQECSDQNLKE SRTTCEIID TCHLFTRHLDGW RCEKCQANATHMTW ACTKSCAEQW FCAKELMMN W KQMGWRCKIFRKLFRDNCWID FELPWWPICFCCKGLSTKSHSAHDGDQCRRW WPDCARDWLGPGIRGEF FCTHICQQLQRNFWCGCFRWNIEKRMFEIFDDNMAAHWKKCMHFKFLIRIHRHGPITMKMTWCRSGCCFGKTRRLPDSSFISAFLDPKHHRDGSGMMMWSSEMRSCAIPDPQQAWNQGKWIGQIKDWNICFAWPIRENQQCWATPHEMPSGFHFILEKWDALAHPHMHIRQKKCWAWAFLSLMSSTHSDMATFQWAIPGHNIWSNWDNIICGWPRI > 12 d t y wi k jbke KLSHHDCD N H HSKCTEPHCGNSHQMLHRDP CCDQCQSWEAENWCASMRKAILF
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
DELIM
Delimiter for the scanner
|
private java.util.Scanner |
input |
Constructor and Description |
---|
FastaReader(java.io.InputStream inputStream)
This class will not close the incoming stream! So the client should do
so.
|
FastaReader(java.lang.String inputFile)
Header data can contain non-ASCII symbols and read in UTF8
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Call this method to close the connection to the input file if you want to
free up the resources.
|
boolean |
hasNext() |
FastaSequence |
next()
Reads the next FastaSequence from the input
|
void |
remove()
Not implemented
|
private static FastaSequence |
toFastaSequence(java.lang.String singleFastaEntry) |
private final java.util.Scanner input
private final java.lang.String DELIM
public FastaReader(java.lang.String inputFile) throws java.io.FileNotFoundException
inputFile
- the file containing the list of FASTA formatted sequences to
read fromjava.io.FileNotFoundException
- if the input file is not foundjava.lang.IllegalStateException
- if the close method was called on this instancepublic FastaReader(java.io.InputStream inputStream) throws java.io.FileNotFoundException
inputStream
- java.io.FileNotFoundException
public boolean hasNext()
hasNext
in interface java.util.Iterator<FastaSequence>
java.lang.IllegalStateException
- if the close method was called on this instancepublic FastaSequence next()
next
in interface java.util.Iterator<FastaSequence>
java.lang.AssertionError
- if the header or the sequence is missingjava.lang.IllegalStateException
- if the close method was called on this instanceMismatchException
- - if there were no more FastaSequence's.public void remove()
remove
in interface java.util.Iterator<FastaSequence>
public void close()
private static FastaSequence toFastaSequence(java.lang.String singleFastaEntry)