[BioRuby-cvs] bioruby/lib/bio/db medline.rb,1.16,1.17

Katayama Toshiaki k at dev.open-bio.org
Fri Dec 21 05:12:44 UTC 2007


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

Modified Files:
	medline.rb 
Log Message:
* added doi and pii methods to extract DOI and PII number from AID field


Index: medline.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/medline.rb,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** medline.rb	5 Apr 2007 23:35:40 -0000	1.16
--- medline.rb	21 Dec 2007 05:12:41 -0000	1.17
***************
*** 26,30 ****
  class MEDLINE < NCBIDB
  
-   # 
    def initialize(entry)
      @pubmed = Hash.new('')
--- 26,29 ----
***************
*** 38,41 ****
--- 37,41 ----
      end
    end
+   attr_reader :pubmed
  
  
***************
*** 188,197 ****
    alias affiliations ad
  
- 
-   ### Other MEDLINE tags
- 
    # AID  - Article Identifier
    #   Article ID values may include the pii (controlled publisher identifier)
    #   or doi (Digital Object Identifier).
  
    # CI   - Copyright Information
--- 188,203 ----
    alias affiliations ad
  
    # AID  - Article Identifier
    #   Article ID values may include the pii (controlled publisher identifier)
    #   or doi (Digital Object Identifier).
+   def doi
+     @pubmed['AID'][/(\S+) \[doi\]/, 1]
+   end
+ 
+   def pii
+     @pubmed['AID'][/(\S+) \[pii\]/, 1]
+   end
+ 
+   ### Other MEDLINE tags
  
    # CI   - Copyright Information




More information about the bioruby-cvs mailing list