Class: Bio::GFFbrowser::GFF3ParseFile

Inherits:
Object
  • Object
show all
Includes:
FastLineParser
Defined in:
lib/bio/db/gff/gff3parsefile.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from FastLineParser

#parse_attributes_fast, #parse_line_fast

Methods included from Helpers::Logger

#debug, #error, #info, #log_sys_info, #warn

Constructor Details

#initialize(fn) ⇒ GFF3ParseFile

Returns a new instance of GFF3ParseFile.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/bio/db/gff/gff3parsefile.rb', line 12

def initialize fn
  @records = []
  @sequences = []
  fh = File.open(fn) 
  fh.each_line do | line |
    s = line.strip
    if s == '##FASTA'
      break
    end
    next if s.length == 0 or s =~ /^#/
    @records.push FastLineRecord.new(parse_line_fast(s))
  end
  fasta = Bio::GFF::FastaReader.new(fh)
  fasta.each do | id, fastarec |
    @sequences.push FastaRecord.new(id,fastarec)
  end
end

Instance Attribute Details

#recordsObject (readonly)

Returns the value of attribute records.



8
9
10
# File 'lib/bio/db/gff/gff3parsefile.rb', line 8

def records
  @records
end

#sequencesObject (readonly)

Returns the value of attribute sequences.



8
9
10
# File 'lib/bio/db/gff/gff3parsefile.rb', line 8

def sequences
  @sequences
end