org.peace_tools.data
Class EST

java.lang.Object
  extended by org.peace_tools.data.EST

public class EST
extends java.lang.Object


Field Summary
private  int dbClassifier
          Index of the classifier in the Work space's classifier list with which this EST is associated.
private  int id
          The unique ID for this EST.
private  java.lang.String info
          The name and other information associated with the EST.
private  java.lang.String sequence
          The actual sequence of base pairs associated with this EST.
 
Constructor Summary
EST(int id, java.lang.String info, java.lang.String sequence)
          EST Constructor.
 
Method Summary
protected  void classify(java.util.ArrayList<DBClassifier> classifiers)
          Method to determine the classifier that identifies this EST.
 int getDBClassifier()
          Obtain the classifier index with which this EST is associated.
 int getID()
          Obtain the ID of this EST.
 java.lang.String getInfo()
          Obtain the information associated with this EST.
 java.lang.String getSequence()
          Obtain the actual sequence of base pairs for this EST.
 void read(java.io.PushbackInputStream is)
          Method to read an EST from a given input stream.
protected  java.lang.String readline(java.io.InputStream is)
          Helper method to read a line from a given input stream.
 java.lang.String toString()
           
 void write(java.io.PrintStream os)
          Method to dump the EST data out in FASTA file format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

private int id
The unique ID for this EST. This member holds the unique ID for this EST. The ID is set when the EST is instantiated and is never changed during the life time of this EST. The id is used to access and extract EST information.


info

private java.lang.String info
The name and other information associated with the EST. This information is typically the first header line read from a FASTA file.


sequence

private java.lang.String sequence
The actual sequence of base pairs associated with this EST. This information is typically read from a FASTA file. Currently it is assumed that an EST sequence can have only the four standard base pairs (A, T, G, and G).


dbClassifier

private int dbClassifier
Index of the classifier in the Work space's classifier list with which this EST is associated. This information changes whenever a new classifier list is set. If this EST does not belong to a specific classifier then this value is set to -1.

Constructor Detail

EST

EST(int id,
    java.lang.String info,
    java.lang.String sequence)
EST Constructor. This constructor is used to instantiate an EST method.

Parameters:
id - The unqiue ID value to be set for this EST.
info - The name and other information associated with the EST. This information is typically the first header line read from a FASTA file. This information can be null.
sequence - The actual sequence of base pairs associated with this EST. The sequence information can be null.
Method Detail

getID

public int getID()
Obtain the ID of this EST.

Returns:
The ID of the EST that was set when this EST was created.

getInfo

public java.lang.String getInfo()
Obtain the information associated with this EST. The name and other information associated with the EST. This information is typically the first header line read from a FASTA file.

Returns:
Any information available for this EST.

getSequence

public java.lang.String getSequence()
Obtain the actual sequence of base pairs for this EST. Note that sequence inforamtion for an EST can be null if it does not have a valid sequence information associated with it.

Returns:
The actual sequence of base paris for this EST.

getDBClassifier

public int getDBClassifier()
Obtain the classifier index with which this EST is associated. The classifier which which this EST is associated. The return value from this method is meanigful only after the ESTList.classify() method has been invoked to classify ESTs using the current set of classifiers.

Returns:
The classifier list with which this EST is associated. If this EST is not associated with a classifier then this method returns -1.

write

public void write(java.io.PrintStream os)
Method to dump the EST data out in FASTA file format. This method can be used to dump out the EST information in a FASTA compatible format.

Parameters:
os - The output stream to which the EST must be written in a FASTA format.

read

public void read(java.io.PushbackInputStream is)
          throws java.io.IOException
Method to read an EST from a given input stream. This method can be used to read an EST from a given input stream. This method requires an push-back stream so that at least one character can be undone. This one character push-back is needed to detect the end of an EST sequence and the beginning of the other by checking to see if the next character to be read is a ">" sign.

Note: This method updates only the info and sequence information associated with this EST and not its id value.

Parameters:
is - The input stream from where the EST is to be read.
Throws:
java.io.IOException

readline

protected java.lang.String readline(java.io.InputStream is)
                             throws java.io.IOException
Helper method to read a line from a given input stream. This method repeatedly reads characters from the input stream until a newline character is read.

Parameters:
is - The input stream from where a line is to be read.
Returns:
A string containing the line read. If the no data was available then this method returns null. Otherwise it reaturns the next line read without the trailing new line character.
Throws:
java.io.IOException - This method throws an exception one errors.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

classify

protected void classify(java.util.ArrayList<DBClassifier> classifiers)
Method to determine the classifier that identifies this EST. This method is typically invoked from the ESTList.classify() method to determine the first, enabled classifier that identifies or matches the information (from the FASTA header) associated with this EST. This method iterates over the list of classifiers and uses the regular expression in each classifier to identify the matching classification for this EST.

Parameters:
classifiers - The list of classifiers to be used to determine the matching classifier. Typically, this list is the same as the list of classifiers currently configured in the work space.