Class InsdcParser<S extends AbstractSequence<C>,​C extends Compound>


  • public class InsdcParser<S extends AbstractSequence<C>,​C extends Compound>
    extends java.lang.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, jgrzebyta, Paolo Pavan
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.Integer featureGlobalEnd
      these variables are used to compute the global start and end of complex features
      protected java.lang.Integer featureGlobalStart
      these variables are used to compute the global start and end of complex features
      protected static java.util.regex.Pattern genbankSplitPattern
      Decodes a split pattern.
      protected static java.lang.String locationSplitPattern
      designed to recursively split a location string in tokens.
      protected static java.util.regex.Pattern singleLocationPattern
      parse a location.
    • Field Detail

      • singleLocationPattern

        protected static final java.util.regex.Pattern singleLocationPattern
        parse a location. if group(1) is null than the feature is on the positive strand, group(2) start position, group(3) end position.
      • genbankSplitPattern

        protected static final java.util.regex.Pattern genbankSplitPattern
        Decodes a split pattern. Split patterns are a composition of multiple locationsString qualified by actions: join(location,location, ... location): The indicated elements should be joined (placed end-to-end) to form one contiguous sequence. order(location,location, ... location): The elements can be found in the specified order (5' to 3' direction), nothing is implied about their reasonableness bond(location,location...location): Found in protein files. These generally are used to describe disulfide bonds. complement(location,location...location): consider locations in their complement versus takes in input a comma splitted location string. The split must be done for outer level commas group(1) is the qualifier group(2) is the location string to getFeatures. In case of complex splits it will contain the nested expression Not really sure that they are not declared obsolete but they are still in several files.
      • locationSplitPattern

        protected static final java.lang.String locationSplitPattern
        designed to recursively split a location string in tokens. Valid tokens are those divided by coma that are not inside a bracket. I. e. split on the comma only if that comma has zero, or an even number of quotes ahead of it.
        See Also:
        Constant Field Values
      • featureGlobalStart

        protected java.lang.Integer featureGlobalStart
        these variables are used to compute the global start and end of complex features
      • featureGlobalEnd

        protected java.lang.Integer featureGlobalEnd
        these variables are used to compute the global start and end of complex features
    • Constructor Detail

      • InsdcParser

        public InsdcParser()
      • InsdcParser

        public InsdcParser​(DataSource dataSource)
    • Method Detail

      • setComplexFeaturesAppendMode

        public void setComplexFeaturesAppendMode​(org.biojava.nbio.core.sequence.location.InsdcParser.complexFeaturesAppendEnum complexFeaturesAppendMode)
      • getDataSource

        public DataSource getDataSource()
      • setSequenceCircular

        public void setSequenceCircular​(boolean sequenceCircular)
      • setSequenceLength

        public void setSequenceLength​(long sequenceLength)
      • parse

        public Location parse​(java.lang.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 java.util.List<AbstractLocation> parse​(java.io.Reader reader)
                                               throws java.io.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:
        java.io.IOException - Thrown with any reader error
        ParserException - Thrown with any error with parsing locations
      • main

        public static void main​(java.lang.String[] args)