class Bio::GenBank::Locus

Parses the LOCUS line and returns contents of the LOCUS record as a Bio::GenBank::Locus object. Locus object is created automatically when Bio::GenBank#locus, entry_id etc. methods are called.

Attributes

circular[RW]
date[RW]
division[RW]
entry_id[RW]
length[RW]
natype[RW]
strand[RW]

Public Class Methods

new(locus_line) click to toggle source
   # File lib/bio/db/genbank/genbank.rb
35 def initialize(locus_line)
36   if locus_line.empty?
37     # do nothing (just for empty or incomplete entry string)
38   elsif locus_line.length > 75                      # after Rel 126.0
39     @entry_id = locus_line[12..27].strip
40     @length   = locus_line[29..39].to_i
41     @strand   = locus_line[44..46].strip
42     @natype   = locus_line[47..52].strip
43     @circular = locus_line[55..62].strip
44     @division = locus_line[63..66].strip
45     @date     = locus_line[68..78].strip
46   else
47     @entry_id = locus_line[12..21].strip
48     @length   = locus_line[22..29].to_i
49     @strand   = locus_line[33..35].strip
50     @natype   = locus_line[36..39].strip
51     @circular = locus_line[42..51].strip
52     @division = locus_line[52..54].strip
53     @date     = locus_line[62..72].strip
54   end
55 end