Package org.biojava.nbio.alignment.io
Class StockholmFileParser
java.lang.Object
org.biojava.nbio.alignment.io.StockholmFileParser
Stockholm file parser.
for more information about the format refer to
for more information about the format refer to
- ftp://ftp.sanger.ac.uk/pub/databases /Pfam/current_release/userman.txt.
- ftp://ftp.sanger.ac.uk/pub/databases/Rfam/CURRENT /USERMAN.
- http://sonnhammer.sbc.su.se/Stockholm.html.
 Pfam DESCRIPTION OF FIELDS
    Compulsory fields:
    ------------------
    AC   Accession number:           Accession number in form PFxxxxx.version or PBxxxxxx.
    ID   Identification:             One word name for family.
    DE   Definition:                 Short description of family.
    AU   Author:                     Authors of the entry.
    SE   Source of seed:             The source suggesting the seed members belong to one family.
    GA   Gathering method:           Search threshold to build the full alignment.
    TC   Trusted Cutoff:             Lowest sequence score and domain score of match in the full alignment.
    NC   Noise Cutoff:               Highest sequence score and domain score of match not in full alignment.
    TP   Type:                       Type of family -- presently Family, Domain, Motif or Repeat.
    SQ   Sequence:                   Number of sequences in alignment.
    //                               End of alignment.
    Optional fields:
    ----------------
    DC   Database Comment:           Comment about database reference.
    DR   Database Reference:         Reference to external database.
    RC   Reference Comment:          Comment about literature reference.
    RN   Reference Number:           Reference Number.
    RM   Reference Medline:          Eight digit medline UI number.
    RT   Reference Title:            Reference Title.
    RA   Reference Author:           Reference Author
    RL   Reference Location:         Journal location.
    PI   Previous identifier:        Record of all previous ID lines.
    KW   Keywords:                   Keywords.
    CC   Comment:                    Comments.
    NE   Pfam accession:             Indicates a nested domain.
    NL   Location:                   Location of nested domains - sequence ID, start and end of insert.
    WK   Wikipedia Reference:        Reference to wikipedia.
    Obsolete fields:
    -----------
    AL   Alignment method of seed:   The method used to align the seed members.
    AM   Alignment Method:          The order ls and fs hits are aligned to the model to build the full align.
 - Since:
- 3.0.5
- Author:
- Amr ALHOSSARY, Marko Vaz
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intindicates reading as much as possible, without limits
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionparse(InputStream inStream) parsesInputStreamand returns a the first contained alignment in aStockholmStructureobject.parse(InputStream inStream, int max) parses anInputStreamand returns at maximummaxobjects contained in that file.
 This method leaves the stream open for further calls ofparse(InputStream, int)(same function) orparseNext(int).Parses a Stockholm file and returns aStockholmStructureobject with its content.
 This function is meant to be used for single access to specific file and it closes the file after doing its assigned job.Parses a Stockholm file and returns aStockholmStructureobject with its content.
 This function doesn't close the file after doing its assigned job; to allow for further calls ofparseNext(int).parseNext(int max) Tries to parse and return as maximum asmaxstructures in the last used file or input stream.
 Please consider calling eitherparse(InputStream),parse(InputStream, int), orparse(String, int)before calling this function.
- 
Field Details- 
INFINITYindicates reading as much as possible, without limits- See Also:
 
 
- 
- 
Constructor Details- 
StockholmFileParserpublic StockholmFileParser()
 
- 
- 
Method Details- 
parseParses a Stockholm file and returns aStockholmStructureobject with its content.
 This function is meant to be used for single access to specific file and it closes the file after doing its assigned job. Any subsequent call toparseNext(int)will throw an exception or will function with unpredicted behavior.- Parameters:
- filename- complete(?) path to the file from where to read the content
- Returns:
- stockholm file content
- Throws:
- IOException- when an exception occurred while opening/reading/closing the file+
- ParserException- if unexpected format is encountered
 
- 
parseParses a Stockholm file and returns aStockholmStructureobject with its content.
 This function doesn't close the file after doing its assigned job; to allow for further calls ofparseNext(int).- Parameters:
- filename- file from where to read the content. see- InputStreamProviderfor more details.
- max- maximum number of files to read,- INFINITYfor all.
- Returns:
- a vector of StockholmStructurecontaining parsed structures.
- Throws:
- IOException- when an exception occurred while opening/reading/closing the file.
- ParserException- if unexpected format is encountered
- See Also:
 
- 
parseparsesInputStreamand returns a the first contained alignment in aStockholmStructureobject. Used mainly for multiple files within the same input stream, (e.g. when reading from Pfam flat files.
 This method leaves the stream open for further calls ofparseNext(int).- Parameters:
- inStream- the- InputStreamcontaining the file to read.
- Returns:
- a StockholmStructureobject representing file contents.
- Throws:
- IOException
- ParserException
- See Also:
 
- 
parseparses anInputStreamand returns at maximummaxobjects contained in that file.
 This method leaves the stream open for further calls ofparse(InputStream, int)(same function) orparseNext(int).- Parameters:
- inStream- the stream to parse
- max- maximum number of structures to try to parse,- INFINITYto try to obtain as much as possible.
- Returns:
- a ListofStockholmStructureobjects. If there are no more structures, an empty list is returned.
- Throws:
- IOException- in case an I/O Exception occurred.
- See Also:
 
- 
parseNextTries to parse and return as maximum asmaxstructures in the last used file or input stream.
 Please consider calling eitherparse(InputStream),parse(InputStream, int), orparse(String, int)before calling this function.- Parameters:
- max-
- Returns:
- Throws:
- IOException
 
 
-