apollo.dataadapter.gff3
Class GFF3Entry

java.lang.Object
  extended by apollo.dataadapter.gff3.GFF3Entry

public class GFF3Entry
extends java.lang.Object

This class represents a GFF3 entry

Author:
elee

Field Summary
static int NUM_FIELDS
          expected number of fields
 
Constructor Summary
GFF3Entry(SeqFeatureI feat)
          Constructs a GFF3Entry
GFF3Entry(java.lang.String data)
          Constructs a GFF3Entry
 
Method Summary
 void addAttributeValue(java.lang.String name, java.lang.String value)
          Add an attribute
 SeqFeatureI createFeature(OBOParser oboParser)
          Create the implementing class of AnnotatedFeatureI given the type
 java.util.Map<java.lang.String,java.util.List<java.lang.String>> getAttributes()
          Get all attributes
 java.util.List<java.lang.String> getAttributeValues(java.lang.String attrName)
          Get a list of attribute values for a given attribute name
 int getEnd()
          Get the end of the feature on the reference sequence
 java.lang.String getId()
          Get the feature ID
 java.lang.String getName()
          Get the feature name
 int getPhase()
          Get the feature phase
 java.lang.String getReferenceId()
          Get the reference sequence ID
 double getScore()
          Get the feature score
 java.lang.String getSource()
          Get the source for the feature
 int getStart()
          Get the start of the feature on the reference sequence
 int getStrand()
          Get the strand of the feature on the reference sequence
 java.lang.String getType()
          Get the type of feature
 boolean isAnnotation()
          Check whether this feature is annotation (evidence otherwise)
 boolean isNameSet()
          Check if the feature name is set
 boolean isOneLevelAnnotation()
          Check to see if entry is for a one-level annotation
 boolean isPhaseSet()
          Checks whether the phase has been set for this feature
 boolean isScoreSet()
          Checks whether the score has been set for this feature
 boolean isThreeLevelAnnotation()
          Check to see if entry is for a three-level annotation
 void setEnd(int end)
          Set the end of the feature on the reference sequence
 void setId(java.lang.String id)
          Set the feature ID
 void setPhase(int phase)
          Set the feature phase
 void setScore(double score)
          Set the feature score
 void setSource(java.lang.String src)
          Set the source for the feature
 void setStart(int start)
          Set the start of the feature on the reference sequence
 void setType(java.lang.String type)
          Set the type of feature
 java.lang.String toString()
          Convert this entry object to a GFF3 tab delimited entry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NUM_FIELDS

public static final int NUM_FIELDS
expected number of fields

See Also:
Constant Field Values
Constructor Detail

GFF3Entry

public GFF3Entry(java.lang.String data)
Constructs a GFF3Entry

Parameters:
data - - tab delimited data

GFF3Entry

public GFF3Entry(SeqFeatureI feat)
Constructs a GFF3Entry

Parameters:
feat - - SeqFeatureI object
Method Detail

getReferenceId

public java.lang.String getReferenceId()
Get the reference sequence ID

Returns:
refId - reference sequence ID

getSource

public java.lang.String getSource()
Get the source for the feature

Returns:
source for the feature

setSource

public void setSource(java.lang.String src)
Set the source for the feature

Parameters:
src - - source for the feature

getType

public java.lang.String getType()
Get the type of feature

Returns:
type of feature

setType

public void setType(java.lang.String type)
Set the type of feature

Parameters:
type - - type of feature

getStart

public int getStart()
Get the start of the feature on the reference sequence

Returns:
start of the feature

setStart

public void setStart(int start)
Set the start of the feature on the reference sequence

Parameters:
start - - start of the feature

getEnd

public int getEnd()
Get the end of the feature on the reference sequence

Returns:
end of feature

setEnd

public void setEnd(int end)
Set the end of the feature on the reference sequence

Parameters:
end - - end of feature

getStrand

public int getStrand()
Get the strand of the feature on the reference sequence

Returns:
strand of feature (-1: minus, 1: plus, 0: unknown)

getScore

public double getScore()
Get the feature score

Returns:
feature score

setScore

public void setScore(double score)
Set the feature score

Parameters:
score - - feature score

getPhase

public int getPhase()
Get the feature phase

Returns:
feature phase

setPhase

public void setPhase(int phase)
Set the feature phase

Parameters:
phase - - feature phase

isScoreSet

public boolean isScoreSet()
Checks whether the score has been set for this feature

Returns:
whether the score has been set for the feature

isPhaseSet

public boolean isPhaseSet()
Checks whether the phase has been set for this feature

Returns:
whether the phase has been set for the feature

getAttributeValues

public java.util.List<java.lang.String> getAttributeValues(java.lang.String attrName)
Get a list of attribute values for a given attribute name

Parameters:
attrName - - name of attribute
Returns:
list of attribute values for given attribute (null if does not exist)

addAttributeValue

public void addAttributeValue(java.lang.String name,
                              java.lang.String value)
Add an attribute

Parameters:
name - - attribute name
value - - attribute value

getAttributes

public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getAttributes()
Get all attributes

Returns:
all attributes for this entry

setId

public void setId(java.lang.String id)
Set the feature ID

Parameters:
id - - feature id

getId

public java.lang.String getId()
Get the feature ID

Returns:
feature id (null if not existent)

getName

public java.lang.String getName()
Get the feature name

Returns:
feature name (null if not existent)

isNameSet

public boolean isNameSet()
Check if the feature name is set

Returns:
whether the name is set

createFeature

public SeqFeatureI createFeature(OBOParser oboParser)
                          throws java.lang.ClassNotFoundException,
                                 java.lang.InstantiationException,
                                 java.lang.IllegalAccessException
Create the implementing class of AnnotatedFeatureI given the type

Parameters:
oboParser - - OBO parser to be used for mapping SO types to Apollo datamodel types
Returns:
a newly created AnnotatedFeatureI instance
Throws:
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException

toString

public java.lang.String toString()
Convert this entry object to a GFF3 tab delimited entry

Overrides:
toString in class java.lang.Object
Returns:
GFF3 tab delimited format

isOneLevelAnnotation

public boolean isOneLevelAnnotation()
Check to see if entry is for a one-level annotation

Returns:
is this entry for an one-level annotation

isThreeLevelAnnotation

public boolean isThreeLevelAnnotation()
Check to see if entry is for a three-level annotation

Returns:
is this entry for an three-level annotation

isAnnotation

public boolean isAnnotation()
Check whether this feature is annotation (evidence otherwise)

Returns:
whether this feature is annotation