[BioRuby-cvs] bioruby/lib/bio/shell/plugin entry.rb,1.4,1.5

Katayama Toshiaki k at pub.open-bio.org
Sat Jan 28 06:46:45 UTC 2006


Update of /home/repository/bioruby/bioruby/lib/bio/shell/plugin
In directory pub.open-bio.org:/tmp/cvs-serv4775/lib/bio/shell/plugin

Modified Files:
	entry.rb 
Log Message:
* entret/seqret commands in EMBOSS are supported
  * Bio::EMBOSS.seqret(usa), Bio::EMBOSS.entret(usa)
  * bioruby> seqret(usa), entret(usa)
* obj() method is added in addition to seq() and ent() methods.


Index: entry.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/plugin/entry.rb,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** entry.rb	7 Dec 2005 05:12:07 -0000	1.4
--- entry.rb	28 Jan 2006 06:46:43 -0000	1.5
***************
*** 67,84 ****
    #   * IO          -- IO object (first entry only)
    #   * "filename"  -- local file (first entry only)
!   #   * "db:entry"  -- local bioflat, OBDA, KEGG API
    def ent(arg)
      entry = ""
      db, entry_id = arg.to_s.strip.split(/:/)
      if arg.respond_to?(:gets) or File.exists?(arg)
        entry = flatfile(arg)
      elsif Bio::Shell.find_flat_dir(db)
        entry = flatsearch(db, entry_id)
      elsif obdadbs.include?(db)
        entry = obdaentry(db, entry_id)
      else
!       entry = bget(arg)
      end
      return entry
    end
  
--- 67,110 ----
    #   * IO          -- IO object (first entry only)
    #   * "filename"  -- local file (first entry only)
!   #   * "db:entry"  -- local BioFlat, OBDA, EMBOSS, KEGG API
    def ent(arg)
      entry = ""
      db, entry_id = arg.to_s.strip.split(/:/)
+ 
+     # local file
      if arg.respond_to?(:gets) or File.exists?(arg)
+       puts "Retrieving entry from file (#{arg})"
        entry = flatfile(arg)
+ 
+     # BioFlat in ./.bioruby/bioflat/ or ~/.bioinformatics/.bioruby/bioflat/
      elsif Bio::Shell.find_flat_dir(db)
+       puts "Retrieving entry from local BioFlat database (#{arg})"
        entry = flatsearch(db, entry_id)
+ 
+     # OBDA in ~/.bioinformatics/seqdatabase.ini
      elsif obdadbs.include?(db)
+       puts "Retrieving entry from OBDA (#{arg})"
        entry = obdaentry(db, entry_id)
+ 
      else
!       # EMBOSS USA in ~/.embossrc
!       str = entret(arg)
!       if $?.exitstatus == 0 and str.length != 0
!         puts "Retrieving entry from EMBOSS (#{arg})"
!         entry = str
! 
!       # KEGG API at http://www.genome.jp/kegg/soap/
!       else
!         puts "Retrieving entry from KEGG API (#{arg})"
!         entry = bget(arg)
!       end
      end
+ 
      return entry
+   end
+ 
+   def obj(arg)
+     str = ent(arg)
+     flatparse(str)
    end
  




More information about the bioruby-cvs mailing list