Package org.biojava.bio.seq.io
Class SwissprotFileFormer
- java.lang.Object
-
- org.biojava.bio.seq.io.SwissprotFileFormer
-
- All Implemented Interfaces:
SeqFileFormer,SeqIOListener
public class SwissprotFileFormer extends Object implements SeqFileFormer
Deprecated.Use org.biojavax.bio.seq.io framework insteadFormats a sequence into Swissprot/TrEMBL format. Modeled after EmblFileFormer.- Since:
- 1.2
- Author:
- Greg Cox
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSwissprotFileFormer()Deprecated.Creates a newSwissprotFileFormerusingSystem.outstream.protectedSwissprotFileFormer(PrintStream theStream)Deprecated.Creates a newSwissprotFileFormerusing the specified stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddFeatureProperty(Object key, Object value)Deprecated.Null implementationvoidaddSequenceProperty(Object key, Object value)Deprecated.Notify the listener of a sequence-wide property.voidaddSymbols(Alphabet theAlphabet, Symbol[] theSymbols, int theStart, int theLength)Deprecated.Prints out the sequences properties in order.protected ListbreakSymbolArray(Alphabet theAlphabet, Symbol[] theSymbols, int theStart, int theLength)Deprecated.Converts the symbol list passed in into an array of strings.voidendFeature()Deprecated.Null implementation.voidendSequence()Deprecated.Notify the listener that processing of the sequence is complete.protected voidfillBuffer(StringBuffer theBuffer, int theLength)Deprecated.Simple method that adds spaces onto the buffer passed in.StringBufferformatLocation(StringBuffer theBuffer, Location theLocation)Deprecated.formatLocationcreates a String representation of aLocation.StringBufferformatLocation(StringBuffer theBuffer, Location theLocation, StrandedFeature.Strand theStrand)Deprecated.formatLocationcreates a String representation of aLocation.StringformatLocation(Feature theFeature)Deprecated.Creates a string representation of the location of a featureStringformatLocation(Location loc, StrandedFeature.Strand strand)formatLocationcreates an EMBL/Genbank style representation of aLocation.protected StringBufferformatPoint(int theMinIndex, int theMaxIndex, boolean isFuzzy)Deprecated.Formats the points from fuzzy locations.PrintStreamgetPrintStream()Deprecated.getPrintStreamreturns thePrintStreamto which an instance of SwissprotFileFormer will write the formatted data.protected voidprintOutSequenceHeaderLine(Alphabet theAlphabet, Symbol[] theSymbols, int theStart, int theLength)Deprecated.Prints out sequence header with only length data.voidsetName(String theName)Deprecated.The name is printed out as part of the identifier line.voidsetPrintStream(PrintStream theStream)Deprecated.setPrintStreaminforms an instance whichPrintStreamto use.voidsetURI(String theURI)Deprecated.Null implementation.voidstartFeature(Feature.Template templ)Deprecated.Null implementation.voidstartSequence()Deprecated.Start the processing of a sequence.
-
-
-
Constructor Detail
-
SwissprotFileFormer
protected SwissprotFileFormer()
Deprecated.Creates a newSwissprotFileFormerusingSystem.outstream.
-
SwissprotFileFormer
protected SwissprotFileFormer(PrintStream theStream)
Deprecated.Creates a newSwissprotFileFormerusing the specified stream.- Parameters:
theStream- aPrintStreamobject.
-
-
Method Detail
-
startSequence
public void startSequence() throws ParseException
Deprecated.Start the processing of a sequence. This method exists primarily to enforce the life-cycles of SeqIOListener objects.- Specified by:
startSequencein interfaceSeqIOListener- Throws:
ParseException
-
endSequence
public void endSequence() throws ParseException
Deprecated.Notify the listener that processing of the sequence is complete.- Specified by:
endSequencein interfaceSeqIOListener- Throws:
ParseException
-
setName
public void setName(String theName) throws ParseException
Deprecated.The name is printed out as part of the identifier line. It will be replaced if an ID keyword exists in the annotations.- Specified by:
setNamein interfaceSeqIOListener- Parameters:
theName- the String that should be returned by getName for the sequence being parsed- Throws:
ParseException
-
setURI
public void setURI(String theURI) throws ParseException
Deprecated.Null implementation. This object formats and prints a sequence. The URI alone cannot be printed in Swissprot format. Therefore, it's easiest to ignore it.- Specified by:
setURIin interfaceSeqIOListener- Parameters:
theURI- the new URI of the sequence- Throws:
ParseException
-
addSymbols
public void addSymbols(Alphabet theAlphabet, Symbol[] theSymbols, int theStart, int theLength) throws IllegalAlphabetException
Deprecated.Prints out the sequences properties in order. Prints out the symbol array passed in in lines of 60, blocks of 10- Specified by:
addSymbolsin interfaceSeqIOListener- Parameters:
theAlphabet- The alphabet of the symbol datatheSymbols- An array containing symbolstheStart- The start offset of valid data within the arraytheLength- The number of valid symbols in the array- Throws:
IllegalAlphabetException- if we can't cope with this alphabet.
-
addSequenceProperty
public void addSequenceProperty(Object key, Object value) throws ParseException
Deprecated.Notify the listener of a sequence-wide property. This might be stored as an entry in the sequence's annotation bundle. Checks for possible known properties to be shown in the file.- Specified by:
addSequencePropertyin interfaceSeqIOListener- Parameters:
key- Key the property will be stored undervalue- Value stored under the key- Throws:
ParseException
-
startFeature
public void startFeature(Feature.Template templ) throws ParseException
Deprecated.Null implementation.- Specified by:
startFeaturein interfaceSeqIOListener- Parameters:
templ- The template for this new feature object- Throws:
ParseException
-
endFeature
public void endFeature() throws ParseException
Deprecated.Null implementation.- Specified by:
endFeaturein interfaceSeqIOListener- Throws:
ParseException
-
addFeatureProperty
public void addFeatureProperty(Object key, Object value) throws ParseException
Deprecated.Null implementation- Specified by:
addFeaturePropertyin interfaceSeqIOListener- Parameters:
key- Key the property will be stored undervalue- Value stored under the key- Throws:
ParseException
-
getPrintStream
public PrintStream getPrintStream()
Deprecated.getPrintStreamreturns thePrintStreamto which an instance of SwissprotFileFormer will write the formatted data. The default is System.out- Specified by:
getPrintStreamin interfaceSeqFileFormer- Returns:
- the
PrintStreamwhich will be written to.
-
setPrintStream
public void setPrintStream(PrintStream theStream)
Deprecated.setPrintStreaminforms an instance whichPrintStreamto use.- Specified by:
setPrintStreamin interfaceSeqFileFormer- Parameters:
theStream- aPrintStreamto write to.
-
formatLocation
public StringBuffer formatLocation(StringBuffer theBuffer, Location theLocation, StrandedFeature.Strand theStrand)
Deprecated.formatLocationcreates a String representation of aLocation. Strand information is ignored, as Swissprot files represent proteins. An alternative form of this function does not take a Strand; that form is available only on SwissprotFileFormer; it is not part of the SeqFileFormer interface.- Specified by:
formatLocationin interfaceSeqFileFormer- Parameters:
theBuffer- aStringBufferto append the location to.theLocation- aLocationto format.theStrand- aStrandedFeature.Strandindicating nothing of relevance- Returns:
- a
StringBufferwith the location appended.
-
formatLocation
public String formatLocation(Feature theFeature)
Deprecated.Creates a string representation of the location of a feature- Specified by:
formatLocationin interfaceSeqFileFormer- Parameters:
theFeature- The feature with the location to format- Returns:
- String The formatted location
-
formatLocation
public StringBuffer formatLocation(StringBuffer theBuffer, Location theLocation)
Deprecated.formatLocationcreates a String representation of aLocation. The stringbuffer returned represents columns 15-27 of the Swissprot feature table entry. An alternative form of this function takes a Strand; that form is part of the SeqFileFormer interface.- Parameters:
theBuffer- aStringBufferto append the location to.theLocation- aLocationto format.- Returns:
- a
StringBufferwith the location appended.
-
printOutSequenceHeaderLine
protected void printOutSequenceHeaderLine(Alphabet theAlphabet, Symbol[] theSymbols, int theStart, int theLength) throws IllegalAlphabetException
Deprecated.Prints out sequence header with only length data.- Parameters:
theAlphabet- The alphabet of the symbol datatheSymbols- An array containing symbolstheStart- The start offset of valid data within the arraytheLength- The number of valid symbols in the array- Throws:
IllegalAlphabetException- if we can't cope with this alphabet.
-
breakSymbolArray
protected List breakSymbolArray(Alphabet theAlphabet, Symbol[] theSymbols, int theStart, int theLength) throws IllegalAlphabetException
Deprecated.Converts the symbol list passed in into an array of strings. The strings will be blocks of ten, with six blocks on a line.- Parameters:
theAlphabet- The alphabet of the symbol datatheSymbols- An array containing symbolstheStart- The start offset of valid data within the arraytheLength- The number of valid symbols in the array- Returns:
- The symbol list passed in broken into blocks of ten characters, six to a string.
- Throws:
IllegalAlphabetException- if we can't cope with this alphabet.
-
fillBuffer
protected void fillBuffer(StringBuffer theBuffer, int theLength)
Deprecated.Simple method that adds spaces onto the buffer passed in. This method exists to refactor some code used in location formatting. It isn't intended to be generally used.- Parameters:
theBuffer- Buffer to append whitespace to.theLength- Ammount of whitespace to append.
-
formatPoint
protected StringBuffer formatPoint(int theMinIndex, int theMaxIndex, boolean isFuzzy)
Deprecated.Formats the points from fuzzy locations. This is called easily with this.formatPoint(FuzzyLocation.getInnerMax(), FuzzyLocation.getOuterMax(), FuzzyLocation.isFuzzyMax())- Parameters:
theMaxIndex- Inner index of the fuzzy pointtheMinIndex- Outer index of the fuzzy pointisFuzzy- Indicates if this point is fuzzy
-
formatLocation
public String formatLocation(Location loc, StrandedFeature.Strand strand)
formatLocationcreates an EMBL/Genbank style representation of aLocation. This is a convenience method only. The version which has aStringBufferparameter (and returns theStringBuffer) 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- aLocationto format.strand- aStrandedFeature.Strandindicating theLocation's strand.- Returns:
- a
StringBuffer.
-
-