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

Katayama Toshiaki k at pub.open-bio.org
Mon Nov 28 02:18:16 EST 2005


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

Modified Files:
	keggapi.rb 
Log Message:
* improved to use Bio::Shell::Private module for not for public methods


Index: keggapi.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/plugin/keggapi.rb,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** keggapi.rb	25 Nov 2005 16:07:55 -0000	1.4
--- keggapi.rb	28 Nov 2005 07:18:14 -0000	1.5
***************
*** 31,34 ****
--- 31,44 ----
  module Bio::Shell
  
+   module Private
+     def keeggapi_definition2tab(list)
+       ary = []
+       list.each do |entry|
+         ary << "#{entry.entry_id}:\t#{entry.definition}"
+       end
+       return ary
+     end
+   end
+ 
    private
  
***************
*** 40,51 ****
    end
  
-   def _definition(list)
-     ary = []
-     list.each do |entry|
-       ary << "#{entry.entry_id}:\t#{entry.definition}"
-     end
-     return ary
-   end
- 
    # DBGET
  
--- 50,53 ----
***************
*** 67,73 ****
        yield result
      else
!       display result
      end
-     return result
    end
  
--- 69,74 ----
        yield result
      else
!       return result
      end
    end
  
***************
*** 88,92 ****
    def keggdbs
      list = keggapi.list_databases
!     result = _definition(list).join("\n")
      display result
      return result
--- 89,93 ----
    def keggdbs
      list = keggapi.list_databases
!     result = Bio::Shell.keggapi_definition2tab(list).join("\n")
      display result
      return result
***************
*** 95,99 ****
    def keggorgs
      list = keggapi.list_organisms
!     result = _definition(list).sort.join("\n")
      display result
      return result
--- 96,100 ----
    def keggorgs
      list = keggapi.list_organisms
!     result = Bio::Shell.keggapi_definition2tab(list).sort.join("\n")
      display result
      return result
***************
*** 102,114 ****
    def keggpathways(org = "map")
      list = keggapi.list_pathways(org)
!     result = _definition(list).join("\n")
      display result
      return result
    end
  
!   #--
!   # *TODO* use kegg das instead?
!   #++
!   def kegggenome(org)
      result = ""
      require 'net/ftp'
--- 103,113 ----
    def keggpathways(org = "map")
      list = keggapi.list_pathways(org)
!     result = Bio::Shell.keggapi_definition2tab(list).join("\n")
      display result
      return result
    end
  
! =begin
!   def kegggenome(org)	# *TODO* use das instead?
      result = ""
      require 'net/ftp'
***************
*** 125,132 ****
      return result
    end
! 
! # def kegggene(genes_id)
! #    keggapi.bget()
! # end
  
  end
--- 124,128 ----
      return result
    end
! =end
  
  end



More information about the bioruby-cvs mailing list