compbio.data.sequence
Class Score

java.lang.Object
  extended by compbio.data.sequence.Score

@Immutable
public class Score
extends Object

A value class for AACon annotation results storage

Author:
pvtroshin

Constructor Summary
Score(ConservationMethod method, List<Float> scores)
          Instantiate the Score
 
Method Summary
 boolean equals(Object obj)
           
 ConservationMethod getMethod()
          Returns the ConservationMethod
 List<Float> getScores()
          The column scores for the alignment
 int hashCode()
           
 String toString()
           
static void write(Set<Score> scores, OutputStream output)
          Outputs the List of Score objects into the Output stream.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Score

public Score(ConservationMethod method,
             List<Float> scores)
Instantiate the Score

Parameters:
method - the ConservationMethod with which scores were calculated
scores - the actual conservation values for each column of the alignment
Method Detail

getMethod

public ConservationMethod getMethod()
Returns the ConservationMethod

Returns:
the ConservationMethod

getScores

public List<Float> getScores()
The column scores for the alignment

Returns:
the column scores for the alignment

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

write

public static void write(Set<Score> scores,
                         OutputStream output)
                  throws IOException
Outputs the List of Score objects into the Output stream. The output format is as follows:
 #MethodName <space separated list of values>
 	  
 For example:
 	 
 #KABAT 0.2 0.3 0.2 0 0.645 0.333 1 1 0 0
 #SMERFS 0.645 0.333 1 1 0 0 0.2 0.3 0.2 0
 
 
The maximum precision for values is 3 digits, but can be less.

Parameters:
scores - the list of scores to output
output - the stream to output the data to
Throws:
IOException - if the OutputStream cannot be written into
NullPointerException - if the output stream is null