|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojava.bio.program.abi.ABIFParser
A general base parser for files produced by ABI software. This includes chromatograms derived from ABI sequencers and potentially other data files as well. The format was described by Clark Tibbetts in his paper "Raw Data File Formats, and the Digital and Analog Raw Data Streams of the ABI PRISM 377 DNA Sequencer." Available online http://www-2.cs.cmu.edu/afs/cs/project/genome/WWW/Papers/clark.html
Briefly, the format consists of a set of named fixed-length "tagged data
records" which may contain data themselves, or pointers to data elsewhere
in the file. This class reads these records and exposes them to subclasses
through the getDataRecord(java.lang.String, int)
method. The attributes of the records as
described in Tibbets' paper are exposed through public (final) fields of
ABIFParser.TaggedDataRecord
instances.
If a record only contains a pointer to the desired data, subclasses may get at the raw data by:
ABIFParser.DataAccess
object by calling
{#link getDataAccess}Seekable.seek(long)
)DataInput
methods to read bytes, ints,
etc.This parser provides methods and classes for dealing with the files as streams or local files (local files being more memory-efficient).
Nested Class Summary | |
static interface |
ABIFParser.DataAccess
Concatenation of the Seekable and DataInput interfaces. |
static class |
ABIFParser.TaggedDataRecord
An aggregate immutable type for an ABIF tagged data record. |
Constructor Summary | |
ABIFParser(ABIFParser.DataAccess toParse)
Creates a new ABIFParser for the specified ABIFParser.DataAccess object. |
|
ABIFParser(java.io.File f)
Creates a new ABIFParser for a file. |
|
ABIFParser(java.io.InputStream in)
Creates a new ABIFParser for an input stream. |
Method Summary | |
static Symbol |
decodeDNAToken(char token)
Decodes a character into a Symbol in the DNA alphabet. |
ABIFParser.DataAccess |
getDataAccess()
Returns the accessor for the raw data being parsed by this parser. |
ABIFParser.TaggedDataRecord |
getDataRecord(java.lang.String tagName,
int tagNumber)
Get the entry from the file TOC with the given name and tag number. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ABIFParser(java.io.File f) throws java.io.IOException
public ABIFParser(java.io.InputStream in) throws java.io.IOException
CachingInputStream
if it isn't one already.
If it is, it will be seeked to 0.
public ABIFParser(ABIFParser.DataAccess toParse) throws java.io.IOException
ABIFParser.DataAccess
object.
If you need to read from something other than a file or a stream, you'll
have to implement a ABIFParser.DataAccess
-implementing class wrapping your
source and then pass an instance to this constructor.
Method Detail |
public final ABIFParser.DataAccess getDataAccess()
public static Symbol decodeDNAToken(char token) throws IllegalSymbolException
Symbol
in the DNA alphabet.
Uses a definition of characters that is compatible with the ABI format.
token
- the character to decode
IllegalSymbolException
- when token isn't in
{ a, A, c, C, g, G, t, T, n, N, - }
public ABIFParser.TaggedDataRecord getDataRecord(java.lang.String tagName, int tagNumber) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
tagName
- the four-character string name of the desired data recordtagNumber
- which one of the tags with this name to return (must be positive)
java.lang.IllegalArgumentException
- if tagName is the wrong length or tagNumber
is 0 or negative
java.lang.IllegalStateException
- if the initial parsing is not complete
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |