Module: Annotations::GO::Genecodis::Local

Defined in:
lib/MARQ/annotations.rb

Class Method Summary collapse

Class Method Details

.analysis(org, list, slim = false) ⇒ Object



405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
# File 'lib/MARQ/annotations.rb', line 405

def self.analysis(org,list, slim = false)
  require 'genecodis'

  gc_org = ORGS[org.to_s]
  if slim
    groups = ['GOSlim_Process']
  else
    groups = ['GO_Biological_Process']
  end

  job_id = Object::Genecodis.analyze(gc_org,2,0,-1,3,list,groups,nil)
  return [] if job_id.nil?

  while (stat = Object::Genecodis.status(job_id)) == 1
    sleep 0.5
  end

  if stat < 0
    return []
  else
    res =  Object::Genecodis.results(job_id)
    return [] if res.nil?
    lines = res.collect{|l| l.chomp}
    lines.shift
    lines.collect{|l| Hash[*FIELDS.zip(l.chomp.split(/\t/)).flatten]}
  end
rescue
  puts $!.message
  puts $!.backtrace
end