Class: Bio::DB::Fasta::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/bio/db/fastadb.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, length) ⇒ Entry

Returns a new instance of Entry.



50
51
52
53
# File 'lib/bio/db/fastadb.rb', line 50

def initialize(id, length)
  @id=id
  @length=length.to_i
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



48
49
50
# File 'lib/bio/db/fastadb.rb', line 48

def id
  @id
end

#lengthObject (readonly)

Returns the value of attribute length.



48
49
50
# File 'lib/bio/db/fastadb.rb', line 48

def length
  @length
end

Instance Method Details

#get_full_regionObject Also known as: to_region



55
56
57
58
59
60
61
62
# File 'lib/bio/db/fastadb.rb', line 55

def get_full_region
  reg = Region.new
  reg.entry = id
  reg.start = 1
  reg.end = @length
  reg.orientation = :forward
  reg
end