From 5e66ba7fb5c6dd9db89c7ff437e29597e6fc0ff1 Mon Sep 17 00:00:00 2001 From: cmzmasek Date: Tue, 30 Oct 2012 05:06:32 +0000 Subject: [PATCH] in progress --- .../evoruby/lib/evo/io/parser/uniprot_parser.rb | 46 ++++++++++++++++++-- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/forester/ruby/evoruby/lib/evo/io/parser/uniprot_parser.rb b/forester/ruby/evoruby/lib/evo/io/parser/uniprot_parser.rb index 1d6e5ab..06a08d4 100644 --- a/forester/ruby/evoruby/lib/evo/io/parser/uniprot_parser.rb +++ b/forester/ruby/evoruby/lib/evo/io/parser/uniprot_parser.rb @@ -23,8 +23,8 @@ module Evoruby DR = "DR" LAST = '//' - def initialize - + def initialize + end @@ -33,7 +33,7 @@ module Evoruby dr = [] id = nil lines.each do | line | - + if line.include?( ID ) && line.index( ID ) == 0 id = line.split[ 1 ] elsif id != nil @@ -91,7 +91,47 @@ module Evoruby ids end + def get_go_descriptions + gos = [] + if dr != nil + dr.each do | dr | + if dr != nil + if dr =~ /GO;\s+GO:\d+(.+);\s+([^;]+)/ + gos << $1 + end + end + end + end + gos + end + + def get_full_name + DE RecName: Full=Apoptosis regulator Bcl-2; + end + + + def get_reactome_descriptions + s = [] + if dr != nil + dr.each do | dr | + if dr != nil + if dr =~ /Reactome;\s+REACT_\d+;\s+([^.]+)/ + s << $1 + end + end + end + end + s + end + + end + + + + + + end # module Evoruby -- 1.7.10.2