[BioRuby-cvs] bioruby/lib/bio/db/embl common.rb,1.12,1.13

Naohisa Goto ngoto at dev.open-bio.org
Wed Apr 23 16:48:28 UTC 2008


Update of /home/repository/bioruby/bioruby/lib/bio/db/embl
In directory dev.open-bio.org:/tmp/cvs-serv12456/lib/bio/db/embl

Modified Files:
	common.rb 
Log Message:
Bug fix: Bio::EMBL#references failed to parse journal name, volume, issue,
pages, and year. In addition, it might failed to parse PubMed ID.


Index: common.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/embl/common.rb,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** common.rb	5 Apr 2007 23:35:40 -0000	1.12
--- common.rb	23 Apr 2008 16:48:25 -0000	1.13
***************
*** 279,294 ****
              hash['title'] = value
            when 'RL'
!             if value =~ /(.*) (\d+) \((\d+)\), (\d+-\d+) \((\d+)\)$/
!               hash['journal'] = $1
                hash['volume']  = $2
!               hash['issue']   = $3
!               hash['pages']   = $4
!               hash['year']    = $5
              else
                hash['journal'] = value
              end
            when 'RX'  # PUBMED, MEDLINE
!             value.split('.').each {|item|
!               tag, xref = item.split(/; /).map {|i| i.strip }
                hash[ tag.downcase ]  = xref
              }
--- 279,294 ----
              hash['title'] = value
            when 'RL'
!             if /(.*) (\d+) *(\(([^\)]+)\))?(\, |\:)([a-zA-Z\d]+\-[a-zA-Z\d]+) *\((\d+)\)\.?\z/ =~ value.to_s
!               hash['journal'] = $1.rstrip
                hash['volume']  = $2
!               hash['issue']   = $4
!               hash['pages']   = $6
!               hash['year']    = $7
              else
                hash['journal'] = value
              end
            when 'RX'  # PUBMED, MEDLINE
!             value.split(/\. /).each {|item|
!               tag, xref = item.split(/\; /).map {|i| i.strip.sub(/\.\z/, '') }
                hash[ tag.downcase ]  = xref
              }




More information about the bioruby-cvs mailing list