edu.iastate.metnet.birdseyeview
Class Annotation

java.lang.Object
  extended by edu.iastate.metnet.birdseyeview.Annotation
All Implemented Interfaces:
java.lang.Comparable<Annotation>

public class Annotation
extends java.lang.Object
implements java.lang.Comparable<Annotation>

The Annotation Class encapsulates the annotation data for one gene product. It actually only holds the data that is necessary in the Bird's Eye View. It also holds the experimental variance (i.e. the percentage change from normal levels for this experiment) which is odd but convenient.

Author:
Matt Studham Created Jan 22, 2005

Field Summary
static java.lang.String GeneType
           
static java.lang.String PolypeptideType
           
static java.lang.String ProteinComplexType
           
 
Constructor Summary
Annotation(java.lang.String lid, int mid)
          Constructor.
Annotation(java.lang.String n, java.lang.String t, java.util.ArrayList l, java.util.ArrayList p, double v, java.util.ArrayList g, java.util.ArrayList f)
          Constructor.
 
Method Summary
 void addLocations(java.util.ArrayList locs)
          Add the locations and set the location string.
 void addPathways(java.util.ArrayList paths)
          Adds the pathways and sets the pathway string.
 void addProtein(Protein protein)
          This method adds the given protein to the protein list.
 int compareTo(Annotation b)
          This method implements the interface's method compareTo in order to sort the list
static java.lang.String createListString(java.lang.String prefix, java.util.ArrayList list)
          This method turns a list of strings into a comma-delimited string.
 boolean equals(Annotation a)
          This method compares this object to the given object.
 java.util.ArrayList getGoBioProcesses()
          This method returns the node IDs of the GO biological processes in which this gene product participates.
 java.util.ArrayList getGoFunctions()
          This method returns the node IDs of the GO molecular functions of this gene product.
 int getGoGeneProductID()
          Returns the gene ontology gene product ID.
 java.util.ArrayList getLocations()
          Returns the locations.
 java.lang.String getLocationString()
          Returns the location string.
 java.lang.String getLocusID()
          Returns the locus ID.
 int getMetnetEntityID()
          Returns the metnet entity ID.
 java.lang.String getName()
          Returns the name.
 java.util.ArrayList getPathways()
          Returns the pathways.
 java.lang.String getPathwayString()
          Returns the pathway string.
 java.util.ArrayList getProteins()
          Returns the proteins.
 java.lang.String getType()
          Returns the type.
 double getVariance()
          This method returns the experimental variance.
 boolean hasGoBioProcess(java.lang.Integer nodeID)
          This method indicates whether or not this gene product participates in the GO Biological Process with the given ID.
 boolean hasGoFunction(java.lang.Integer nodeID)
          This method indicates whether or not this gene product has the GO molecular function with the given ID.
static void main(java.lang.String[] args)
          This method tests the Annotation class.
 void setGoBioProcesses(java.util.ArrayList nodes)
          This method sets the the node IDs of the GO biological processes in which this gene product participates.
 void setGoFunctions(java.util.ArrayList nodes)
          This method sets the node IDs of the GO molecular functions of this gene product.
 void setGoGeneProductID(int id)
          Returns the gene ontology gene product ID.
 void setLocations(java.util.ArrayList locs)
          Sets the locations and the location string.
 void setLocusID(java.lang.String id)
          Sets the locus ID.
 void setMetnetEntityID(int id)
          Returns the metnet entity ID.
 void setName()
          Sets the name.
 void setPathways(java.util.ArrayList paths)
          Sets the pathways and the pathway string.
 void setVariance(double v)
          Sets the experimental variance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ProteinComplexType

public static final java.lang.String ProteinComplexType
See Also:
Constant Field Values

PolypeptideType

public static final java.lang.String PolypeptideType
See Also:
Constant Field Values

GeneType

public static final java.lang.String GeneType
See Also:
Constant Field Values
Constructor Detail

Annotation

public Annotation(java.lang.String lid,
                  int mid)
Constructor. Just set the locus ID and metnet entity ID. Initialize the rest to be safe. The defualt type is "gene".

Parameters:
lid - Locus ID
mid - Metnet Entity ID

Annotation

public Annotation(java.lang.String n,
                  java.lang.String t,
                  java.util.ArrayList l,
                  java.util.ArrayList p,
                  double v,
                  java.util.ArrayList g,
                  java.util.ArrayList f)
Constructor.

Parameters:
n -
t -
l - List of String objects
p - List of String objects
v -
g - List of Integer objects
f - List of Integer objects
Method Detail

