Class: Entrez::Gene
- Inherits:
-
Object
- Object
- Entrez::Gene
- Defined in:
- lib/rbbt/sources/entrez.rb
Instance Attribute Summary collapse
-
#aka ⇒ Object
readonly
Returns the value of attribute aka.
-
#comentaries ⇒ Object
readonly
Returns the value of attribute comentaries.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#organism ⇒ Object
readonly
Returns the value of attribute organism.
-
#protnames ⇒ Object
readonly
Returns the value of attribute protnames.
-
#summary ⇒ Object
readonly
Returns the value of attribute summary.
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
Instance Method Summary collapse
-
#initialize(xml) ⇒ Gene
constructor
A new instance of Gene.
-
#text ⇒ Object
Joins the text from symbol, description, aka, protnames, and summary.
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
#aka ⇒ Object (readonly)
Returns the value of attribute aka.
60 61 62 |
# File 'lib/rbbt/sources/entrez.rb', line 60 def aka @aka end |
#comentaries ⇒ Object (readonly)
Returns the value of attribute comentaries.
60 61 62 |
# File 'lib/rbbt/sources/entrez.rb', line 60 def comentaries @comentaries end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
60 61 62 |
# File 'lib/rbbt/sources/entrez.rb', line 60 def description @description end |
#organism ⇒ Object (readonly)
Returns the value of attribute organism.
60 61 62 |
# File 'lib/rbbt/sources/entrez.rb', line 60 def organism @organism end |
#protnames ⇒ Object (readonly)
Returns the value of attribute protnames.
60 61 62 |
# File 'lib/rbbt/sources/entrez.rb', line 60 def protnames @protnames end |
#summary ⇒ Object (readonly)
Returns the value of attribute summary.
60 61 62 |
# File 'lib/rbbt/sources/entrez.rb', line 60 def summary @summary end |
#symbol ⇒ Object (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
#text ⇒ Object
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 |