Method: Bio::EMBL#ft
- Defined in:
- lib/bio/db/embl/embl.rb
#ft ⇒ Object Also known as: features
returns contents in the feature table (FT) lines.
-
Bio::EMBL#ft -> Bio::Features
-
Bio::EMBL#ft {} -> {|Bio::Feature| }
same as features method in bio/db/genbank.rb
FT Line; feature table data (>=0)
337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 |
# File 'lib/bio/db/embl/embl.rb', line 337 def ft unless @data['FT'] ary = Array.new in_quote = false @orig['FT'].each_line do |line| next if line =~ /^FEATURES/ #head = line[0,20].strip # feature key (source, CDS, ...) body = line[20,60].chomp # feature value (position, /qualifier=) if line =~ /^FT {3}(\S+)/ ary.push([ $1, body ]) # [ feature, position, /q="data", ... ] elsif body =~ /^ \// and not in_quote ary.last.push(body) # /q="data..., /q=data, /q if body =~ /=" / and body !~ /"$/ in_quote = true end else ary.last.last << body # ...data..., ...data..." if body =~ /"$/ in_quote = false end end end ary.map! do || parse_qualifiers() end @data['FT'] = ary.extend(Bio::Features::BackwardCompatibility) end if block_given? @data['FT'].each do |feature| yield feature end else @data['FT'] end end |