getLocations

public java.util.ArrayList getLocations()
Returns the locations.

Returns:
List of String objects

setLocations

public void setLocations(java.util.ArrayList locs)
Sets the locations and the location string.

Parameters:
List - of String objects

addLocations

public void addLocations(java.util.ArrayList locs)
Add the locations and set the location string. Only add unique locations.

Parameters:
List - of String objects

getLocationString

public java.lang.String getLocationString()
Returns the location string.

Returns:
String

getName

public java.lang.String getName()
Returns the name.

Returns:
String

setName

public void setName()
Sets the name. The name of an annotation is a combination of the locus ID and the names of associated proteins. This should only be called after the locusID has been set.


getPathways

public java.util.ArrayList getPathways()
Returns the pathways.

Returns:
List of String objects

setPathways

public void setPathways(java.util.ArrayList paths)
Sets the pathways and the pathway string.

Parameters:
List - of String objects

addPathways

public void addPathways(java.util.ArrayList paths)
Adds the pathways and sets the pathway string. Only unique pathways are added.

Parameters:
List - of String objects

getPathwayString

public java.lang.String getPathwayString()
Returns the pathway string.

Returns:
String

getType

public java.lang.String getType()
Returns the type.

Returns:
String

getVariance

public double getVariance()
This method returns the experimental variance.

Returns:
double

setVariance

public void setVariance(double v)
Sets the experimental variance.

Parameters:
v -

getLocusID

public java.lang.String getLocusID()
Returns the locus ID.

Returns:
String

setLocusID

public void setLocusID(java.lang.String id)
Sets the locus ID.

Parameters:
id - String object

getMetnetEntityID

public int getMetnetEntityID()
Returns the metnet entity ID.

Returns:
int

setMetnetEntityID

public void setMetnetEntityID(int id)
Returns the metnet entity ID.

Parameters:
id - Metnet Entity ID

getProteins

public java.util.ArrayList getProteins()
Returns the proteins.

Returns:
ArrayList

addProtein

public void addProtein(Protein protein)
This method adds the given protein to the protein list. Duplicate proteins will not be added, and the name of the annotation is changed here to reflect the new protein.

Parameters:
protein - Protein object

getGoGeneProductID

public int getGoGeneProductID()
Returns the gene ontology gene product ID.

Returns:
int

setGoGeneProductID

public void setGoGeneProductID(int id)
Returns the gene ontology gene product ID.

Parameters:
id - Gene Ontology gene product ID

getGoBioProcesses

public java.util.ArrayList getGoBioProcesses()
This method returns the node IDs of the GO biological processes in which this gene product participates.

Returns:
ArrayList of Integer objects

setGoBioProcesses

public void setGoBioProcesses(java.util.ArrayList nodes)
This method sets the the node IDs of the GO biological processes in which this gene product participates.

Parameters:
nodes - ArrayList of Integer objects

hasGoBioProcess

public boolean hasGoBioProcess(java.lang.Integer nodeID)
This method indicates whether or not this gene product participates in the GO Biological Process with the given ID.

Parameters:
nodeID -
Returns:
boolean

hasGoFunction

public boolean hasGoFunction(java.lang.Integer nodeID)
This method indicates whether or not this gene product has the GO molecular function with the given ID.

Parameters:
nodeID -
Returns:
boolean

getGoFunctions

public java.util.ArrayList getGoFunctions()
This method returns the node IDs of the GO molecular functions of this gene product.

Returns:
ArrayList of Integer objects

setGoFunctions

public void setGoFunctions(java.util.ArrayList nodes)
This method sets the node IDs of the GO molecular functions of this gene product.

Parameters:
nodes - ArrayList of Integer objects

equals

public boolean equals(Annotation a)
This method compares this object to the given object. If the name and type are identical, it is the same annotation.

Parameters:
a - Annotation object
Returns:
boolean

createListString

public static java.lang.String createListString(java.lang.String prefix,
                                                java.util.ArrayList list)
This method turns a list of strings into a comma-delimited string. There is no "and", and no "," at the end.

Parameters:
prefix -
list -
Returns:
String

compareTo

public int compareTo(Annotation b)
This method implements the interface's method compareTo in order to sort the list

Specified by:
compareTo in interface java.lang.Comparable<Annotation>
Parameters:
two - annotation s,

main

public static void main(java.lang.String[] args)
This method tests the Annotation class. Mainly the list string stuff.

Parameters:
args -