Class: Entrez::Gene

Inherits:
Object
  • Object
show all
Defined in:
lib/rbbt/sources/entrez.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml) ⇒ Gene

Returns a new instance of Gene.



62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/rbbt/sources/entrez.rb', line 62

def initialize(xml)
  return if xml.nil?

  @organism    = xml.scan(/<Org-ref_taxname>(.*)<\/Org-ref_taxname>/s)
  @symbol      = xml.scan(/<Gene-ref_locus>(.*)<\/Gene-ref_locus>/s)
  @description = xml.scan(/<Gene-ref_desc>(.*)<\/Gene-ref_desc>/s)
  @aka         = xml.scan(/<Gene-ref_syn_E>(.*)<\Gene-ref_syn_E>/s)
  @protnames   = xml.scan(/<Prot-ref_name_E>(.*)<\/Prot-ref_name_E>/s)
  @summary     = xml.scan(/<Entrezgene_summary>(.*)<\/Entrezgene_summary>/s)
  @comentaries = xml.scan(/<Gene-commentary_text>(.*)<\/Gene-commentary_text>/s)


end

Instance Attribute Details

#akaObject (readonly)

Returns the value of attribute aka.



60
61
62
# File 'lib/rbbt/sources/entrez.rb', line 60

def aka
  @aka
end

#comentariesObject (readonly)

Returns the value of attribute comentaries.



60
61
62
# File 'lib/rbbt/sources/entrez.rb', line 60

def comentaries
  @comentaries
end

#descriptionObject (readonly)

Returns the value of attribute description.



60
61
62
# File 'lib/rbbt/sources/entrez.rb', line 60

def description
  @description
end

#organismObject (readonly)

Returns the value of attribute organism.



60
61
62
# File 'lib/rbbt/sources/entrez.rb', line 60

def organism
  @organism
end

#protnamesObject (readonly)

Returns the value of attribute protnames.



60
61
62
# File 'lib/rbbt/sources/entrez.rb', line 60

def protnames
  @protnames
end

#summaryObject (readonly)

Returns the value of attribute summary.



60
61
62
# File 'lib/rbbt/sources/entrez.rb', line 60

def summary
  @summary
end

#symbolObject (readonly)

Returns the value of attribute symbol.



60
61
62
# File 'lib/rbbt/sources/entrez.rb', line 60

def symbol
  @symbol
end

Instance Method Details

#textObject

Joins the text from symbol, description, aka, protnames, and summary



78
79
80
81
# File 'lib/rbbt/sources/entrez.rb', line 78

def text
  #[@organism, @symbol, @description, @aka,  @protnames, @summary,@comentaries.join(". ")].join(". ") 
  [@symbol, @description, @aka,  @protnames, @summary].flatten.join(". ") 
end