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.



50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/rbbt/sources/entrez.rb', line 50

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.



48
49
50
# File 'lib/rbbt/sources/entrez.rb', line 48

def aka
  @aka
end

#comentariesObject (readonly)

Returns the value of attribute comentaries.



48
49
50
# File 'lib/rbbt/sources/entrez.rb', line 48

def comentaries
  @comentaries
end

#descriptionObject (readonly)

Returns the value of attribute description.



48
49
50
# File 'lib/rbbt/sources/entrez.rb', line 48

def description
  @description
end

#organismObject (readonly)

Returns the value of attribute organism.



48
49
50
# File 'lib/rbbt/sources/entrez.rb', line 48

def organism
  @organism
end

#protnamesObject (readonly)

Returns the value of attribute protnames.



48
49
50
# File 'lib/rbbt/sources/entrez.rb', line 48

def protnames
  @protnames
end

#summaryObject (readonly)

Returns the value of attribute summary.



48
49
50
# File 'lib/rbbt/sources/entrez.rb', line 48

def summary
  @summary
end

#symbolObject (readonly)

Returns the value of attribute symbol.



48
49
50
# File 'lib/rbbt/sources/entrez.rb', line 48

def symbol
  @symbol
end

Instance Method Details

#textObject

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



66
67
68
69
# File 'lib/rbbt/sources/entrez.rb', line 66

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