Class: BioInterchange::Genomics::GFF3Feature
- Inherits:
-
Object
- Object
- BioInterchange::Genomics::GFF3Feature
- Defined in:
- lib/biointerchange/genomics/gff3_feature.rb
Overview
Represents a single genomic feature of a GFF3 file.
Direct Known Subclasses
Constant Summary collapse
- NOT_STRANDED =
Constants determining the strand of the feature.
0
- UNKNOWN =
1
- POSITIVE =
2
- NEGATIVE =
3
Instance Method Summary collapse
-
#attributes ⇒ Object
Returns a map of additional attributes for this feature.
-
#end_coordinate ⇒ Object
Returns the end coordinate of the feature.
-
#initialize(sequence_id, source, type, start_coordinate, end_coordinate, score = nil, strand = NOT_STRANDED, phase = nil, attributes = {}) ⇒ GFF3Feature
constructor
Creates a new feature representation.
-
#phase ⇒ Object
Returns the phase, if existing, for this feature.
-
#score ⇒ Object
Returns the score of the feature.
-
#sequence_id ⇒ Object
Returns the sequence ID that determines the coordinate system for the feature.
-
#source ⇒ Object
Returns a textual description that determines the origin of this feature.
-
#start_coordinate ⇒ Object
Returns the start coordinate of the feature.
-
#strand ⇒ Object
Returns the strand the feature is located on.
-
#type ⇒ Object
Returns the feature type, which can either be a SOFA URI or a textual description otherwise.
Constructor Details
#initialize(sequence_id, source, type, start_coordinate, end_coordinate, score = nil, strand = NOT_STRANDED, phase = nil, attributes = {}) ⇒ GFF3Feature
Creates a new feature representation. A feature is described on one line of the GFF3 file.
sequence_id
-
an identifier that determines the coordinate system for the feature
source
-
a text description of the origin of this feature description
type
-
either a SOFA accession, SOFA term, or textual description (the former are URIs, the latter is a string)
start_coordinate
-
an integer denoting the start coordinate of the feature
end_coordinate
-
an integer denoting the end coordinate of the feature, which is equal or larger than the start coordinate
score
-
a floating point score
strand
-
a constant determining whether the feature is NOT_STRANDED, the strand is UNKNOWN, or the feature is on the POSITIVE or NEGATIVE strand
phase
-
an integer determining the phase of the feature, if the feature has a phase
attributes
-
a map of additional attributes associated with the feature
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/biointerchange/genomics/gff3_feature.rb', line 23 def initialize(sequence_id, source, type, start_coordinate, end_coordinate, score = nil, strand = NOT_STRANDED, phase = nil, attributes = {}) @sequence_id = sequence_id @source = source @type = type @start_coordinate = start_coordinate @end_coordinate = end_coordinate @score = score @strand = strand @phase = phase @attributes = attributes end |
Instance Method Details
#attributes ⇒ Object
Returns a map of additional attributes for this feature.
76 77 78 |
# File 'lib/biointerchange/genomics/gff3_feature.rb', line 76 def attributes @attributes.freeze end |
#end_coordinate ⇒ Object
Returns the end coordinate of the feature. The end coordinate is equal or larger than the start coordinate.
56 57 58 |
# File 'lib/biointerchange/genomics/gff3_feature.rb', line 56 def end_coordinate @end_coordinate end |
#phase ⇒ Object
Returns the phase, if existing, for this feature.
71 72 73 |
# File 'lib/biointerchange/genomics/gff3_feature.rb', line 71 def phase @phase end |
#score ⇒ Object
Returns the score of the feature. The score is a floating point number, which ideally is an E-value or P-value.
61 62 63 |
# File 'lib/biointerchange/genomics/gff3_feature.rb', line 61 def score @score end |
#sequence_id ⇒ Object
Returns the sequence ID that determines the coordinate system for the feature.
36 37 38 |
# File 'lib/biointerchange/genomics/gff3_feature.rb', line 36 def sequence_id @sequence_id end |
#source ⇒ Object
Returns a textual description that determines the origin of this feature.
41 42 43 |
# File 'lib/biointerchange/genomics/gff3_feature.rb', line 41 def source @source end |
#start_coordinate ⇒ Object
Returns the start coordinate of the feature. The start coordinate is equal or smaller than the end coordinate.
51 52 53 |
# File 'lib/biointerchange/genomics/gff3_feature.rb', line 51 def start_coordinate @start_coordinate end |
#strand ⇒ Object
Returns the strand the feature is located on.
66 67 68 |
# File 'lib/biointerchange/genomics/gff3_feature.rb', line 66 def strand @strand end |
#type ⇒ Object
Returns the feature type, which can either be a SOFA URI or a textual description otherwise.
46 47 48 |
# File 'lib/biointerchange/genomics/gff3_feature.rb', line 46 def type @type end |