| Class | Bio::GFF::GFF2 |
| In: |
lib/bio/db/gff.rb
|
| Parent: | GFF |
| VERSION | = | 2 |
| gff_version | [R] | GFF2 version string (String or nil). nil means "2". |
| metadata | [RW] | Metadata (except "#gff-version"). Must be an array of Bio::GFF::GFF2::MetaData objects. |
Creates a Bio::GFF::GFF2 object by building a collection of Bio::GFF::GFF2::Record (and metadata) objects.
Arguments:
| Returns: | Bio::GFF::GFF2 object |
# File lib/bio/db/gff.rb, line 822
822: def initialize(str = nil)
823: @gff_version = nil
824: @records = []
825: @metadata = []
826: parse(str) if str
827: end
Parses a GFF2 entries, and concatenated the parsed data.
Arguments:
| Returns: | self |
# File lib/bio/db/gff.rb, line 842
842: def parse(str)
843: # parses GFF lines
844: str.each_line do |line|
845: if /^\#\#([^\s]+)/ =~ line then
846: parse_metadata($1, line)
847: else
848: @records << GFF2::Record.new(line)
849: end
850: end
851: self
852: end