[BioRuby-cvs] bioruby/lib/bio/shell/plugin flatfile.rb,1.7,1.8

Katayama Toshiaki k at pub.open-bio.org
Sun Nov 27 21:08:24 EST 2005


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

Modified Files:
	flatfile.rb 
Log Message:
* directory preparation for bioflat is separated to bio/shell/core


Index: flatfile.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/plugin/flatfile.rb,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** flatfile.rb	25 Nov 2005 16:47:10 -0000	1.7
--- flatfile.rb	28 Nov 2005 02:08:22 -0000	1.8
***************
*** 89,107 ****
  
    def flatindex(dbname, *flatfiles)
!     prefix = Bio::Shell.create_save_dir + Core::BIOFLAT
!     idxdir = prefix + dbname.to_s
      begin
!       print "Creating BioFlat index (#{idxdir}) ... "
        bdb = format = options = nil
!       Bio::FlatFileIndex.makeindex(bdb, idxdir, format, options, *flatfiles)
        puts "done"
      rescue
!       warn "Error: Failed to create index (#{idxdir}) : #{$!}"
      end
    end
  
    def flatsearch(dbname, keyword)
!     dir = Core::SAVEDIR + Core::BIOFLAT + dbname.to_s
!     dir = Core::USERDIR + Core::BIOFLAT + dbname.to_s unless File.exists?(dir)
      Bio::FlatFileIndex.open(dir) do |db|
        if results = db.include?(keyword)
--- 89,109 ----
  
    def flatindex(dbname, *flatfiles)
!     dir = Bio::Shell.create_flat_dir(dbname)
      begin
!       print "Creating BioFlat index (#{dir}) ... "
        bdb = format = options = nil
!       Bio::FlatFileIndex.makeindex(bdb, dir, format, options, *flatfiles)
        puts "done"
      rescue
!       warn "Error: Failed to create index (#{dir}) : #{$!}"
      end
    end
  
    def flatsearch(dbname, keyword)
!     dir = Bio::Shell.find_flat_dir(dbname)
!     unless dir
!       warn "Error: Failed to open database (#{dbname})"
!       return
!     end
      Bio::FlatFileIndex.open(dir) do |db|
        if results = db.include?(keyword)
***************
*** 114,126 ****
      end
    end
- 
- =begin
-   def bioflat_namespaces(dbname)
-     dir = Core::SAVEDIR + Core::BIOFLAT + dbname.to_s
-     db = Bio::FlatFileIndex.open(dir)
-     display db.namespaces.inspect
-     db.close
-   end
- =end
  
  end
--- 116,119 ----



More information about the bioruby-cvs mailing list