lib/bio/db/rebase.rb in bio-1.2.1 vs lib/bio/db/rebase.rb in bio-1.3.0
- old
+ new
@@ -3,19 +3,18 @@
#
# Author:: Trevor Wennblom <mailto:trevor@corevx.com>
# Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com)
# License:: The Ruby License
#
-# $Id: rebase.rb,v 1.8 2007/04/05 23:35:40 trevor Exp $
+# $Id:$
#
-autoload :YAML, 'yaml'
+require 'yaml'
+require 'bio/reference'
-module Bio #:nodoc:
+module Bio
-autoload :Reference, 'bio/reference'
-
#
# bio/db/rebase.rb - Interface for EMBOSS formatted REBASE files
#
# Author:: Trevor Wennblom <mailto:trevor@corevx.com>
# Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com)
@@ -314,11 +313,11 @@
# :c3 => Second 5' cut
# :c4 => Seocnd 3' cut
def parse_enzymes( lines )
data = {}
return data if lines == nil
- lines.each do |line|
+ lines.each_line do |line|
next if line[0].chr == '#'
line.chomp!
a = line.split("\s")
@@ -345,11 +344,11 @@
return data if lines == nil
index = 1
h = {}
references_left = 0
- lines.each do |line|
+ lines.each_line do |line|
next if line[0].chr == '#' # Comment
next if line[0..1] == '//' # End of entry marker
line.chomp!
if (1..7).include?( index )
@@ -387,10 +386,10 @@
# data[supplier_code]
# returns the suppliers name
def parse_suppliers( lines )
data = {}
return data if lines == nil
- lines.each do |line|
+ lines.each_line do |line|
next if line[0].chr == '#'
data[$1] = $2 if line =~ %r{(.+?)\s(.+)}
end
data
end