de.jstacs.data.sequences.annotation
Class SequenceAnnotation

java.lang.Object
  extended by de.jstacs.results.ResultSet
      extended by de.jstacs.data.sequences.annotation.SequenceAnnotation
All Implemented Interfaces:
Storable
Direct Known Subclasses:
CisRegulatoryModuleAnnotation, LocatedSequenceAnnotation

public class SequenceAnnotation
extends ResultSet

Class for a general annotation of a Sequence. Annotations may be e.g. exons, introns, coding sequences, or splice sites.

Author:
Jan Grau

Field Summary
 
Fields inherited from class de.jstacs.results.ResultSet
results
 
Constructor Summary
SequenceAnnotation(StringBuffer representation)
          Re-creates a SequenceAnnotation from its XML-representation as returned by toXML().
SequenceAnnotation(String type, String identifier, Collection<? extends Result> results)
          Creates a new SequenceAnnotation of type type, with identifier identifier, and additional annotation (that does not fit the SequenceAnnotation definitions) results.
SequenceAnnotation(String type, String identifier, Result result)
          Creates a new SequenceAnnotation of type type, with identifier identifier, and additional annotation (that does not fit the SequenceAnnotation definitions) result.
SequenceAnnotation(String type, String identifier, Result[]... results)
          Creates a new SequenceAnnotation of type type, with identifier identifier, and additional annotation (that does not fit the SequenceAnnotation definitions) results.
SequenceAnnotation(String type, String identifier, SequenceAnnotation[] subAnnotations, Result... additionalAnnotation)
          Creates a new SequenceAnnotation of type type, with identifier identifier, and additional annotation (that does not fit the SequenceAnnotation definitions) additionalAnnotation.
 
Method Summary
protected  void fromXML(StringBuffer source)
          Parses the contents of a ResultSet from its XML-representation as returned by ResultSet.toXML().
 Result[] getAnnotations()
          Returns the additional annotations of this SequenceAnnotation as given in the constructor.
 String getIdentifier()
          Returns the identifier of this SequenceAnnotation as given in the constructor.
 SequenceAnnotation[] getSubAnnotations()
          Returns the sub-annotations of this SequenceAnnotation as given in the constructor.
 String getType()
          Returns the type of this SequenceAnnotation as given in the constructor
 String toString()
           
 StringBuffer toXML()
          This method returns an XML-representation of an instance of the implementing class.
 
Methods inherited from class de.jstacs.results.ResultSet
findColumn, getNumberOfResults, getResultAt, getResults
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SequenceAnnotation

public SequenceAnnotation(String type,
                          String identifier,
                          Result result)
Creates a new SequenceAnnotation of type type, with identifier identifier, and additional annotation (that does not fit the SequenceAnnotation definitions) result.

Parameters:
type - the type of the annotation
identifier - the identifier of the annotation
result - the additional annotation

SequenceAnnotation

public SequenceAnnotation(String type,
                          String identifier,
                          Result[]... results)
Creates a new SequenceAnnotation of type type, with identifier identifier, and additional annotation (that does not fit the SequenceAnnotation definitions) results.

Parameters:
type - the type of the annotation
identifier - the identifier of the annotation
results - the additional annotation

SequenceAnnotation

public SequenceAnnotation(String type,
                          String identifier,
                          SequenceAnnotation[] subAnnotations,
                          Result... additionalAnnotation)
Creates a new SequenceAnnotation of type type, with identifier identifier, and additional annotation (that does not fit the SequenceAnnotation definitions) additionalAnnotation. This SequenceAnnotation may contain sub-annotations, this may be e.g. the donor and acceptor site for splice sites or the exons of for a gene.

Parameters:
type - the type of the annotation
identifier - the identifier of the annotation
subAnnotations - the sub-annotation
additionalAnnotation - the additional annotation

SequenceAnnotation

public SequenceAnnotation(String type,
                          String identifier,
                          Collection<? extends Result> results)
Creates a new SequenceAnnotation of type type, with identifier identifier, and additional annotation (that does not fit the SequenceAnnotation definitions) results.

Parameters:
type - the type of the annotation
identifier - the identifier of the annotation
results - the additional annotation

SequenceAnnotation

public SequenceAnnotation(StringBuffer representation)
                   throws NonParsableException
Re-creates a SequenceAnnotation from its XML-representation as returned by toXML().

Parameters:
representation - the XML-representation
Throws:
NonParsableException - is thrown if the XML-code could not be parsed
Method Detail

getType

public String getType()
Returns the type of this SequenceAnnotation as given in the constructor

Returns:
the type

getAnnotations

public Result[] getAnnotations()
Returns the additional annotations of this SequenceAnnotation as given in the constructor.

Returns:
the additional annotations

getSubAnnotations

public SequenceAnnotation[] getSubAnnotations()
Returns the sub-annotations of this SequenceAnnotation as given in the constructor.

Returns:
the sub-annotations
See Also:
SequenceAnnotation(String, String, SequenceAnnotation[], Result...)

toString

public String toString()
Overrides:
toString in class ResultSet

fromXML

protected void fromXML(StringBuffer source)
                throws NonParsableException
Description copied from class: ResultSet
Parses the contents of a ResultSet from its XML-representation as returned by ResultSet.toXML().

Overrides:
fromXML in class ResultSet
Parameters:
source - the XML-representation
Throws:
NonParsableException - is thrown if the XML-code could not be parsed

toXML

public StringBuffer toXML()
Description copied from interface: Storable
This method returns an XML-representation of an instance of the implementing class.

Specified by:
toXML in interface Storable
Overrides:
toXML in class ResultSet
Returns:
the XML-representation

getIdentifier

public String getIdentifier()
Returns the identifier of this SequenceAnnotation as given in the constructor.

Returns:
the identifier