Class GenbankFileFormer

  • All Implemented Interfaces:
    SeqFileFormer, SeqIOListener
    Direct Known Subclasses:
    ProteinRefSeqFileFormer

    public class GenbankFileFormer
    extends java.lang.Object
    implements SeqFileFormer
    Deprecated.
    Use org.biojavax.bio.seq.io framework instead
    GenbankFileFormer performs the detailed formatting of Genbank entries for writing to a PrintStream. There is some code dupication with EmblFileFormer which could be factored out.
    Since:
    1.2
    Author:
    Keith James
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected GenbankFileFormer()
      Deprecated.
      Creates a new GenbankFileFormer using System.out stream.
      protected GenbankFileFormer​(java.io.PrintStream stream)
      Deprecated.
      Creates a new GenbankFileFormer using the specified stream.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void addFeatureProperty​(java.lang.Object key, java.lang.Object value)
      Deprecated.
      Notify the listener of a feature property.
      void addSequenceProperty​(java.lang.Object key, java.lang.Object value)
      Deprecated.
      Notify the listener of a sequence-wide property.
      void addSymbols​(Alphabet alpha, Symbol[] syms, int start, int length)
      Deprecated.
      Notify the listener of symbol data.
      void endFeature()
      Deprecated.
      Mark the end of data associated with one specific feature.
      void endSequence()
      Deprecated.
      Notify the listener that processing of the sequence is complete.
      java.lang.StringBuffer formatLocation​(java.lang.StringBuffer sb, Location loc, StrandedFeature.Strand strand)
      formatLocation creates an EMBL/Genbank style representation of a Location.
      java.lang.String formatLocation​(Feature theFeature)
      Formats the location of a feature.
      java.lang.String formatLocation​(Location loc, StrandedFeature.Strand strand)
      formatLocation creates an EMBL/Genbank style representation of a Location.
      java.io.PrintStream getPrintStream()
      Deprecated.
      getPrintStream returns the PrintStream to which an instance will write the formatted data.
      boolean getVectorNTISupport()
      Deprecated.
      Is VectorNTI compatable output being produced?
      void setName​(java.lang.String id)
      Deprecated.
      Notify the listener that the current sequence is generally known by a particular name.
      void setPrintStream​(java.io.PrintStream stream)
      Deprecated.
      setPrintStream informs an instance which PrintStream to use.
      void setURI​(java.lang.String uri)
      Deprecated.
      Notify the listener of a URI identifying the current sequence.
      void setVectorNTISupport​(boolean b)
      Deprecated.
      VectorNTI requires GenBank format to be a little more specific than required by the GenBank definition.
      void startFeature​(Feature.Template templ)
      Deprecated.
      Notify the listener that a new feature object is starting.
      void startSequence()
      Deprecated.
      Start the processing of a sequence.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GenbankFileFormer

        protected GenbankFileFormer()
        Deprecated.
        Creates a new GenbankFileFormer using System.out stream.
      • GenbankFileFormer

        protected GenbankFileFormer​(java.io.PrintStream stream)
        Deprecated.
        Creates a new GenbankFileFormer using the specified stream.
        Parameters:
        stream - a PrintStream.
    • Method Detail

      • getPrintStream

        public java.io.PrintStream getPrintStream()
        Deprecated.
        Description copied from interface: SeqFileFormer
        getPrintStream returns the PrintStream to which an instance will write the formatted data. If this has not been set, an implementation should default to System.out.
        Specified by:
        getPrintStream in interface SeqFileFormer
        Returns:
        the PrintStream which will be written to.
      • setPrintStream

        public void setPrintStream​(java.io.PrintStream stream)
        Deprecated.
        Description copied from interface: SeqFileFormer
        setPrintStream informs an instance which PrintStream to use.
        Specified by:
        setPrintStream in interface SeqFileFormer
        Parameters:
        stream - a PrintStream to write to.
      • setName

        public void setName​(java.lang.String id)
                     throws ParseException
        Deprecated.
        Description copied from interface: SeqIOListener
        Notify the listener that the current sequence is generally known by a particular name.
        Specified by:
        setName in interface SeqIOListener
        Parameters:
        id - the String that should be returned by getName for the sequence being parsed
        Throws:
        ParseException
      • addSymbols

        public void addSymbols​(Alphabet alpha,
                               Symbol[] syms,
                               int start,
                               int length)
                        throws IllegalAlphabetException
        Deprecated.
        Description copied from interface: SeqIOListener
        Notify the listener of symbol data. All symbols passed to this method are guarenteed to be contained within the specified alphabet. Generally all calls to a given Listener should have the same alphabet -- if not, the listener implementation is likely to throw an exception
        Specified by:
        addSymbols in interface SeqIOListener
        Parameters:
        alpha - The alphabet of the symbol data
        syms - An array containing symbols
        start - The start offset of valid data within the array
        length - The number of valid symbols in the array
        Throws:
        IllegalAlphabetException - if we can't cope with this alphabet.
      • startFeature

        public void startFeature​(Feature.Template templ)
                          throws ParseException
        Deprecated.
        Description copied from interface: SeqIOListener
        Notify the listener that a new feature object is starting. Every call to startFeature should have a corresponding call to endFeature. If the listener is concerned with a hierarchy of features, it should maintain a stack of `open' features.
        Specified by:
        startFeature in interface SeqIOListener
        Throws:
        ParseException
      • setVectorNTISupport

        public void setVectorNTISupport​(boolean b)
        Deprecated.
        VectorNTI requires GenBank format to be a little more specific than required by the GenBank definition. By setting this to true the produced output should be parsable by VectorNTI. By default this is false.
        Parameters:
        b - to support or not to support.
      • getVectorNTISupport

        public boolean getVectorNTISupport()
        Deprecated.
        Is VectorNTI compatable output being produced?
        Returns:
        false by default.
      • formatLocation

        public java.lang.String formatLocation​(Feature theFeature)
        Formats the location of a feature. This version is required when formatting remote locations, since the location field of a remote feature is the projection of that feature on the sequence. When a distinction is made between 'order' and 'join' this method will likely be extended for that also.
        Parameters:
        theFeature - The feature with the location to format
        Returns:
        String The formatted location
      • formatLocation

        public java.lang.String formatLocation​(Location loc,
                                               StrandedFeature.Strand strand)
        formatLocation creates an EMBL/Genbank style representation of a Location. This is a convenience method only. The version which has a StringBuffer parameter (and returns the StringBuffer) is preferred. If a compound location is formatted using this method, it is returned as a join-type location rather than an order-type.
        Parameters:
        loc - a Location to format.
        strand - a StrandedFeature.Strand indicating the Location's strand.
        Returns:
        a StringBuffer.
      • formatLocation

        public java.lang.StringBuffer formatLocation​(java.lang.StringBuffer sb,
                                                     Location loc,
                                                     StrandedFeature.Strand strand)
        formatLocation creates an EMBL/Genbank style representation of a Location. Supported location forms:
           123
          <123 or >123
          (123.567)
          (123.567)..789
           123..(567.789)
          (123.345)..(567.789)
           123..456
          <123..567 or 123..>567 or <123..>567
           123^567
           AL123465:(123..567)
         
        If a compound location is formatted using this method, it is returned as a join-type location rather than an order-type. To preserve the join/order distinction; and to format locations like AL123465:(123..567), use the formatLocation(Feature) method.
        Parameters:
        sb - a StringBuffer
        loc - a Location to format.
        strand - a StrandedFeature.Strand indicating the Location's strand.
        Returns:
        a StringBuffer.