class Bio::FANTOM::MaXML::Annotations

Constants

Data_XPath

Public Instance Methods

[](*arg) click to toggle source
# File lib/bio/db/fantom.rb, line 302
def [](*arg)
  if arg[0].is_a?(String) and arg.size == 1 then
    get_by_qualifier(arg[0])
  else
    to_a[*arg]
  end
end
cds_start() click to toggle source
# File lib/bio/db/fantom.rb, line 310
def cds_start
  unless defined?(@cds_start)
    e = get_by_qualifier('cds_start')
    @cds_start = e ? e.anntext.to_i : nil
  end
  @cds_start
end
cds_stop() click to toggle source
# File lib/bio/db/fantom.rb, line 318
def cds_stop
  unless defined?(@cds_stop)
    e = get_by_qualifier('cds_stop')
    @cds_stop = e ? e.anntext.to_i : nil
  end
  @cds_stop
end
data_source() click to toggle source
# File lib/bio/db/fantom.rb, line 334
def data_source
  unless defined?(@data_source)
    e = get_by_qualifier('gene_name')
    @data_source = e ? e.datasrc[0] : nil
  end
  @data_source
end
each() { |x| ... } click to toggle source
# File lib/bio/db/fantom.rb, line 273
def each
  to_a.each { |x| yield x }
end
evidence() click to toggle source
# File lib/bio/db/fantom.rb, line 342
def evidence
  unless defined?(@evidence)
    e = get_by_qualifier('gene_name')
    @evidence = e ? e.evidence : nil
  end
  @evidence
end
gene_name() click to toggle source
# File lib/bio/db/fantom.rb, line 326
def gene_name
  unless defined?(@gene_name)
    e = get_by_qualifier('gene_name')
    @gene_name = e ? e.anntext : nil
  end
  @gene_name
end
get_all_by_qualifier(qstr) click to toggle source
# File lib/bio/db/fantom.rb, line 285
def get_all_by_qualifier(qstr)
  unless defined?(@hash)
    @hash = {}
  end
  unless @hash.member?(qstr) then
    @hash[qstr] = self.find_all do |x|
      x.qualifier == qstr
    end
  end
  @hash[qstr]
end
get_by_qualifier(qstr) click to toggle source
# File lib/bio/db/fantom.rb, line 297
def get_by_qualifier(qstr)
  a = get_all_by_qualifier(qstr)
  a ? a[0] : nil
end
to_a() click to toggle source
# File lib/bio/db/fantom.rb, line 277
def to_a
  unless defined?(@a)
    @a = @elem.get_elements('annotation')
    @a.collect! { |e| MaXML::Annotation.new(e) }
  end
  @a
end