Class AAindexStreamReader
- java.lang.Object
-
- org.biojava.bio.proteomics.aaindex.AAindexStreamReader
-
- All Implemented Interfaces:
SymbolPropertyTableIterator
public class AAindexStreamReader extends Object implements SymbolPropertyTableIterator
Iterator overAAindexobjects that are stored in a stream in the AAindex1 file format. The format of such an Amino Acid Index Database file is described in the AAindex manual . ThenextTable()method returns objects of typeAAindex. See this class also for further informations. To hold an AAindex1 file in memory for random access use theSimpleSymbolPropertyTableDBclass:SimpleSymbolPropertyTableDB db = new SimpleSymbolPropertyTableDB( new AAindexStreamReader(new FileReader("aaindex1"))); AAindex hydrophobicity = (AAindex) db.table("CIDH920105"); SymbolList symbols = ProteinTools.createProtein( "ARNDCEQGHILKMFPSTWYV"); double hp = 0.0; for (int i = 1; i <= symbols.length(); i++) { hp += hydrophobicity.getDoubleValue(symbols.symbolAt(i)); } System.out.println("Average hydrophobicity: " + Double.toString( hp / symbols.length()));References:
Kawashima, S. and Kanehisa, M.; AAindex: amino acid index database. Nucleic Acids Res. 28, 374 (2000).
Tomii, K. and Kanehisa, M.; Analysis of amino acid indices and mutation matrices for sequence comparison and structure prediction of proteins. Protein Eng. 9, 27-36 (1996).
Nakai, K., Kidera, A., and Kanehisa, M.; Cluster analysis of amino acid indices for prediction of protein structure and function. Protein Eng. 2, 93-100 (1988)
- Version:
- $Revision$
- Author:
- Martin Szugat
-
-
Constructor Summary
Constructors Constructor Description AAindexStreamReader(BufferedReader reader)Initializes the iterator.AAindexStreamReader(Reader reader)Initializes the iterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleaneof()Checks if the end of the file or stream is reached.booleanhasNext()Checks if there is a furtherSymbolPropertyTableobject.SymbolPropertyTablenextTable()Returns the nextSymbolPropertyTableobject.
-
-
-
Constructor Detail
-
AAindexStreamReader
public AAindexStreamReader(Reader reader) throws IOException, NullPointerException
Initializes the iterator.- Parameters:
reader- reader over a stream in the AAindex file format.- Throws:
IOException- if the stream could not be read.NullPointerException- ifreaderisnull.
-
AAindexStreamReader
public AAindexStreamReader(BufferedReader reader) throws IOException, NullPointerException
Initializes the iterator.- Parameters:
reader- buffered reader over a stream in the AAindex file format.- Throws:
IOException- if the stream could not be read.NullPointerException- ifreaderisnull.
-
-
Method Detail
-
eof
public boolean eof()
Checks if the end of the file or stream is reached.- Returns:
trueif the end of the file is reached,falseotherwise.
-
hasNext
public boolean hasNext()
Checks if there is a furtherSymbolPropertyTableobject.- Specified by:
hasNextin interfaceSymbolPropertyTableIterator- Returns:
trueif a call to theSymbolPropertyTableIterator.nextTable()method is valid,falseotherwise.
-
nextTable
public SymbolPropertyTable nextTable() throws BioException
Returns the nextSymbolPropertyTableobject.- Specified by:
nextTablein interfaceSymbolPropertyTableIterator- Returns:
- a symbol property table
- Throws:
BioException- if the next symbol property table could not be retrieved.
-
-