Module: Annotations::UMLS

Defined in:
lib/MARQ/annotations.rb

Constant Summary collapse

SEMANTIC_TYPES =
"T020,T100,T116,T123,T023,T118,T043,T049,T103,T200,T060,T047,T203,T126,T050,T131,T125,T129,T037,T197,T191,T114,T110,T167,T024"

Class Method Summary collapse

Class Method Details

.OBA(text) ⇒ Object



598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
# File 'lib/MARQ/annotations.rb', line 598

def self.OBA(text)

  res = Net::HTTP.post_form(URI.parse('http://rest.bioontology.org/obs_hibernate/annotator'),
    {
      'longestOnly'=> true, 
      'wholeWordOnly'=> true,
      'withDefaultStopWords' => true,
      'scored' => true,
      'ontologiesToExpand' => 'null', 
      'ontologiesToKeepInResult' => "",
      'levelMax' => 0,
      'levelMin' => 0,
      'textToAnnotate' => text.gsub(/\s/,' '),
      'semanticTypes' => SEMANTIC_TYPES,
      'mappingTypes' => 'null',
      'format' => 'tabDelimited'
  })

  res.body.collect{|l| l.split(/\t/)}.select{|v| v[0].to_i > 0}.collect{|v| v[2].sub(/\W*NOS/,'').downcase}.select{|w| w !~ /^\d+$/}.sort.uniq
end