Method: Bio::EMBL#ft

Defined in:
lib/bio/db/embl/embl.rb

#ftObject 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)



247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
# File 'lib/bio/db/embl/embl.rb', line 247

def ft
  unless @data['FT']
    @data['FT'] = Array.new
    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 |subary|
      parse_qualifiers(subary)
    end

    @data['FT'] = Features.new(ary)
  end
  if block_given?
    @data['FT'].each do |feature|
      yield feature
    end
  else
    @data['FT']
  end
end