Class: PositionedGene

Inherits:
Object
  • Object
show all
Defined in:
lib/jgi_genes.rb

Overview

A gene as read from the gff file. cds and exons are assumed to be in increasing order in terms of their positions along the positive strand.

Direct Known Subclasses

PositionedGeneWithOntology

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cdsObject

Returns the value of attribute cds.



137
138
139
# File 'lib/jgi_genes.rb', line 137

def cds
  @cds
end

#exonsObject

Returns the value of attribute exons.



137
138
139
# File 'lib/jgi_genes.rb', line 137

def exons
  @exons
end

#nameObject

Returns the value of attribute name.



137
138
139
# File 'lib/jgi_genes.rb', line 137

def name
  @name
end

#protein_idObject

Returns the value of attribute protein_id.



137
138
139
# File 'lib/jgi_genes.rb', line 137

def protein_id
  @protein_id
end

#seqnameObject

Returns the value of attribute seqname.



137
138
139
# File 'lib/jgi_genes.rb', line 137

def seqname
  @seqname
end

#startObject

Returns the value of attribute start.



137
138
139
# File 'lib/jgi_genes.rb', line 137

def start
  @start
end

#strandObject

Returns the value of attribute strand.



137
138
139
# File 'lib/jgi_genes.rb', line 137

def strand
  @strand
end

Instance Method Details

#cds_endObject



148
149
150
151
152
153
154
# File 'lib/jgi_genes.rb', line 148

def cds_end
  # If gene has no coding regions, I guess
  if !@cds[@cds.length-1]
    return nil
  end
  return @cds[@cds.length-1].to
end

#cds_startObject

Return the position of the cds end



140
141
142
143
144
145
146
# File 'lib/jgi_genes.rb', line 140

def cds_start
  # If gene has no coding regions, I guess
  if !@cds[0]
    return nil
  end
  return @cds[0].from
end

#positive_strand?Boolean

Returns:

  • (Boolean)


156
157
158
# File 'lib/jgi_genes.rb', line 156

def positive_strand?
  return @strand === '+'
end