org.biojava3.core.sequence.location
Class InsdcParser

java.lang.Object
  extended by org.biojava3.core.sequence.location.InsdcParser

public class InsdcParser
extends Object

Parser for working with INSDC style locations. This class supports the full range of location types generated by Genbank, INSDC and ENA.

Author:
ayates

Constructor Summary
InsdcParser()
           
InsdcParser(DataSource dataSource)
           
 
Method Summary
protected  Point generatePoint(String locationString, String uncertainString)
           
protected  AccessionID getAccession(String accession)
           
 DataSource getDataSource()
           
 Location parse(Reader reader)
          Reader based version of the parse methods.
protected  List<Location> parse(Reader reader, Strand strand)
           
 Location parse(String locationString)
          Main method for parsing a location from a String instance
protected  Location parseLocation(String location, Strand strand)
           
protected  Location parseRange(Matcher matcher, Strand strand)
           
protected  Location parseSingle(Matcher matcher, Strand strand)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InsdcParser

public InsdcParser()

InsdcParser

public InsdcParser(DataSource dataSource)
Method Detail

getDataSource

public DataSource getDataSource()

parse

public Location parse(String locationString)
               throws ParserException
Main method for parsing a location from a String instance

Parameters:
locationString - Represents a logical location
Returns:
The parsed location
Throws:
ParserException - thrown in the event of any error during parsing

parse

public Location parse(Reader reader)
               throws IOException,
                      ParserException
Reader based version of the parse methods.

Parameters:
reader - The source of the data; assumes that end of the reader stream is the end of the location string to parse
Returns:
The parsed location
Throws:
IOException - Thrown with any reader error
ParserException - Thrown with any error with parsing locations

parse

protected List<Location> parse(Reader reader,
                               Strand strand)
                        throws IOException,
                               ParserException
Throws:
IOException
ParserException

parseLocation

protected Location parseLocation(String location,
                                 Strand strand)

parseSingle

protected Location parseSingle(Matcher matcher,
                               Strand strand)

parseRange

protected Location parseRange(Matcher matcher,
                              Strand strand)

generatePoint

protected Point generatePoint(String locationString,
                              String uncertainString)

getAccession

protected AccessionID getAccession(String accession)