Method: Bio::UniProtKB#os
- Defined in:
- lib/bio/db/embl/uniprotkb.rb
#os(num = nil) ⇒ Object
returns a Array of Hashs or a String of the OS line when a key given.
-
Bio::EMBLDB#os -> Array
[{'name' => '(Human)', 'os' => 'Homo sapiens'},
{'name' => '(Rat)', 'os' => 'Rattus norveticus'}]
-
Bio::EPTR#os -> Hash
{'name' => "(Human)", 'os' => 'Homo sapiens'}
-
Bio::UniProtKB#os[‘name’] -> “(Human)”
-
Bio::EPTR#os(0) -> “Homo sapiens (Human)”
OS Line; organism species (>=1)
OS Genus species (name).
OS Genus species (name0) (name1).
OS Genus species (name0) (name1).
OS Genus species (name0), G s0 (name0), and G s (name0) (name1).
OS Homo sapiens (Human), and Rarrus norveticus (Rat)
OS Hippotis sp. Clark and Watts 825.
OS unknown cyperaceous sp.
470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 |
# File 'lib/bio/db/embl/uniprotkb.rb', line 470 def os(num = nil) unless @data['OS'] os = Array.new fetch('OS').split(/, and|, /).each do |tmp| if tmp =~ /(\w+ *[\w \:\'\+\-\.]+[\w\.])/ org = $1 tmp =~ /(\(.+\))/ os.push({'name' => $1, 'os' => org}) else raise "Error: OS Line. #{$!}\n#{fetch('OS')}\n" end end @data['OS'] = os end if num # EX. "Trifolium repens (white clover)" return "#{@data['OS'][num]['os']} #{@data['OS'][num]['name']}" else return @data['OS'] end end |