Class: Bio::GFFbrowser::FastLineRecord

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

Overview

Using the fast line parser

Direct Known Subclasses

Bio::GFF::GFF3::FastParserFileRecord

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(fields) ⇒ FastLineRecord

Returns a new instance of FastLineRecord.



15
16
17
# File 'lib/bio/db/gff/gffrecord.rb', line 15

def initialize fields
  @fields = fields
end

Instance Method Details

#attributesObject



60
61
62
# File 'lib/bio/db/gff/gffrecord.rb', line 60

def attributes 
  @attributes_ ||= parse_attributes_fast(@fields[GFF3_ATTRIBUTES])
end

#commentObject



19
20
21
# File 'lib/bio/db/gff/gffrecord.rb', line 19

def comment
  false
end

#endObject



39
40
41
# File 'lib/bio/db/gff/gffrecord.rb', line 39

def end
  @end_ ||= @fields[GFF3_END].to_i
end

#featureObject Also known as: feature_type



51
52
53
# File 'lib/bio/db/gff/gffrecord.rb', line 51

def feature
  @feature_ ||= @fields[GFF3_TYPE]
end

#get_attribute(name) ⇒ Object



64
65
66
# File 'lib/bio/db/gff/gffrecord.rb', line 64

def get_attribute name
  attributes[name]
end

#idObject Also known as: entry_id



68
69
70
# File 'lib/bio/db/gff/gffrecord.rb', line 68

def id
  @id_ ||= attributes['ID']
end

#phaseObject Also known as: frame



29
30
31
# File 'lib/bio/db/gff/gffrecord.rb', line 29

def phase
  @phase_ ||= @fields[GFF3_PHASE].to_i
end

#scoreObject



43
44
45
# File 'lib/bio/db/gff/gffrecord.rb', line 43

def score
  @score_ ||= @fields[GFF3_SCORE].to_f
end

#seqidObject Also known as: seqname



23
24
25
# File 'lib/bio/db/gff/gffrecord.rb', line 23

def seqid
  @seqid_ ||= @fields[GFF3_SEQID]
end

#sourceObject



56
57
58
# File 'lib/bio/db/gff/gffrecord.rb', line 56

def source
  @fields[GFF3_SOURCE]
end

#startObject



35
36
37
# File 'lib/bio/db/gff/gffrecord.rb', line 35

def start
  @start_ ||= @fields[GFF3_START].to_i
end

#strandObject



47
48
49
# File 'lib/bio/db/gff/gffrecord.rb', line 47

def strand
  @fields[GFF3_STRAND]
end