From k at dev.open-bio.org Mon Jul 9 04:48:06 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Mon, 09 Jul 2007 08:48:06 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg taxonomy.rb,NONE,1.1 Message-ID: <200707090848.l698m6IP029799@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg In directory dev.open-bio.org:/tmp/cvs-serv29795 Added Files: taxonomy.rb Log Message: * Bio::KEGG::Taxonomy class which treats taxonomyc tree structure of the KEGG taxonomy file available at ftp.genome.jp/pub/kegg/genes/taxonomy which is a replacement of the previously keggtab file (Bio::KEGG::Keggtab). --- NEW FILE: taxonomy.rb --- # # = bio/db/kegg/taxonomy.rb - KEGG taxonomy parser class # # Copyright:: Copyright (C) 2007 Toshiaki Katayama # License:: The Ruby License # # $Id: taxonomy.rb,v 1.1 2007/07/09 08:48:03 k Exp $ # module Bio class KEGG # == Description # # Parse the KEGG 'taxonomy' file which describes taxonomic classification # of organisms. # # == References # # The KEGG 'taxonomy' file is available at # # * ftp://ftp.genome.jp/pub/kegg/genes/taxonomy # class Taxonomy def initialize(filename, orgs = []) @tree = Hash.new @path = Array.new @leaves = Hash.new # ?????????????? Genes ?????? @root = 'Genes' hier = Array.new level = 0 label = nil File.open(filename).each do |line| next if line.strip.empty? # ?????????????????? - # ???????????????????????????????? if line[/^#/] level = line[/^#+/].length label = line[/[A-z].*/] hier[level] = sanitize(label) # ?????????????? - ?????????????????????????????????????????? else tax, org, name, desc = line.chomp.split("\t") if orgs.nil? or orgs.empty? or orgs.include?(org) species, strain, = name.split('_') # (0) species ???????????????????????????????????????????????? # Gamma/enterobacteria ?????????????????????????????????????? # ?????????????????????????????????????????????????????????? # ex. E.coli, H.influenzae ???? # ?????????????????? # ???? species ????????????????????### ?????????????????????????????? # Tree ?? Hash ?????????????????????????????????????????? # (1) species ?????????????????????????????????????????? # ?? ?????????? species ???? _sp ???????????????????????????? (1-1) # ?????? _sp ???????????????????? strain ???????? (1-2) # ex. Bacteria/Proteobacteria/Beta/T.denitrificans/tbd ?? # Bacteria/Proteobacteria/Epsilon/T.denitrificans_ATCC33889/tdn # -> Bacteria/Proteobacteria/Beta/T.denitrificans/tbd ?? # Bacteria/Proteobacteria/Epsilon/T.denitrificans_sp/tdn # (2) species ?????????????????????????????? # ?? ?????????? species ???? _sp ???????????????????????????? # ex. Bacteria/Cyanobacgteria/Cyanobacteria_CYA/cya # Bacteria/Cyanobacgteria/Cyanobacteria_CYB/cya # Bacteria/Proteobacteria/Magnetococcus/Magnetococcus_MC1/mgm # -> Bacteria/Cyanobacgteria/Cyanobacteria_sp/cya # Bacteria/Cyanobacgteria/Cyanobacteria_sp/cya # Bacteria/Proteobacteria/Magnetococcus/Magnetococcus_sp/mgm sp_group = "#{species}_sp" if @tree[species] if hier[level+1] == species # case (0) else # case (1-1) species = sp_group # case (1-2) if @tree[sp_group] and hier[level+1] != species species = name end end else if hier[level] == species # case (2) species = sp_group end end # hier ?? [nil, Eukaryotes, Fungi, Ascomycetes, Saccharomycetes] ?? # species ?? org ?? [S_cerevisiae, sce] ???????????? hier[level+1] = species #hier[level+1] = sanitize(species) hier[level+2] = org ary = hier[1, level+2] warn ary.inspect if $DEBUG add_to_tree(ary) add_to_leaves(ary) add_to_path(ary) end end end return tree end attr_reader :tree attr_reader :path attr_reader :leaves attr_accessor :root def organisms(group) @leaves[group] end # root ???????????? [node, subnode, subsubnode, ..., leaf] ???????????? # ???????????????????????????????????? def add_to_tree(ary) parent = @root ary.each do |node| @tree[parent] ||= Hash.new @tree[parent][node] = nil parent = node end end # ?????????????????????????????????????????? def add_to_leaves(ary) leaf = ary.last ary.each do |node| @leaves[node] ||= Array.new @leaves[node] << leaf end end # ???????????????????????????? def add_to_path(ary) @path << ary end # ?????????????????????????????????????????????????????????????? # ?????????????????????????????????????????????????? # # ex. # Plants / Monocotyledons / grass family / osa --> Plants / Monocotyledons / osa # def compact(node = root) # ?????????????? if subnodes = @tree[node] # ?????????????????????????? subnodes.keys.each do |subnode| # ?????????????? if subsubnodes = @tree[subnode] # ?????????????? 1 ???????? if subsubnodes.keys.size == 1 # ???????????????????? subsubnode = subsubnodes.keys.first # ???????????????????? if subsubsubnodes = @tree[subsubnode] # ???????????????????????????????????????? @tree[subnode] = subsubsubnodes # ?????????????? @tree[subnode].delete(subsubnode) warn "--- compact: #{subsubnode} is replaced by #{subsubsubnodes}" if $DEBUG # ?????????????????? compact ?????????????????????????????? retry end end end # ???????????????????????????? compact(subnode) end end end # ???????????????????????????????????????????????????????????? # # ex. # Plants / Monocotyledons / osa --> Plants / osa # def reduce(node = root) # ?????????????? if subnodes = @tree[node] # ?????????????????????????? subnodes.keys.each do |subnode| # ?????????????? if subsubnodes = @tree[subnode] # ?????????????? 1 ???????? if subsubnodes.keys.size == 1 # ???????????????????? subsubnode = subsubnodes.keys.first # ?????????????????????? unless @tree[subsubnode] # ???????????????????????????? @tree[node].update(subsubnodes) # ?????????????? @tree[node].delete(subnode) warn "--- reduce: #{subnode} is replaced by #{subsubnode}" if $DEBUG end end end # ???????????????????????????? reduce(subnode) end end end # ??????????????????????????????????????Hash?????????????? # ?????????????????????????????????? def dfs(parent, &block) if children = @tree[parent] yield parent, children children.keys.each do |child| dfs(child, &block) end end end # ?????????????????????????????????????? def dfs_with_level(parent, &block) @level ||= 0 if children = @tree[parent] yield parent, children, @level @level += 1 children.keys.each do |child| dfs_with_level(child, &block) end @level -= 1 end end # ???????????????????????????????????? def to_s result = "#{@root}\n" @tree[@root].keys.each do |node| result += subtree(node, " ") end return result end private # ???? to_s ?????????????????? def subtree(node, indent) result = "#{indent}+- #{node}\n" indent += " " @tree[node].keys.each do |child| if @tree[child] result += subtree(child, indent) else result += "#{indent}+- #{child}\n" end end return result end def sanitize(str) str.gsub(/[^A-z0-9]/, '_') end end # Taxonomy end # KEGG end # Bio if __FILE__ == $0 # Usage: # % wget ftp://ftp.genome.jp/pub/kegg/genes/taxonomy # % ruby taxonomy.rb taxonomy | less -S taxonomy = ARGV.shift org_list = ARGV.shift || nil if org_list orgs = File.readlines(org_list).map{|x| x.strip} else orgs = nil end tree = Bio::KEGG::Taxonomy.new(taxonomy, orgs) puts ">>> tree - original" puts tree puts ">>> tree - after compact" tree.compact puts tree puts ">>> tree - after reduce" tree.reduce puts tree puts ">>> path - sorted" tree.path.sort.each do |path| puts path.join("/") end puts ">>> group : orgs" tree.dfs(tree.root) do |parent, children| if orgs = tree.organisms(parent) puts "#{parent.ljust(30)} (#{orgs.size})\t#{orgs.join(', ')}" end end puts ">>> group : subgroups" tree.dfs_with_level(tree.root) do |parent, children, level| subgroups = children.keys.sort indent = " " * level label = "#{indent} #{level} #{parent}" puts "#{label.ljust(35)}\t#{subgroups.join(', ')}" end end From k at dev.open-bio.org Mon Jul 9 04:49:17 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Mon, 09 Jul 2007 08:49:17 +0000 Subject: [BioRuby-cvs] bioruby/lib bio.rb,1.84,1.85 Message-ID: <200707090849.l698nHpo029821@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib In directory dev.open-bio.org:/tmp/cvs-serv29817 Modified Files: bio.rb Log Message: * Bio:KEGG::Keggtab is obsoleted. Use Bio::KEGG::Taxonomy instead. Index: bio.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio.rb,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** bio.rb 5 Apr 2007 23:35:39 -0000 1.84 --- bio.rb 9 Jul 2007 08:49:15 -0000 1.85 *************** *** 97,101 **** autoload :ORTHOLOGY, 'bio/db/kegg/orthology' autoload :KGML, 'bio/db/kegg/kgml' ! autoload :Keggtab, 'bio/db/kegg/keggtab' end --- 97,101 ---- autoload :ORTHOLOGY, 'bio/db/kegg/orthology' autoload :KGML, 'bio/db/kegg/kgml' ! autoload :Taxonomy, 'bio/db/kegg/taxonomy' end From k at dev.open-bio.org Mon Jul 9 06:29:18 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Mon, 09 Jul 2007 10:29:18 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg taxonomy.rb,1.1,1.2 Message-ID: <200707091029.l69ATIbX029957@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg In directory dev.open-bio.org:/tmp/cvs-serv29953 Modified Files: taxonomy.rb Log Message: * Comments translated into English. Index: taxonomy.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/taxonomy.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** taxonomy.rb 9 Jul 2007 08:48:03 -0000 1.1 --- taxonomy.rb 9 Jul 2007 10:29:16 -0000 1.2 *************** *** 25,33 **** def initialize(filename, orgs = []) @tree = Hash.new @path = Array.new @leaves = Hash.new ! # ?????????????? Genes ?????? @root = 'Genes' --- 25,39 ---- def initialize(filename, orgs = []) + # Stores the taxonomic tree as a linked list (implemented in Hash), so + # every node need to have unique name (key) to work correctly @tree = Hash.new + + # Also stores the taxonomic tree as a list of arrays (full path) @path = Array.new + + # Also stores all leaf nodes (organism codes) of every intermediate nodes @leaves = Hash.new ! # tentative name for the root node (use accessor to change) @root = 'Genes' *************** *** 39,43 **** next if line.strip.empty? ! # ?????????????????? - # ???????????????????????????????? if line[/^#/] level = line[/^#+/].length --- 45,49 ---- next if line.strip.empty? ! # line for taxonomic hierarchy (indent according to the number of # marks) if line[/^#/] level = line[/^#+/].length *************** *** 45,69 **** hier[level] = sanitize(label) ! # ?????????????? - ?????????????????????????????????????????? else tax, org, name, desc = line.chomp.split("\t") if orgs.nil? or orgs.empty? or orgs.include?(org) species, strain, = name.split('_') ! # (0) species ???????????????????????????????????????????????? ! # Gamma/enterobacteria ?????????????????????????????????????? ! # ?????????????????????????????????????????????????????????? ! # ex. E.coli, H.influenzae ???? ! # ?????????????????? ! # ???? species ????????????????????### ?????????????????????????????? ! # Tree ?? Hash ?????????????????????????????????????????? ! # (1) species ?????????????????????????????????????????? ! # ?? ?????????? species ???? _sp ???????????????????????????? (1-1) ! # ?????? _sp ???????????????????? strain ???????? (1-2) ! # ex. Bacteria/Proteobacteria/Beta/T.denitrificans/tbd ?? # Bacteria/Proteobacteria/Epsilon/T.denitrificans_ATCC33889/tdn ! # -> Bacteria/Proteobacteria/Beta/T.denitrificans/tbd ?? # Bacteria/Proteobacteria/Epsilon/T.denitrificans_sp/tdn ! # (2) species ?????????????????????????????? ! # ?? ?????????? species ???? _sp ???????????????????????????? # ex. Bacteria/Cyanobacgteria/Cyanobacteria_CYA/cya # Bacteria/Cyanobacgteria/Cyanobacteria_CYB/cya --- 51,79 ---- hier[level] = sanitize(label) ! # line for organims name (unify different strains of a species) else tax, org, name, desc = line.chomp.split("\t") if orgs.nil? or orgs.empty? or orgs.include?(org) species, strain, = name.split('_') ! # (0) Grouping of the strains of the same species. ! # If the name of species is the same as the previous line, ! # add the species to the same species group. ! # ex. Gamma/enterobacteria has a large number of organisms, ! # so sub grouping of strains is needed for E.coli strains etc. ! # ! # However, if the species name is already used, need to avoid ! # collision of species name as the current implementation stores ! # the tree as a Hash, which may cause the infinite loop. ! # ! # (1) If species name == the intermediate node of other lineage ! # Add '_sp' to the species name to avoid the conflict (1-1), and if ! # 'species_sp' is already taken, use 'species_strain' instead (1-2). ! # ex. Bacteria/Proteobacteria/Beta/T.denitrificans/tbd # Bacteria/Proteobacteria/Epsilon/T.denitrificans_ATCC33889/tdn ! # -> Bacteria/Proteobacteria/Beta/T.denitrificans/tbd # Bacteria/Proteobacteria/Epsilon/T.denitrificans_sp/tdn ! # ! # (2) If species name == the intermediate node of the same lineage ! # Add '_sp' to the species name to avoid the conflict. # ex. Bacteria/Cyanobacgteria/Cyanobacteria_CYA/cya # Bacteria/Cyanobacgteria/Cyanobacteria_CYB/cya *************** *** 90,97 **** end end ! # hier ?? [nil, Eukaryotes, Fungi, Ascomycetes, Saccharomycetes] ?? ! # species ?? org ?? [S_cerevisiae, sce] ???????????? ! hier[level+1] = species ! #hier[level+1] = sanitize(species) hier[level+2] = org ary = hier[1, level+2] --- 100,107 ---- end end ! # 'hier' is an array of the taxonomic tree + species and strain name. ! # ex. [nil, Eukaryotes, Fungi, Ascomycetes, Saccharomycetes] + ! # [S_cerevisiae, sce] ! hier[level+1] = species # sanitize(species) hier[level+2] = org ary = hier[1, level+2] *************** *** 115,120 **** end ! # root ???????????? [node, subnode, subsubnode, ..., leaf] ???????????? ! # ???????????????????????????????????? def add_to_tree(ary) parent = @root --- 125,130 ---- end ! # Add a new path [node, subnode, subsubnode, ..., leaf] under the root node ! # and every intermediate nodes stores their child nodes as a Hash. def add_to_tree(ary) parent = @root *************** *** 126,130 **** end ! # ?????????????????????????????????????????? def add_to_leaves(ary) leaf = ary.last --- 136,141 ---- end ! # Add a new path [node, subnode, subsubnode, ..., leaf] under the root node ! # and stores leaf nodes to the every intermediate nodes as an Array. def add_to_leaves(ary) leaf = ary.last *************** *** 135,173 **** end ! # ???????????????????????????? def add_to_path(ary) @path << ary end ! # ?????????????????????????????????????????????????????????????? ! # ?????????????????????????????????????????????????? ! # ! # ex. ! # Plants / Monocotyledons / grass family / osa --> Plants / Monocotyledons / osa # def compact(node = root) ! # ?????????????? if subnodes = @tree[node] ! # ?????????????????????????? subnodes.keys.each do |subnode| - # ?????????????? if subsubnodes = @tree[subnode] ! # ?????????????? 1 ???????? if subsubnodes.keys.size == 1 ! # ???????????????????? subsubnode = subsubnodes.keys.first ! # ???????????????????? if subsubsubnodes = @tree[subsubnode] ! # ???????????????????????????????????????? @tree[subnode] = subsubsubnodes ! # ?????????????? @tree[subnode].delete(subsubnode) warn "--- compact: #{subsubnode} is replaced by #{subsubsubnodes}" if $DEBUG ! # ?????????????????? compact ?????????????????????????????? retry end end end ! # ???????????????????????????? compact(subnode) end --- 146,185 ---- end ! # Add a new path [node, subnode, subsubnode, ..., leaf] under the root node ! # and stores the path itself in an Array. def add_to_path(ary) @path << ary end ! # Compaction of intermediate nodes of the resulted taxonomic tree. ! # - If child node has only one child node (grandchild), make the child of ! # grandchild as a grandchild. ! # ex. ! # Plants / Monocotyledons / grass family / osa ! # --> Plants / Monocotyledons / osa # def compact(node = root) ! # if the node has children if subnodes = @tree[node] ! # obtain grandchildren for each child subnodes.keys.each do |subnode| if subsubnodes = @tree[subnode] ! # if the number of grandchild node is 1 if subsubnodes.keys.size == 1 ! # obtain the name of the grandchild node subsubnode = subsubnodes.keys.first ! # obtain the child of the grandchlid node if subsubsubnodes = @tree[subsubnode] ! # make the child of grandchild node as a chlid of child node @tree[subnode] = subsubsubnodes ! # delete grandchild node @tree[subnode].delete(subsubnode) warn "--- compact: #{subsubnode} is replaced by #{subsubsubnodes}" if $DEBUG ! # retry until new grandchild also needed to be compacted. retry end end end ! # repeat recurseively compact(subnode) end *************** *** 175,199 **** end ! # ???????????????????????????????????????????????????????????? ! # ! # ex. ! # Plants / Monocotyledons / osa --> Plants / osa # def reduce(node = root) ! # ?????????????? if subnodes = @tree[node] ! # ?????????????????????????? subnodes.keys.each do |subnode| - # ?????????????? if subsubnodes = @tree[subnode] ! # ?????????????? 1 ???????? if subsubnodes.keys.size == 1 ! # ???????????????????? subsubnode = subsubnodes.keys.first ! # ?????????????????????? unless @tree[subsubnode] ! # ???????????????????????????? @tree[node].update(subsubnodes) ! # ?????????????? @tree[node].delete(subnode) warn "--- reduce: #{subnode} is replaced by #{subsubnode}" if $DEBUG --- 187,212 ---- end ! # Reduction of the leaf node of the resulted taxonomic tree. ! # - If the parent node have only one leaf node, replace parent node ! # with the leaf node. ! # ex. ! # Plants / Monocotyledons / osa ! # --> Plants / osa # def reduce(node = root) ! # if the node has children if subnodes = @tree[node] ! # obtain grandchildren for each child subnodes.keys.each do |subnode| if subsubnodes = @tree[subnode] ! # if the number of grandchild node is 1 if subsubnodes.keys.size == 1 ! # obtain the name of the grandchild node subsubnode = subsubnodes.keys.first ! # if the grandchild node is a leaf node unless @tree[subsubnode] ! # make the grandchild node as a child node @tree[node].update(subsubnodes) ! # delete child node @tree[node].delete(subnode) warn "--- reduce: #{subnode} is replaced by #{subsubnode}" if $DEBUG *************** *** 201,205 **** end end ! # ???????????????????????????? reduce(subnode) end --- 214,218 ---- end end ! # repeat recursively reduce(subnode) end *************** *** 207,212 **** end ! # ??????????????????????????????????????Hash?????????????? ! # ?????????????????????????????????? def dfs(parent, &block) if children = @tree[parent] --- 220,225 ---- end ! # Traverse the taxonomic tree by the depth first search method ! # under the given (root or intermediate) node. def dfs(parent, &block) if children = @tree[parent] *************** *** 218,222 **** end ! # ?????????????????????????????????????? def dfs_with_level(parent, &block) @level ||= 0 --- 231,236 ---- end ! # Similar to the dfs method but also passes the current level of the nest ! # to the iterator. def dfs_with_level(parent, &block) @level ||= 0 *************** *** 231,239 **** end ! # ???????????????????????????????????? def to_s result = "#{@root}\n" @tree[@root].keys.each do |node| ! result += subtree(node, " ") end return result --- 245,253 ---- end ! # Convert the taxonomic tree structure to a simple ascii art. def to_s result = "#{@root}\n" @tree[@root].keys.each do |node| ! result += ascii_tree(node, " ") end return result *************** *** 242,252 **** private ! # ???? to_s ?????????????????? ! def subtree(node, indent) result = "#{indent}+- #{node}\n" indent += " " @tree[node].keys.each do |child| if @tree[child] ! result += subtree(child, indent) else result += "#{indent}+- #{child}\n" --- 256,266 ---- private ! # Helper method for the to_s method. ! def ascii_tree(node, indent) result = "#{indent}+- #{node}\n" indent += " " @tree[node].keys.each do |child| if @tree[child] ! result += ascii_tree(child, indent) else result += "#{indent}+- #{child}\n" From k at dev.open-bio.org Mon Jul 9 07:14:31 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Mon, 09 Jul 2007 11:14:31 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby bioruby_generator.rb, 1.3, 1.4 Message-ID: <200707091114.l69BEVEW030108@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby In directory dev.open-bio.org:/tmp/cvs-serv30101 Modified Files: bioruby_generator.rb Log Message: * Completely new design for BioRuby shell on Rails translated from the 'DibdoltRed' theme on www.openwebdesign.org which is created by Darjan Panic and Brian Green as a public domain work. Index: bioruby_generator.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/bioruby_generator.rb,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** bioruby_generator.rb 28 Jun 2007 10:56:25 -0000 1.3 --- bioruby_generator.rb 9 Jul 2007 11:14:29 -0000 1.4 *************** *** 21,24 **** --- 21,26 ---- m.file 'bioruby.png', 'public/images/bioruby.png' m.file 'bioruby.gif', 'public/images/bioruby.gif' + m.file 'bg.gif', 'public/images/bg.gif' + m.file 'console.png', 'public/images/console.png' m.file 'bioruby.css', 'public/stylesheets/bioruby.css' end From k at dev.open-bio.org Mon Jul 9 07:14:31 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Mon, 09 Jul 2007 11:14:31 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates bg.gif, NONE, 1.1 console.png, NONE, 1.1 _classes.rhtml, 1.1, 1.2 _log.rhtml, 1.1, 1.2 _methods.rhtml, 1.2, 1.3 _modules.rhtml, 1.1, 1.2 bioruby.css, 1.4, 1.5 bioruby.rhtml, 1.3, 1.4 bioruby_controller.rb, 1.5, 1.6 commands.rhtml, 1.1, 1.2 index.rhtml, 1.3, 1.4 Message-ID: <200707091114.l69BEV4Z030111@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates In directory dev.open-bio.org:/tmp/cvs-serv30101/templates Modified Files: _classes.rhtml _log.rhtml _methods.rhtml _modules.rhtml bioruby.css bioruby.rhtml bioruby_controller.rb commands.rhtml index.rhtml Added Files: bg.gif console.png Log Message: * Completely new design for BioRuby shell on Rails translated from the 'DibdoltRed' theme on www.openwebdesign.org which is created by Darjan Panic and Brian Green as a public domain work. Index: _classes.rhtml =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/_classes.rhtml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** _classes.rhtml 24 Dec 2006 08:27:15 -0000 1.1 --- _classes.rhtml 9 Jul 2007 11:14:29 -0000 1.2 *************** *** 1,2 **** --- 1,4 ---- [ <%= @class %> ] +
<%= @classes.map{ |x| reference_link(x) }.join(" > ") %> +
\ No newline at end of file Index: commands.rhtml =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/commands.rhtml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** commands.rhtml 24 Dec 2006 08:27:15 -0000 1.1 --- commands.rhtml 9 Jul 2007 11:14:29 -0000 1.2 *************** *** 1,2 **** --- 1,3 ---- +

BioRuby shell commands

! --- 6,8 ---- <% end %> !
\ No newline at end of file Index: bioruby_controller.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/bioruby_controller.rb,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** bioruby_controller.rb 28 Jun 2007 10:56:25 -0000 1.5 --- bioruby_controller.rb 9 Jul 2007 11:14:29 -0000 1.6 *************** *** 4,17 **** HIDE_MODULES = [ ! ActiveSupport::CoreExtensions::String::Iterators, ! ActiveSupport::CoreExtensions::String::StartsEndsWith, ! ActiveSupport::CoreExtensions::String::Inflections, ! ActiveSupport::CoreExtensions::String::Conversions, ! ActiveSupport::CoreExtensions::String::Access, ! ActiveSupport::CoreExtensions::String::Unicode, ! ActiveSupport::CoreExtensions::Numeric::Bytes, ! ActiveSupport::CoreExtensions::Numeric::Time, ! Base64::Deprecated, Base64, PP::ObjectMixin, ! Bio::Shell ] HIDE_MODULES << WEBrick if defined?(WEBrick) --- 4,8 ---- HIDE_MODULES = [ ! Base64::Deprecated, Base64, PP::ObjectMixin, Bio::Shell, ] HIDE_MODULES << WEBrick if defined?(WEBrick) *************** *** 63,67 **** script, result, output = Bio::Shell.cache[:results].restore(number) @class = result.class ! @methods = result.methods - HIDE_METHODS render :update do |page| --- 54,58 ---- script, result, output = Bio::Shell.cache[:results].restore(number) @class = result.class ! @methods = (result.methods - HIDE_METHODS).sort render :update do |page| Index: _modules.rhtml =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/_modules.rhtml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** _modules.rhtml 24 Dec 2006 08:27:15 -0000 1.1 --- _modules.rhtml 9 Jul 2007 11:14:29 -0000 1.2 *************** *** 1,2 **** [ <%= @class %> ] ! <%= @modules.map {|x| reference_link(x) }.join(" | ") %> --- 1,4 ---- [ <%= @class %> ] !
! <%= @modules.map {|x| reference_link(x) }.sort.join("
") %> !
\ No newline at end of file Index: bioruby.css =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/bioruby.css,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** bioruby.css 28 Mar 2007 09:21:45 -0000 1.4 --- bioruby.css 9 Jul 2007 11:14:29 -0000 1.5 *************** *** 2,8 **** body { ! color: #6e8377; ! background-color: #ffffff; ! font-family: verdana, arial, helvetica, sans-serif; } --- 2,50 ---- body { ! margin: 0; ! color: #555555; ! background: url("/images/bg.gif") repeat-y center; ! font-family: "trebuchet ms", verdana, arial, helvetica, sans-serif; ! font-size: 12px; ! } ! ! div#content { ! width: 750px; ! height: auto; ! margin: 0 auto 0 auto; ! text-align: left; ! } ! ! /* title */ ! ! div#title { ! width: 550px; ! padding-right: 200px; ! margin-bottom: 20px; ! text-align: left; ! background: url("/images/bioruby.png") no-repeat left bottom; ! } ! ! div#title .titletop { ! color: #736451; ! font-size: 30px; ! font-weight: normal; ! text-align: left; ! text-indent: 70px; ! margin: 0; ! padding: 0; ! padding-top: 20px; ! margin-bottom: 10px; ! } ! ! div#title .titlesub { ! color: #000000; ! font-size: 15px; ! font-weight: normal; ! text-align: left; ! text-indent: 70px; ! margin: 0; ! padding: 0; ! border-bottom: 1px solid #eeeeee; } *************** *** 10,14 **** div#main { ! width: 700px; background-color: #ffffff; padding-top: 0px; --- 52,56 ---- div#main { ! width: 550px; background-color: #ffffff; padding-top: 0px; *************** *** 20,23 **** --- 62,66 ---- border: 1px solid #f00; } + div#notice p { margin: 0; *************** *** 32,38 **** --- 75,89 ---- border-width: 1px; padding: 5px; + width: 500px; overflow: auto; } + div.log { + width: 500px; + margin-top: 15px; + padding-top: 5px; + border-top: 1px dotted #333333; + } + div.log div.input pre.script { background-color: #ffffeb; *************** *** 66,73 **** } ! div.log hr.result { border-style: dotted none none none; border-top-width: 1px; border-color: #6e8377; height: 1px; } --- 117,125 ---- } ! div.log hr.log { border-style: dotted none none none; border-top-width: 1px; border-color: #6e8377; + width: 200px; height: 1px; } *************** *** 77,88 **** div#side { width: 150px; ! background-color: #ffffff; ! position: absolute; ! top: 10px; ! left: 10px; } div#side div.title { border-width: 0px 0px 1px 0px; } --- 129,169 ---- div#side { width: 150px; ! float: right; ! margin-top: 20px; ! text-align: left; ! font-size: 12px; ! color: #e44268; } div#side div.title { + font-weight: normal; + color: #e44268; + text-align: left; border-width: 0px 0px 1px 0px; + border-bottom: 1px solid #e44268; + } + + div#side a:link { + color: #ffffff; + text-decoration: none; + } + + div#side a:visited { + color: #ffffff; + text-decoration: none; + } + + div#side a:hover { + color: #cccccc; + text-decoration: underline; + } + + div#side ol,ul { + margin: 10px; + padding-left: 10px; + } + + div#side li { + color: #e44268; } *************** *** 93,97 **** /* history */ ! div#history { } --- 174,179 ---- /* history */ ! div#history { ! width: 500px; } *************** *** 108,111 **** --- 190,199 ---- } + /* command */ + + div#command { + width: 500px; + } + /* image */ *************** *** 115,118 **** --- 203,207 ---- margin-left: auto; margin-right: auto; + border: 0px; } *************** *** 208,216 **** } - table#list_methods { - width: 680px; - border: none; - } - th { vertical-align: top; --- 297,300 ---- *************** *** 223,234 **** } /* textarea */ textarea { font-family: monospace; ! font-size: 100%; overflow: auto; ! width: 80%; } --- 307,346 ---- } + div#method_list table { + border: none; + } + + + /* form */ + + input { + background-color: #FFFFFF; + padding: 2px; + font-size: 10px; + color: #666666; + border: 1px solid #611022; + margin-bottom: 2px; + } + + input[type=submit] { + background-color: #FFFFFF; + padding: 2px; + font-size: 10px; + color: #ffffff; + border: 1px solid #611022; + background-color: #E44268; + margin-bottom: 2px; + } /* textarea */ textarea { + background: url("/images/console.png") no-repeat center; + background-color: #eaedeb; font-family: monospace; ! font-size: 12px; overflow: auto; ! width: 500px; ! padding: 5px; } *************** *** 252,256 **** @media screen { ! div#main { margin-left: 150px; } div#side { display: block; } } --- 364,368 ---- @media screen { ! div#main { margin-left: 0px; } div#side { display: block; } } --- NEW FILE: console.png --- (This appears to be a binary file; contents omitted.) Index: _methods.rhtml =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/_methods.rhtml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** _methods.rhtml 16 Jan 2007 05:47:05 -0000 1.2 --- _methods.rhtml 9 Jul 2007 11:14:29 -0000 1.3 *************** *** 1,9 **** [ <%= @class %> ] ! <%- step = @methods.size / 4 + 1 -%> <%- 0.step(@methods.size, step) do |i| -%> ! <%- end -%> !
<%= @methods.sort[i, step].join("
") %>
\ No newline at end of file --- 1,11 ---- [ <%= @class %> ] !
! <%- step = @methods.size / 4 + 1 -%> <%- 0.step(@methods.size, step) do |i| -%> ! <%- end -%> !
<%= @methods[i, step].join("
") %>
!
Index: index.rhtml =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/index.rhtml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** index.rhtml 28 Mar 2007 09:21:45 -0000 1.3 --- index.rhtml 9 Jul 2007 11:14:29 -0000 1.4 *************** *** 4,8 **** <%- end -%> <%= form_remote_tag(:url => {:action => "evaluate"}, :position => "top") %> ! BioRuby script --- 4,9 ---- <%- end -%> <%= form_remote_tag(:url => {:action => "evaluate"}, :position => "top") %> ! BioRuby script: !
*************** *** 12,19 **** <%= link_to_remote "Last 5", :url => {:action => "results", :limit => 5} %> | <%= link_to_remote "Previous", :url => {:action => "results", :limit => 1} %> ! ] or [ ! <%= link_to "Clear", :action => "index" %> ! ] results
!
<%= end_form_tag %> --- 13,19 ---- <%= link_to_remote "Last 5", :url => {:action => "results", :limit => 5} %> | <%= link_to_remote "Previous", :url => {:action => "results", :limit => 1} %> ! ] or ! <%= link_to "Hide", :action => "index" %> ! results
<%= end_form_tag %> Index: _log.rhtml =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/_log.rhtml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** _log.rhtml 16 Jan 2007 05:35:37 -0000 1.1 --- _log.rhtml 9 Jul 2007 11:14:29 -0000 1.2 *************** *** 1,4 ****
-
Input: [<%= link_to_remote @number, :url => {:action => "reload_script", :number => @number} %>] --- 1,3 ---- --- NEW FILE: bg.gif --- (This appears to be a binary file; contents omitted.) Index: bioruby.rhtml =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/bioruby.rhtml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** bioruby.rhtml 28 Jun 2007 10:56:25 -0000 1.3 --- bioruby.rhtml 9 Jul 2007 11:14:29 -0000 1.4 *************** *** 1,41 **** ! BioRuby shell on Rails <%= stylesheet_link_tag "bioruby.css" %> <%= javascript_include_tag :defaults %> - - -
- -
!
Project
!
    !
  • <%= link_to "#{File.basename(project_workdir)}", "file://#{project_workdir}" %> !
!
Functions
!
    !
  • <%= link_to "Console", :action => "index" %>
  • !
  • <%= link_to "History", :action => "history" %>
  • !
  • <%= link_to "Commands", :action => "commands" %>
  • !
!
Local variables
! <%= render :partial => "variables" %> !
! !
!
!

BioRuby shell on Rails

<%= yield %> !
--- 1,47 ---- ! ! + BioRuby shell on Rails <%= stylesheet_link_tag "bioruby.css" %> <%= javascript_include_tag :defaults %> ! !
!
!
Project
!
    !
  • <%= link_to "#{File.basename(project_workdir)}", "file://#{project_workdir}" %> !
!
Functions
!
    !
  • <%= link_to "Console", :action => "index" %>
  • !
  • <%= link_to "History", :action => "history" %>
  • !
  • <%= link_to "Commands", :action => "commands" %>
  • !
+
Local variables
+ <%= render :partial => "variables" %> !
! !
!
!

BioRuby shell on Rails

!

Web interface for the BioRuby library

!
+
<%= yield %> +
!
+ + From k at dev.open-bio.org Mon Jul 9 07:17:11 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Mon, 09 Jul 2007 11:17:11 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio shell.rb,1.19,1.20 Message-ID: <200707091117.l69BHB2V030190@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio In directory dev.open-bio.org:/tmp/cvs-serv30184/lib/bio Modified Files: shell.rb Log Message: * added NCBI, EBI, DDBJ web services Index: shell.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell.rb,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** shell.rb 5 Apr 2007 23:45:10 -0000 1.19 --- shell.rb 9 Jul 2007 11:17:09 -0000 1.20 *************** *** 33,36 **** --- 33,37 ---- require 'bio/shell/plugin/das' require 'bio/shell/plugin/keggapi' + require 'bio/shell/plugin/soap' require 'bio/shell/plugin/emboss' require 'bio/shell/plugin/blast' From k at dev.open-bio.org Mon Jul 9 07:17:11 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Mon, 09 Jul 2007 11:17:11 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/shell/plugin soap.rb,NONE,1.1 Message-ID: <200707091117.l69BHB3x030195@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/shell/plugin In directory dev.open-bio.org:/tmp/cvs-serv30184/lib/bio/shell/plugin Added Files: soap.rb Log Message: * added NCBI, EBI, DDBJ web services --- NEW FILE: soap.rb --- # # = bio/shell/plugin/soap.rb - web services # # Copyright:: Copyright (C) 2006 # Toshiaki Katayama # License:: Ruby's # # $Id: soap.rb,v 1.1 2007/07/09 11:17:09 k Exp $ # module Bio::Shell private def ncbisoap(wsdl = nil) if wsdl @ncbisoap = Bio::NCBI::SOAP.new(wsdl) else @ncbisoap ||= Bio::NCBI::SOAP.new end return @ncbisoap end def ebisoap(wsdl = nil) case wsdl when :ipscan @ebisoap = Bio::EBI::SOAP::InterProScan.new(wsdl) when :emboss @ebisoap = Bio::EBI::SOAP::Emboss.new(wsdl) when :clustalw @ebisoap = Bio::EBI::SOAP::ClustalW.new(wsdl) when :tcoffee @ebisoap = Bio::EBI::SOAP::TCoffee.new(wsdl) when :muscle @ebisoap = Bio::EBI::SOAP::Muscle.new(wsdl) when :fasta @ebisoap = Bio::EBI::SOAP::Fasta.new(wsdl) when :wublast @ebisoap = Bio::EBI::SOAP::WUBlast.new(wsdl) when :mpsrch @ebisoap = Bio::EBI::SOAP::MPsrch.new(wsdl) when :scanps @ebisoap = Bio::EBI::SOAP::ScanPS.new(wsdl) when :msd @ebisoap = Bio::EBI::SOAP::MSD.new(wsdl) when :ontology @ebisoap = Bio::EBI::SOAP::Ontology.new(wsdl) when :citation @ebisoap = Bio::EBI::SOAP::Citation.new(wsdl) when /^http/ @ebisoap = Bio::EBI::SOAP.new(wsdl) else @ebisoap ||= Bio::EBI::SOAP.new end return @ebisoap end def ddbjsoap(wsdl = nil) case wsdl when :blast @ddbjsoap = Bio::DDBJ::XML::Blast.new when :fasta @ddbjsoap = Bio::DDBJ::XML::Fasta.new when :clustalw @ddbjsoap = Bio::DDBJ::XML::ClustalW.new when :ddbj @ddbjsoap = Bio::DDBJ::XML::DDBJ.new when :gib @ddbjsoap = Bio::DDBJ::XML::Gib.new when :gtop @ddbjsoap = Bio::DDBJ::XML::Gtop.new when :pml @ddbjsoap = Bio::DDBJ::XML::PML.new when :srs @ddbjsoap = Bio::DDBJ::XML::SRS.new when :txsearch @ddbjsoap = Bio::DDBJ::XML::TxSearch.new when /^http/ @ddbjsoap = Bio::DDBJ::XML.new(wsdl) else @ddbjsoap ||= Bio::DDBJ::XML.new end return @ddbjsoap end end From k at dev.open-bio.org Mon Jul 9 07:44:11 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Mon, 09 Jul 2007 11:44:11 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates bg.gif, 1.1, NONE bioruby.png, 1.1, NONE bioruby.gif, 1.1, NONE console.png, 1.1, NONE Message-ID: <200707091144.l69BiBfw030272@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates In directory dev.open-bio.org:/tmp/cvs-serv30268 Removed Files: bg.gif bioruby.png bioruby.gif console.png Log Message: * images are renamed to be prefixed with bioruby- --- bioruby.gif DELETED --- --- bg.gif DELETED --- --- bioruby.png DELETED --- --- console.png DELETED --- From k at dev.open-bio.org Mon Jul 9 07:46:02 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Mon, 09 Jul 2007 11:46:02 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates bioruby-bg.gif, NONE, 1.1 bioruby-console.png, NONE, 1.1 bioruby-gem.png, NONE, 1.1 bioruby-link.gif, NONE, 1.1 bioruby.css, 1.5, 1.6 bioruby.rhtml, 1.4, 1.5 Message-ID: <200707091146.l69Bk2CU030345@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates In directory dev.open-bio.org:/tmp/cvs-serv30339/d Modified Files: bioruby.css bioruby.rhtml Added Files: bioruby-bg.gif bioruby-console.png bioruby-gem.png bioruby-link.gif Log Message: * images are renamed to be prefixed by 'bioruby-' to avoid confliction with already existing files in /public/images --- NEW FILE: bioruby-bg.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bioruby-console.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bioruby-link.gif --- (This appears to be a binary file; contents omitted.) Index: bioruby.css =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/bioruby.css,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** bioruby.css 9 Jul 2007 11:14:29 -0000 1.5 --- bioruby.css 9 Jul 2007 11:46:00 -0000 1.6 *************** *** 4,8 **** margin: 0; color: #555555; ! background: url("/images/bg.gif") repeat-y center; font-family: "trebuchet ms", verdana, arial, helvetica, sans-serif; font-size: 12px; --- 4,8 ---- margin: 0; color: #555555; ! background: url("/images/bioruby-bg.gif") repeat-y center; font-family: "trebuchet ms", verdana, arial, helvetica, sans-serif; font-size: 12px; *************** *** 23,27 **** margin-bottom: 20px; text-align: left; ! background: url("/images/bioruby.png") no-repeat left bottom; } --- 23,27 ---- margin-bottom: 20px; text-align: left; ! background: url("/images/bioruby-gem.png") no-repeat left bottom; } *************** *** 336,340 **** textarea { ! background: url("/images/console.png") no-repeat center; background-color: #eaedeb; font-family: monospace; --- 336,340 ---- textarea { ! background: url("/images/bioruby-console.png") no-repeat center; background-color: #eaedeb; font-family: monospace; --- NEW FILE: bioruby-gem.png --- (This appears to be a binary file; contents omitted.) Index: bioruby.rhtml =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/bioruby.rhtml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** bioruby.rhtml 9 Jul 2007 11:14:29 -0000 1.4 --- bioruby.rhtml 9 Jul 2007 11:46:00 -0000 1.5 *************** *** 29,33 ****
!
--- 29,33 ----
!
From k at dev.open-bio.org Mon Jul 9 07:46:02 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Mon, 09 Jul 2007 11:46:02 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby bioruby_generator.rb, 1.4, 1.5 Message-ID: <200707091146.l69Bk2Dw030351@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby In directory dev.open-bio.org:/tmp/cvs-serv30339 Modified Files: bioruby_generator.rb Log Message: * images are renamed to be prefixed by 'bioruby-' to avoid confliction with already existing files in /public/images Index: bioruby_generator.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/bioruby_generator.rb,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** bioruby_generator.rb 9 Jul 2007 11:14:29 -0000 1.4 --- bioruby_generator.rb 9 Jul 2007 11:46:00 -0000 1.5 *************** *** 19,26 **** m.file 'index.rhtml', 'app/views/bioruby/index.rhtml' m.file 'bioruby.rhtml', 'app/views/layouts/bioruby.rhtml' ! m.file 'bioruby.png', 'public/images/bioruby.png' ! m.file 'bioruby.gif', 'public/images/bioruby.gif' ! m.file 'bg.gif', 'public/images/bg.gif' ! m.file 'console.png', 'public/images/console.png' m.file 'bioruby.css', 'public/stylesheets/bioruby.css' end --- 19,26 ---- m.file 'index.rhtml', 'app/views/bioruby/index.rhtml' m.file 'bioruby.rhtml', 'app/views/layouts/bioruby.rhtml' ! m.file 'bioruby-gem.png', 'public/images/bioruby-gem.png' ! m.file 'bioruby-link.gif', 'public/images/bioruby-link.gif' ! m.file 'bioruby-bg.gif', 'public/images/bioruby-bg.gif' ! m.file 'bioruby-console.png', 'public/images/bioruby-console.png' m.file 'bioruby.css', 'public/stylesheets/bioruby.css' end From ngoto at dev.open-bio.org Mon Jul 9 10:08:36 2007 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Mon, 09 Jul 2007 14:08:36 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io flatfile.rb,1.59,1.60 Message-ID: <200707091408.l69E8aAC030730@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv30708/lib/bio/io Modified Files: flatfile.rb Log Message: Bio::FlatFile.foreach is added (which is suggested by IO.foreach). Index: flatfile.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/flatfile.rb,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** flatfile.rb 14 Apr 2007 02:29:45 -0000 1.59 --- flatfile.rb 9 Jul 2007 14:08:34 -0000 1.60 *************** *** 509,512 **** --- 509,526 ---- end + # Executes the block for every entry in the stream. + # Same as FlatFile.open(*arg) { |ff| ff.each { |entry| ... }}. + # + # * Example + # Bio::FlatFile.foreach('test.fst') { |e| puts e.definition } + # + def self.foreach(*arg) + self.open(*arg) do |flatfileobj| + flatfileobj.each do |entry| + yield entry + end + end + end + # Same as FlatFile.open, except that 'stream' should be a opened # stream object (IO, File, ..., who have the 'gets' method). From ngoto at dev.open-bio.org Mon Jul 9 10:08:36 2007 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Mon, 09 Jul 2007 14:08:36 +0000 Subject: [BioRuby-cvs] bioruby ChangeLog,1.63,1.64 Message-ID: <200707091408.l69E8a7M030733@dev.open-bio.org> Update of /home/repository/bioruby/bioruby In directory dev.open-bio.org:/tmp/cvs-serv30708 Modified Files: ChangeLog Log Message: Bio::FlatFile.foreach is added (which is suggested by IO.foreach). Index: ChangeLog =================================================================== RCS file: /home/repository/bioruby/bioruby/ChangeLog,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** ChangeLog 2 Apr 2007 12:55:26 -0000 1.63 --- ChangeLog 9 Jul 2007 14:08:34 -0000 1.64 *************** *** 1,2 **** --- 1,8 ---- + 2007-07-09 Naohisa Goto + + * lib/bio/io/flatfile.rb + + Bio::FlatFile.foreach is added (which is suggested by IO.foreach). + 2007-04-02 Naohisa Goto From ngoto at dev.open-bio.org Tue Jul 10 06:44:49 2007 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Tue, 10 Jul 2007 10:44:49 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db/pdb pdb.rb,1.22,1.23 Message-ID: <200707101044.l6AAinvO001327@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db/pdb In directory dev.open-bio.org:/tmp/cvs-serv1303/lib/bio/db/pdb Modified Files: pdb.rb Log Message: Pdb_LString.new is changed not to raise error for nil. Fixed a bug when below records does not exist in a PDB entry: REMARK (remark), JRNL (jrnl), HELIX (helix), TURN (turn), SHEET (sheet), SSBOND (ssbond), SEQRES (seqres), DBREF (dbref), KEYWDS (keywords), AUTHOR (authors), HEADER (entry_id, accession, classification), TITLE (definition), and REVDAT (version) records (methods). Incompatible change: Bio::PDB#record is changed to return an empty array for nonexistent record. Thanks to Dr. Mikael Borg. (Re: [BioRuby] Preparing for 1.1 release) Index: pdb.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb/pdb.rb,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** pdb.rb 19 Apr 2007 13:59:29 -0000 1.22 --- pdb.rb 10 Jul 2007 10:44:46 -0000 1.23 *************** *** 120,124 **** end def self.new(str) ! String.new(str) end end --- 120,124 ---- end def self.new(str) ! String.new(str.to_s) end end *************** *** 1675,1679 **** # def record(name = nil) ! name ? @hash[name] : @hash end --- 1675,1679 ---- # def record(name = nil) ! name ? (@hash[name] || []) : @hash end *************** *** 1838,1847 **** # Classification in "HEADER". def classification ! self.record('HEADER').first.classification end # Get authors in "AUTHOR". def authors ! self.record('AUTHOR').first.authorList end --- 1838,1848 ---- # Classification in "HEADER". def classification ! f = self.record('HEADER').first ! f ? f.classification : nil end # Get authors in "AUTHOR". def authors ! self.record('AUTHOR').collect { |f| f.authorList }.flatten end *************** *** 1852,1856 **** # PDB identifier written in "HEADER". (e.g. 1A00) def entry_id ! @id = self.record('HEADER').first.idCode unless @id @id end --- 1853,1860 ---- # PDB identifier written in "HEADER". (e.g. 1A00) def entry_id ! unless @id ! f = self.record('HEADER').first ! @id = f ? f.idCode : nil ! end @id end *************** *** 1863,1872 **** # Title of this entry in "TITLE". def definition ! self.record('TITLE').first.title end # Current modification number in "REVDAT". def version ! self.record('REVDAT').first.modNum end --- 1867,1878 ---- # Title of this entry in "TITLE". def definition ! f = self.record('TITLE').first ! f ? f.title : nil end # Current modification number in "REVDAT". def version ! f = self.record('REVDAT').first ! f ? f.modNum : nil end From ngoto at dev.open-bio.org Tue Jul 10 06:44:49 2007 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Tue, 10 Jul 2007 10:44:49 +0000 Subject: [BioRuby-cvs] bioruby/doc Changes-0.7.rd,1.21,1.22 Message-ID: <200707101044.l6AAine2001333@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/doc In directory dev.open-bio.org:/tmp/cvs-serv1303/doc Modified Files: Changes-0.7.rd Log Message: Pdb_LString.new is changed not to raise error for nil. Fixed a bug when below records does not exist in a PDB entry: REMARK (remark), JRNL (jrnl), HELIX (helix), TURN (turn), SHEET (sheet), SSBOND (ssbond), SEQRES (seqres), DBREF (dbref), KEYWDS (keywords), AUTHOR (authors), HEADER (entry_id, accession, classification), TITLE (definition), and REVDAT (version) records (methods). Incompatible change: Bio::PDB#record is changed to return an empty array for nonexistent record. Thanks to Dr. Mikael Borg. (Re: [BioRuby] Preparing for 1.1 release) Index: Changes-0.7.rd =================================================================== RCS file: /home/repository/bioruby/bioruby/doc/Changes-0.7.rd,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Changes-0.7.rd 23 Apr 2007 16:03:24 -0000 1.21 --- Changes-0.7.rd 10 Jul 2007 10:44:47 -0000 1.22 *************** *** 259,262 **** --- 259,264 ---- name field for selecting atoms, because the element field is not useful for selecting atoms and is not used in many pdb files. + * Bio::PDB#record is changed to return an empty array instead of nil + for a nonexistent record. --- Bio::FlatFile From ngoto at dev.open-bio.org Tue Jul 10 06:44:49 2007 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Tue, 10 Jul 2007 10:44:49 +0000 Subject: [BioRuby-cvs] bioruby ChangeLog,1.64,1.65 Message-ID: <200707101044.l6AAin4J001330@dev.open-bio.org> Update of /home/repository/bioruby/bioruby In directory dev.open-bio.org:/tmp/cvs-serv1303 Modified Files: ChangeLog Log Message: Pdb_LString.new is changed not to raise error for nil. Fixed a bug when below records does not exist in a PDB entry: REMARK (remark), JRNL (jrnl), HELIX (helix), TURN (turn), SHEET (sheet), SSBOND (ssbond), SEQRES (seqres), DBREF (dbref), KEYWDS (keywords), AUTHOR (authors), HEADER (entry_id, accession, classification), TITLE (definition), and REVDAT (version) records (methods). Incompatible change: Bio::PDB#record is changed to return an empty array for nonexistent record. Thanks to Dr. Mikael Borg. (Re: [BioRuby] Preparing for 1.1 release) Index: ChangeLog =================================================================== RCS file: /home/repository/bioruby/bioruby/ChangeLog,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** ChangeLog 9 Jul 2007 14:08:34 -0000 1.64 --- ChangeLog 10 Jul 2007 10:44:47 -0000 1.65 *************** *** 1,4 **** --- 1,22 ---- 2007-07-09 Naohisa Goto + * lib/bio/db/pdb/pdb.rb + + Pdb_LString.new is changed not to raise error for nil. + + Fixed a bug when below records does not exist in a PDB entry: + REMARK (remark), JRNL (jrnl), HELIX (helix), + TURN (turn), SHEET (sheet), SSBOND (ssbond), SEQRES (seqres), + DBREF (dbref), KEYWDS (keywords), AUTHOR (authors), + HEADER (entry_id, accession, classification), + TITLE (definition), and REVDAT (version) records (methods). + + Incompatible change: Bio::PDB#record is changed to return + an empty array for nonexistent record. + + (reported by Mikael Borg) + + 2007-07-09 Naohisa Goto + * lib/bio/io/flatfile.rb From ngoto at dev.open-bio.org Mon Jul 16 08:15:44 2007 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Mon, 16 Jul 2007 12:15:44 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio/appl/mafft - New directory Message-ID: <200707161215.l6GCFiOG019861@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio/appl/mafft In directory dev.open-bio.org:/tmp/cvs-serv19841/test/unit/bio/appl/mafft Log Message: Directory /home/repository/bioruby/bioruby/test/unit/bio/appl/mafft added to the repository From ngoto at dev.open-bio.org Mon Jul 16 08:21:41 2007 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Mon, 16 Jul 2007 12:21:41 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio alignment.rb,1.22,1.23 Message-ID: <200707161221.l6GCLfRO019956@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio In directory dev.open-bio.org:/tmp/cvs-serv19932/lib/bio Modified Files: alignment.rb Log Message: * lib/bio/mafft/report.rb For generic multi-fasta formatted sequence alignment, Bio::Alignment::MultiFastaFormat is newly added based on Bio::MAFFT::Report class, and Bio::MAFFT::Report is changed to inherit the new class. Tests are added in test/unit/bio/appl/mafft/test_report.rb. * lib/bio/alignment.rb added autoload of Bio::Alignment::MultiFastaFormat. New modules and classes Bio::Alignment::FactoryTemplate::* are added. Index: alignment.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/alignment.rb,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** alignment.rb 5 Apr 2007 23:35:39 -0000 1.22 --- alignment.rb 16 Jul 2007 12:21:39 -0000 1.23 *************** *** 22,25 **** --- 22,27 ---- # + require 'tempfile' + require 'bio/command' require 'bio/sequence' *************** *** 71,74 **** --- 73,78 ---- module Alignment + autoload :MultiFastaFormat, 'bio/appl/mafft/report' + # Bio::Alignment::PropertyMethods is a set of methods to treat # the gap character and so on. *************** *** 2195,2198 **** --- 2199,2514 ---- OriginalAlignment.readfiles(*files) end + + #--- + # Service classes for multiple alignment applications + #+++ + #--- + # Templates of alignment application factory + #+++ + + # Namespace for templates for alignment application factory + module FactoryTemplate + + # Template class for alignment application factory. + # The program acts: + # input: stdin or file, format = fasta format + # output: stdout (parser should be specified by DEFAULT_PARSER) + class Simple + + # Creates a new alignment factory + def initialize(program = self.class::DEFAULT_PROGRAM, options = []) + @program = program + @options = options + @command = nil + @output = nil + @report = nil + @exit_status = nil + @data_stdout = nil + end + + # program name + attr_accessor :program + + # options + attr_accessor :options + + # Last command-line string. Returns nil or an array of String. + # Note that filenames described in the command-line may already + # be removed because these files may be temporary files. + attr_reader :command + + # Last raw result of the program. + # Return a string (or nil). + attr_reader :output + + # Last result object performed by the factory. + attr_reader :report + + # Last exit status + attr_reader :exit_status + + # Last output to the stdout. + attr_accessor :data_stdout + + # Clear the internal data and status, except program and options. + def reset + @command = nil + @output = nil + @report = nil + @exit_status = nil + @data_stdout = nil + end + + # Executes the program. + # If +seqs+ is not nil, perform alignment for seqs. + # If +seqs+ is nil, simply executes the program. + # + # Compatibility note: When seqs is nil, + # returns true if the program exits normally, and + # returns false if the program exits abnormally. + def query(seqs) + if seqs then + query_alignment(seqs) + else + exec_local(@options) + @exit_status.exitstatus == 0 ? true : false + end + end + + # Performs alignment for seqs. + # +seqs+ should be Bio::Alignment or Array of sequences or nil. + def query_alignment(seqs) + unless seqs.respond_to?(:output_fasta) then + seqs = Bio::Alignment.new(seqs) + end + query_string(seqs.output_fasta(:width => 70)) + end + + # alias of query_alignment. + # + # Compatibility Note: query_align will renamed to query_alignment. + def query_align(seqs) + #warn 'query_align is renamed to query_alignment.' + query_alignment(seqs) + end + + # Performs alignment for +str+. + # The +str+ should be a string that can be recognized by the program. + def query_string(str) + _query_string(str, @options) + @report + end + + # Performs alignment of sequences in the file named +fn+. + def query_by_filename(filename_in) + _query_local(filename_in, @options) + @report + end + + private + # Executes a program in the local machine. + def exec_local(opt, data_stdin = nil) + @exit_status = nil + @command = [ @program, *opt ] + #STDERR.print "DEBUG: ", @command.join(" "), "\n" + @data_stdout = Bio::Command.query_command(@command, data_stdin) + @exit_status = $? + end + + # prepare temporary file + def _prepare_tempfile(str = nil) + tf_in = Tempfile.open(str ? 'alignment_i' :'alignment_o') + tf_in.print str if str + tf_in.close(false) + tf_in + end + + # generates options specifying input/output filename. + # nil for filename means stdin or stdout. + # +options+ must not contain specify filenames. + # returns an array of string. + def _generate_options(infile, outfile, options) + options + + (infile ? _option_input_file(infile) : _option_input_stdin) + + (outfile ? _option_output_file(outfile) : _option_output_stdout) + end + + # generates options specifying input filename. + # returns an array of string + def _option_input_file(fn) + [ fn ] + end + + # generates options specifying output filename. + # returns an array of string + def _option_output_file(fn) + raise 'can not specify output file: always stdout' + end + + # generates options specifying that input is taken from stdin. + # returns an array of string + def _option_input_stdin + [] + end + + # generates options specifying output to stdout. + # returns an array of string + def _option_output_stdout + [] + end + end #class Simple + + # mix-in module + module WrapInputStdin + private + # Performs alignment for +str+. + # The +str+ should be a string that can be recognized by the program. + def _query_string(str, opt) + _query_local(nil, opt, str) + end + end #module WrapInputStdin + + # mix-in module + module WrapInputTempfile + private + # Performs alignment for +str+. + # The +str+ should be a string that can be recognized by the program. + def _query_string(str, opt) + begin + tf_in = _prepare_tempfile(str) + ret = _query_local(tf_in.path, opt, nil) + ensure + tf_in.close(true) if tf_in + end + ret + end + end #module WrapInputTempfile + + # mix-in module + module WrapOutputStdout + private + # Performs alignment by specified filenames + def _query_local(fn_in, opt, data_stdin = nil) + opt = _generate_options(fn_in, nil, opt) + exec_local(opt, data_stdin) + @output = @data_stdout + @report = self.class::DEFAULT_PARSER.new(@output) + @report + end + end #module WrapOutputStdout + + # mix-in module + module WrapOutputTempfile + private + # Performs alignment + def _query_local(fn_in, opt, data_stdin = nil) + begin + tf_out = _prepare_tempfile() + opt = _generate_options(fn_in, tf_out.path, opt) + exec_local(opt, data_stdin) + tf_out.open + @output = tf_out.read + ensure + tf_out.close(true) if tf_out + end + @report = self.class::DEFAULT_PARSER.new(@output) + @report + end + end #module WrapOutputTempfile + + # Template class for alignment application factory. + # The program needs: + # input: file (cannot accept stdin), format = fasta format + # output: stdout (parser should be specified by DEFAULT_PARSER) + class FileInStdoutOut < Simple + include Bio::Alignment::FactoryTemplate::WrapInputTempfile + include Bio::Alignment::FactoryTemplate::WrapOutputStdout + + private + # generates options specifying that input is taken from stdin. + # returns an array of string + def _option_input_stdin + raise 'input is always a file' + end + end #class FileInStdoutOut + + # Template class for alignment application factory. + # The program needs: + # input: stdin or file, format = fasta format + # output: file (parser should be specified by DEFAULT_PARSER) + class StdinInFileOut < Simple + include Bio::Alignment::FactoryTemplate::WrapInputStdin + include Bio::Alignment::FactoryTemplate::WrapOutputTempfile + + private + # generates options specifying output to stdout. + # returns an array of string + def _option_output_stdout + raise 'output is always a file' + end + end #class StdinInFileOut + + # Template class for alignment application factory. + # The program needs: + # input: file (cannot accept stdin), format = fasta format + # output: file (parser should be specified by DEFAULT_PARSER) + class FileInFileOut < Simple + include Bio::Alignment::FactoryTemplate::WrapInputTempfile + include Bio::Alignment::FactoryTemplate::WrapOutputTempfile + + private + # generates options specifying that input is taken from stdin. + # returns an array of string + def _option_input_stdin + raise 'input is always a file' + end + + # generates options specifying output to stdout. + # returns an array of string + def _option_output_stdout + raise 'output is always a file' + end + end #class FileInFileOut + + # Template class for alignment application factory. + # The program needs: + # input: file (cannot accept stdin), format = fasta format + # output: file (parser should be specified by DEFAULT_PARSER) + # Tree (*.dnd) output is also supported. + class FileInFileOutWithTree < FileInFileOut + + # alignment guide tree generated by the program (*.dnd file) + attr_reader :output_dnd + + def reset + @output_dnd = nil + super + end + + private + # Performs alignment + def _query_local(fn_in, opt, data_stdin = nil) + begin + tf_dnd = _prepare_tempfile() + opt = opt + _option_output_dndfile(tf_dnd.path) + ret = super(fn_in, opt, data_stdin) + tf_dnd.open + @output_dnd = tf_dnd.read + ensure + tf_dnd.close(true) if tf_dnd + end + ret + end + + # generates options specifying output tree file (*.dnd). + # returns an array of string + def _option_output_dndfile + raise NotImplementedError + end + end #class FileInFileOutWithTree + + end #module FactoryTemplate + + end #module Alignment From ngoto at dev.open-bio.org Mon Jul 16 08:21:41 2007 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Mon, 16 Jul 2007 12:21:41 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio/appl/mafft test_report.rb, NONE, 1.1 Message-ID: <200707161221.l6GCLfbB019966@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio/appl/mafft In directory dev.open-bio.org:/tmp/cvs-serv19932/test/unit/bio/appl/mafft Added Files: test_report.rb Log Message: * lib/bio/mafft/report.rb For generic multi-fasta formatted sequence alignment, Bio::Alignment::MultiFastaFormat is newly added based on Bio::MAFFT::Report class, and Bio::MAFFT::Report is changed to inherit the new class. Tests are added in test/unit/bio/appl/mafft/test_report.rb. * lib/bio/alignment.rb added autoload of Bio::Alignment::MultiFastaFormat. New modules and classes Bio::Alignment::FactoryTemplate::* are added. --- NEW FILE: test_report.rb --- # # test/unit/bio/appl/mafft/test_report.rb - Unit test for Bio::Alignment::MultiFastaFormat # # Copyright:: Copyright (C) 2007 # 2005 Naohisa Goto # License:: The Ruby License # # $Id: test_report.rb,v 1.1 2007/07/16 12:21:39 ngoto Exp $ # require 'pathname' libpath = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 5, 'lib')).cleanpath.to_s $:.unshift(libpath) unless $:.include?(libpath) require 'test/unit' require 'bio' module Bio class TestAlignmentMultiFastaFormat < Test::Unit::TestCase def setup @na = Bio::Alignment::MultiFastaFormat.new <<__END_OF_NASEQS__ >naseq1 TAGATTTCGAATTTCTAGnGAACCGAACCGkACAGCCTTACATyATTCAGACCAATGTGT TACCAATTCGAGTATACAAGAACAGTGATAAGGTACCAAACAACGACTTCTTCCCGAACC >naseq2 TAGATTTCGAATCTAGGGAATCCGATACGGACAGCCTTACATTATTCAGACCAATGTGTA TACCAATTCGAGAATACAAGAACGTGATAAGGTACCCAAACAACGACTTCTTCCCGAACC >naseq3 TAGATTTCGAATCTAGGGAATCCGATACCGGACAGCCTTACATTATTCAGACCAATGTGT TACCAATTCGAGAATACAAGAACGTGATAAGGTACCCAAACAACGACTTCTTCCCGAACC __END_OF_NASEQS__ @aa = Bio::Alignment::MultiFastaFormat.new <<__END_OF_AASEQS__ >aaseq1 MVHWTAEEKQLITGLWGKVNVAECGAEALARLLIVYPWTQRFFASFGNLSSPTAILGNPMVRAHGKKVLT >aaseq2 MLTAEEKAAVTGFWGKVKVDEVGAEALGRLLVVYPWTQRFFEHFGDLSSADAVMNNAKVKAHGKKVLDSF >aaseq3 MVHLTDAEKSAVSCLWAKVNPDEVGGEALGRLLVVYPWTQRYFDSFGDLSSASAIMGNPKVKAHGKKVIT >aaseq4 MVHLTDAEKAAVNGLWGKVNPDDVGGEALGRLLVVYPWTQRYFDSFGDLSSASAIMGNPKVKAHGKKVIN __END_OF_AASEQS__ end #def setup def test_alignment assert_equal(120, @na.alignment.alignment_length) assert_equal(70, @aa.alignment.alignment_length) end def test_entries assert_equal(3, @na.entries.size) assert_equal(4, @aa.entries.size) end def test_determine_seq_method @na.alignment assert_equal(:naseq, @na.instance_eval { @seq_method }) @aa.alignment assert_equal(:aaseq, @aa.instance_eval { @seq_method }) end end #class TestAlignmentMultiFastaFormat end #module Bio From ngoto at dev.open-bio.org Mon Jul 16 08:21:41 2007 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Mon, 16 Jul 2007 12:21:41 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/appl/mafft report.rb,1.12,1.13 Message-ID: <200707161221.l6GCLftT019961@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/appl/mafft In directory dev.open-bio.org:/tmp/cvs-serv19932/lib/bio/appl/mafft Modified Files: report.rb Log Message: * lib/bio/mafft/report.rb For generic multi-fasta formatted sequence alignment, Bio::Alignment::MultiFastaFormat is newly added based on Bio::MAFFT::Report class, and Bio::MAFFT::Report is changed to inherit the new class. Tests are added in test/unit/bio/appl/mafft/test_report.rb. * lib/bio/alignment.rb added autoload of Bio::Alignment::MultiFastaFormat. New modules and classes Bio::Alignment::FactoryTemplate::* are added. Index: report.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/mafft/report.rb,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** report.rb 5 Apr 2007 23:35:40 -0000 1.12 --- report.rb 16 Jul 2007 12:21:39 -0000 1.13 *************** *** 2,6 **** # = bio/appl/mafft/report.rb - MAFFT report class # ! # Copyright:: Copyright (C) 2003 GOTO Naohisa # License:: The Ruby License # --- 2,6 ---- # = bio/appl/mafft/report.rb - MAFFT report class # ! # Copyright:: Copyright (C) 2003, 2007 Naohisa Goto # License:: The Ruby License # *************** *** 14,17 **** --- 14,21 ---- # interface between Bio::ClustalW::Report. # + # Bio::Alignment::MultiFastaFormat is a generic data class for + # fasta-formatted multiple sequence alignment data. + # Bio::MAFFT::Report inherits Bio::Alignment::MultiFastaFormat. + # # == References # *************** *** 26,32 **** --- 30,121 ---- require 'bio/db/fasta' require 'bio/io/flatfile' + require 'bio/alignment' require 'bio/appl/mafft' module Bio + module Alignment + # Data class for fasta-formatted multiple sequence alignment data, + # which is simply multiple entiries of fasta formatted sequences. + class MultiFastaFormat + + # delimiter for flatfile + DELIMITER = RS = nil + + # Creates a new data object. + # +str+ should be a (multi-)fasta formatted string. + def initialize(str) + ff = Bio::FlatFile.new(Bio::FastaFormat, StringIO.new(str)) + @data = ff.to_a + @alignment = nil + @seq_method = nil + end + + # Gets an multiple alignment. + # Returns a Bio::Alignment object. + # +method+ should be one of :naseq, :aaseq, :seq, or nil (default). + # nil means to automatically determine nucleotide or amino acid. + # + # This method returns previously parsed object + # if the same method is given (or guessed method is the same). + def alignment(method = nil) + m = determine_seq_method(@data, method) + if !@alignment or m != @seq_method then + @seq_method = m + @alignment = do_parse(@data, @seq_method) + end + @alignment + end + + # Gets an array of the fasta formatted sequence objects. + # Returns an array of Bio::FastaFormat objects. + def entries + @data + end + + private + # determines seqtype. + # if nil is given, try to guess DNA or protein. + def determine_seq_method(data, m = nil) + case m + when :aaseq + :aaseq + when :naseq + :naseq + when :seq + :seq + when nil + # auto-detection + score = 0 + data[0, 3].each do |e| + k = e.to_seq.guess + if k == Bio::Sequence::NA then + score += 1 + elsif k == Bio::Sequence::AA then + score -= 1 + end + end + if score > 0 then + :naseq + elsif score < 0 then + :aaseq + else + :seq + end + else + raise 'one of :naseq, :aaseq, :seq, or nil should be given' + end + end + + # Parses a result. + def do_parse(ary, seqmethod) + a = Bio::Alignment.new + a.add_sequences(ary) do |x| + [ x.__send__(seqmethod), x.definition ] + end + a + end + end #class MultiFastaFormat + end #module Alignment + class MAFFT *************** *** 37,50 **** # the significance of this class is to keep standard form and # interface between Bio::ClustalW::Report. ! class Report # Creates a new Report object. # +str+ should be multi-fasta formatted text as a string. - # +seqclass+ should on of following: - # Class: Bio::Sequence::AA, Bio::Sequence::NA, ... - # String: 'PROTEIN', 'DNA', ... # # Compatibility Note: the old usage (to get array of Bio::FastaFormat # objects) is deprecated. def initialize(str, seqclass = nil) if str.is_a?(Array) then --- 126,143 ---- # the significance of this class is to keep standard form and # interface between Bio::ClustalW::Report. ! class Report < Bio::Alignment::MultiFastaFormat # Creates a new Report object. # +str+ should be multi-fasta formatted text as a string. # # Compatibility Note: the old usage (to get array of Bio::FastaFormat # objects) is deprecated. + # + # Compatibility Note 2: the argument +seqclass+ is deprecated. + # + # +seqclass+ should be one of following: + # Class: Bio::Sequence::AA, Bio::Sequence::NA, ... + # String: 'PROTEIN', 'DNA', ... + # def initialize(str, seqclass = nil) if str.is_a?(Array) then *************** *** 52,69 **** @data = str else ! ff = Bio::FlatFile.new(Bio::FastaFormat, StringIO.new(str)) ! @data = ff.to_a end ! @align = nil ! case seqclass ! when /PROTEIN/i ! @seqclass = Bio::Sequence::AA ! when /[DR]NA/i ! @seqclass = Bio::Sequence::NA ! else ! if seqclass.is_a?(Module) then ! @seqclass = seqclass else ! @seqclass = Bio::Sequence end end --- 145,164 ---- @data = str else ! super(str) end ! ! if seqclass then ! warn "the 2nd argument (seqclass) will be no deprecated." ! case seqclass ! when /PROTEIN/i ! @seqclass = Bio::Sequence::AA ! when /[DR]NA/i ! @seqclass = Bio::Sequence::NA else ! if seqclass.is_a?(Module) then ! @seqclass = seqclass ! else ! @seqclass = nil ! end end end *************** *** 74,103 **** # Sequence class (Bio::Sequence::AA, Bio::Sequence::NA, ...) attr_reader :seqclass # Gets an multiple alignment. # Returns a Bio::Alignment object. ! def alignment ! do_parse() unless @align ! @align end ! # This will be deprecated. Instead, please use alignment. # # Gets an multiple alignment. # Returns a Bio::Alignment object. def align ! warn "align method will be deprecated. Please use \'alignment\'." alignment end # Gets an fasta-format string of the sequences. # Returns a string. # Same as align.to_fasta. ! # Please refer to Bio::Alignment#to_fasta for arguments. def to_fasta(*arg) ! alignment.to_fasta(*arg) end # Gets an array of the sequences. # Returns an array of Bio::FastaFormat instances. --- 169,205 ---- # Sequence class (Bio::Sequence::AA, Bio::Sequence::NA, ...) + # + # Compatibility note: This method will be removed in the tufure. attr_reader :seqclass # Gets an multiple alignment. # Returns a Bio::Alignment object. ! def alignment(method = nil) ! super end ! # This method will be deprecated. Instead, please use alignment. # # Gets an multiple alignment. # Returns a Bio::Alignment object. def align ! warn "Bio::MAFFT::Report#align is deprecated. Please use \'alignment\'." alignment end + # This will be deprecated. Instead, please use alignment.output_fasta. + # # Gets an fasta-format string of the sequences. # Returns a string. # Same as align.to_fasta. ! # Please refer to Bio::Alignment#output_fasta for arguments. def to_fasta(*arg) ! warn "Bio::MAFFT::report#to_fasta is deprecated. Please use \'alignment.output_fasta\'" ! alignment.output_fasta(*arg) end + # Compatibility note: Behavior of the method will be changed + # in the future. + # # Gets an array of the sequences. # Returns an array of Bio::FastaFormat instances. *************** *** 108,117 **** private # Parsing a result. ! def do_parse ! return nil if @align ! @align = Bio::Alignment.new(@data) do |x| ! [ @seqclass.new(x.seq), x.definition ] end - nil end --- 210,222 ---- private # Parsing a result. ! def do_parse(ary, seqmethod) ! if @seqclass then ! a = Bio::Alignment.new ! a.add_sequences(ary) do |x| ! [ @seqclass.new(x.seq), x.definition ] ! end ! else ! super(ary, seqmethod) end end From ngoto at dev.open-bio.org Mon Jul 16 08:25:52 2007 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Mon, 16 Jul 2007 12:25:52 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/appl muscle.rb, NONE, 1.1 probcons.rb, NONE, 1.1 tcoffee.rb, NONE, 1.1 Message-ID: <200707161225.l6GCPqYD020015@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/appl In directory dev.open-bio.org:/tmp/cvs-serv19995/lib/bio/appl Added Files: muscle.rb probcons.rb tcoffee.rb Log Message: New classess Bio::Muscle, Bio::Probcons, and Bio::Tcoffee are added for MUSCLE, ProbCons, and T-Coffee multiple alignment programs. Contributed by Jeffrey Blakeslee and colleagues. --- NEW FILE: tcoffee.rb --- # # = bio/appl/tcoffee.rb - T-Coffee application wrapper class # # Copyright:: Copyright (C) 2006-2007 # Jeffrey Blakeslee and John Conery University of Oregon # Naohisa Goto # License:: The Ruby License # # $Id: tcoffee.rb,v 1.1 2007/07/16 12:25:50 ngoto Exp $ # # Bio::Tcoffee is a wrapper class to execute T-Coffee. # # == References # # * http://www.tcoffee.org/Projects_home_page/t_coffee_home_page.html # * Notredame, C., Higgins, D.G. and Heringa, J. # T-Coffee: A novel method for fast and accurate multiple sequence # alignment. J. Mol. Biol. 302: 205-217, 2000. # module Bio # Bio::Tcoffee is a wrapper class to execute t-coffee. # # Please refer documents in bio/apple/tcoffee.rb for references. class Tcoffee < Bio::Alignment::FactoryTemplate::FileInFileOutWithTree # default program name DEFAULT_PROGRAM = 't_coffee'.freeze # default report parser DEFAULT_PARSER = Bio::ClustalW::Report private # generates options specifying input filename. # returns an array of string def _option_input_file(fn) [ '-infile', fn ] end # generates options specifying output filename. # returns an array of string def _option_output_file(fn) [ '-outfile', fn ] end # generates options specifying output filename. # returns an array of string def _option_output_dndfile(fn) [ '-newtree', fn ] end end #class TCoffee end #module Bio --- NEW FILE: muscle.rb --- # # = bio/appl/muscle.rb - MUSCLE application wrapper class # # Copyright:: Copyright (C) 2006-2007 # Jeffrey Blakeslee and John Conery University of Oregon # Naohisa Goto # License:: The Ruby License # # $Id: muscle.rb,v 1.1 2007/07/16 12:25:50 ngoto Exp $ # # # Bio::Muscle is a wrapper class to execute MUSCLE. # # == References # # * http://www.drive5.com/muscle/ # * Edgar R.C. # MUSCLE: multiple sequence alignment with high accuracy and # high throughput. Nucleic Acids Res. 32: 1792-1797, 2004. # * Edgar, R.C. # MUSCLE: a multiple sequence alignment method with reduced time # and space complexity. BMC Bioinformatics 5: 113, 2004. # module Bio # Bio::Muscle is a wrapper class to execute MUSCLE. # # Please refer documents in bio/apple/muscle.rb for references. class Muscle < Bio::Alignment::FactoryTemplate::StdinInFileOut # default program name DEFAULT_PROGRAM = 'muscle'.freeze # default report parser DEFAULT_PARSER = Bio::Alignment::MultiFastaFormat private # generates options specifying input filename. # returns an array of string def _option_input_file(fn) [ '-in', fn ] end # generates options specifying output filename. # returns an array of string def _option_output_file(fn) [ '-out', fn ] end end #class Muscle end #module Bio --- NEW FILE: probcons.rb --- # # = bio/appl/probcons.rb - ProbCons application wrapper class # # Copyright:: Copyright (C) 2006-2007 # Jeffrey Blakeslee and John Conery University of Oregon # Naohisa Goto # License:: The Ruby License # # $Id: probcons.rb,v 1.1 2007/07/16 12:25:50 ngoto Exp $ # # Bio::Probcons is a wrapper class to execute ProbCons # (Probabilistic Consistency-based Multiple Alignment # of Amino Acid Sequences). # # == References # # * http://probcons.stanford.edu/ # * Do, C.B., Mahabhashyam, M.S.P., Brudno, M., and Batzoglou, S. # ProbCons: Probabilistic Consistency-based Multiple Sequence Alignment. # Genome Research 15: 330-340, 2005. # module Bio # Bio::Probcons is a wrapper class to execute PROBCONS # (Probabilistic Consistency-based Multiple Alignment # of Amino Acid Sequences). # # Please refer documents in bio/apple/probcons.rb for references. class Probcons < Bio::Alignment::FactoryTemplate::FileInStdoutOut # default program name DEFAULT_PROGRAM = 'probcons'.freeze # default report parser DEFAULT_PARSER = Bio::Alignment::MultiFastaFormat end #class Probcons end #module Bio From ngoto at dev.open-bio.org Mon Jul 16 08:26:30 2007 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Mon, 16 Jul 2007 12:26:30 +0000 Subject: [BioRuby-cvs] bioruby/lib bio.rb,1.85,1.86 Message-ID: <200707161226.l6GCQUHD020045@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib In directory dev.open-bio.org:/tmp/cvs-serv20025/lib Modified Files: bio.rb Log Message: added autoload for Bio::Muscle, Bio::Probcons, and Bio::Tcoffee Index: bio.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio.rb,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** bio.rb 9 Jul 2007 08:49:15 -0000 1.85 --- bio.rb 16 Jul 2007 12:26:28 -0000 1.86 *************** *** 227,230 **** --- 227,234 ---- #end + autoload :Tcoffee, 'bio/appl/tcoffee' + autoload :Muscle, 'bio/appl/muscle' + autoload :Probcons, 'bio/appl/probcons' + autoload :Sim4, 'bio/appl/sim4' ## below are described in bio/appl/sim4.rb From ngoto at dev.open-bio.org Mon Jul 16 08:27:31 2007 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Mon, 16 Jul 2007 12:27:31 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/appl clustalw.rb, 1.18, 1.19 mafft.rb, 1.17, 1.18 Message-ID: <200707161227.l6GCRV41020073@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/appl In directory dev.open-bio.org:/tmp/cvs-serv20053/lib/bio/appl Modified Files: clustalw.rb mafft.rb Log Message: Interfaces of Bio::ClustalW and Bio::MAFFT are added/modified to follow Bio::Alignment::FactoryTemplate (but not yet changed to use it). Index: clustalw.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/clustalw.rb,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** clustalw.rb 5 Apr 2007 23:35:39 -0000 1.18 --- clustalw.rb 16 Jul 2007 12:27:29 -0000 1.19 *************** *** 8,12 **** # # Bio::ClustalW is a CLUSTAL W execution wrapper class. ! # Its object is also called an alignment factory. # CLUSTAL W is a very popular software for multiple sequence alignment. # --- 8,12 ---- # # Bio::ClustalW is a CLUSTAL W execution wrapper class. ! # It can also be called as an alignment factory. # CLUSTAL W is a very popular software for multiple sequence alignment. # *************** *** 45,49 **** @output = nil @report = nil ! @log = nil end --- 45,51 ---- @output = nil @report = nil ! @data_stdout = nil ! @exit_status = nil ! @output_dnd = nil end *************** *** 56,60 **** # option is deprecated. Instead, please use options. def option ! warn "option is deprecated. Please use options." options end --- 58,62 ---- # option is deprecated. Instead, please use options. def option ! warn "Bio::ClustalW#option is deprecated. Please use options." options end *************** *** 66,73 **** attr_reader :command # Returns last messages of CLUSTAL W execution. ! attr_reader :log ! # Returns last raw alignment result (String). attr_reader :output --- 68,80 ---- attr_reader :command + # This method will be deprecated. + # # Returns last messages of CLUSTAL W execution. ! def log ! #warn 'Bio::ClustalW#log will be deprecated.' ! @data_stdout ! end ! # Returns last raw alignment result (String or nil). attr_reader :output *************** *** 76,82 **** --- 83,109 ---- attr_reader :report + # Last exit status + attr_reader :exit_status + + # Last output to the stdout. + attr_accessor :data_stdout + + # Clear the internal data and status, except program and options. + def reset + @command = nil + @output = nil + @report = nil + @exit_status = nil + @data_stdout = nil + @output_dnd = nil + end + # Executes the program(clustalw). # If +seqs+ is not nil, perform alignment for seqs. # If +seqs+ is nil, simply executes CLUSTAL W. + # + # Compatibility note: When seqs is nil, + # returns true if the program exits normally, and + # returns false if the program exits abnormally. def query(seqs) if seqs then *************** *** 84,112 **** else exec_local(@options) end end # Performs alignment for +seqs+. # +seqs+ should be Bio::Alignment or Array of sequences or nil. def query_align(seqs) - seqtype = nil unless seqs.is_a?(Bio::Alignment) seqs = Bio::Alignment.new(seqs) end - seqs.each do |s| - if s.is_a?(Bio::Sequence::AA) then - seqtype = 'PROTEIN' - elsif s.is_a?(Bio::Sequence::NA) then - seqtype = 'DNA' - end - break if seqtype - end query_string(seqs.output_fasta(:width => 70, ! :avoid_same_name => true), seqtype) end # Performs alignment for +str+. # +str+ should be a string that can be recognized by CLUSTAL W. def query_string(str, *arg) begin tf_in = Tempfile.open('align') --- 111,146 ---- else exec_local(@options) + @exit_status.exitstatus == 0 ? true : false end end + # Note that this method will be renamed to query_alignment. + # # Performs alignment for +seqs+. # +seqs+ should be Bio::Alignment or Array of sequences or nil. + # + # Compatibility Note: Nucleic or amino is not determined by this method. def query_align(seqs) unless seqs.is_a?(Bio::Alignment) seqs = Bio::Alignment.new(seqs) end query_string(seqs.output_fasta(:width => 70, ! :avoid_same_name => true)) ! end ! ! # Performs alignment for +seqs+. ! # +seqs+ should be Bio::Alignment or Array of sequences or nil. ! def query_alignment(seqs) ! query_align(seqs) end # Performs alignment for +str+. # +str+ should be a string that can be recognized by CLUSTAL W. + # + # Compatibility Note: 2nd argument is deprecated and ignored. def query_string(str, *arg) + if arg.size > 0 then + warn '2nd argument of Bio::ClustalW#query_string is ignored' + end begin tf_in = Tempfile.open('align') *************** *** 115,119 **** tf_in.close(false) end ! r = query_by_filename(tf_in.path, *arg) tf_in.close(true) r --- 149,153 ---- tf_in.close(false) end ! r = query_by_filename(tf_in.path) tf_in.close(true) r *************** *** 121,126 **** # Performs alignment of sequences in the file named +path+. ! def query_by_filename(path, seqtype = nil) ! require 'bio/appl/clustalw/report' tf_out = Tempfile.open('clustalout') --- 155,164 ---- # Performs alignment of sequences in the file named +path+. ! # ! # Compatibility Note: 2nd argument (seqtype) is deprecated and ignored. ! def query_by_filename(path, *arg) ! if arg.size > 0 then ! warn '2nd argument of Bio::ClustalW#query_by_filename is ignored' ! end tf_out = Tempfile.open('clustalout') *************** *** 135,139 **** "-outorder=input" ] ! opt << "-type=#{seqtype}" if seqtype opt.concat(@options) exec_local(opt) --- 173,177 ---- "-outorder=input" ] ! #opt << "-type=#{seqtype}" if seqtype opt.concat(@options) exec_local(opt) *************** *** 144,148 **** @output_dnd = tf_dnd.read tf_dnd.close(true) ! @report = Report.new(@output, seqtype) @report end --- 182,186 ---- @output_dnd = tf_dnd.read tf_dnd.close(true) ! @report = Report.new(@output) @report end *************** *** 166,176 **** @command = [ @program, *opt ] #STDERR.print "DEBUG: ", @command.join(" "), "\n" ! @log = nil Bio::Command.call_command(@command) do |io| io.close_write ! @log = io.read end ! @log end --- 204,215 ---- @command = [ @program, *opt ] #STDERR.print "DEBUG: ", @command.join(" "), "\n" ! @data_stdout = nil ! @exit_status = nil Bio::Command.call_command(@command) do |io| io.close_write ! @data_stdout = io.read end ! @exit_status = $? end Index: mafft.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/mafft.rb,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** mafft.rb 5 Apr 2007 23:35:39 -0000 1.17 --- mafft.rb 16 Jul 2007 12:27:29 -0000 1.18 *************** *** 106,110 **** # +program+ is the name of the program. # +opt+ is options of the program. ! def initialize(program, opt) @program = program @options = opt --- 106,110 ---- # +program+ is the name of the program. # +opt+ is options of the program. ! def initialize(program = 'mafft', opt = []) @program = program @options = opt *************** *** 112,118 **** @output = nil @report = nil end ! # program name attr_accessor :program --- 112,120 ---- @output = nil @report = nil + @data_stdout = nil + @exit_status = nil end ! # program name (usually 'mafft' in UNIX) attr_accessor :program *************** *** 122,126 **** # option is deprecated. Instead, please use options. def option ! warn "option is deprecated. Please use options." options end --- 124,128 ---- # option is deprecated. Instead, please use options. def option ! warn "Bio::MAFFT#option is deprecated. Please use options." options end *************** *** 138,142 **** #log is deprecated (no replacement) and returns empty string. def log ! warn "log is deprecated (no replacement) and returns empty string." '' end --- 140,144 ---- #log is deprecated (no replacement) and returns empty string. def log ! warn "Bio::MAFFT#log is deprecated (no replacement) and returns empty string." '' end *************** *** 153,159 **** --- 155,180 ---- attr_reader :report + # Last exit status + attr_reader :exit_status + + # Last output to the stdout. + attr_accessor :data_stdout + + # Clear the internal data and status, except program and options. + def reset + @command = nil + @output = nil + @report = nil + @exit_status = nil + @data_stdout = nil + end + # Executes the program. # If +seqs+ is not nil, perform alignment for seqs. # If +seqs+ is nil, simply executes the program. + # + # Compatibility note: When seqs is nil, + # returns true if the program exits normally, and + # returns false if the program exits abnormally. def query(seqs) if seqs then *************** *** 161,179 **** else exec_local(@options) end end # Performs alignment for seqs. # +seqs+ should be Bio::Alignment or Array of sequences or nil. def query_align(seqs, *arg) unless seqs.is_a?(Bio::Alignment) ! seqs = Bio::Alignment.new(seqs, *arg) end query_string(seqs.output_fasta(:width => 70)) end # Performs alignment for +str+. # Str should be a string that can be recognized by the program. def query_string(str, *arg) begin tf_in = Tempfile.open('align') --- 182,219 ---- else exec_local(@options) + @exit_status.exitstatus == 0 ? true : false end end + # Note that this method will be renamed to query_alignment. + # # Performs alignment for seqs. # +seqs+ should be Bio::Alignment or Array of sequences or nil. + # + # Compatibility Note: arg is deprecated and ignored. def query_align(seqs, *arg) + if arg.size > 0 then + warn '2nd and other arguments of Bio::MAFFT#query_align is ignored' + end unless seqs.is_a?(Bio::Alignment) ! seqs = Bio::Alignment.new(seqs) end query_string(seqs.output_fasta(:width => 70)) end + # Performs alignment for seqs. + # +seqs+ should be Bio::Alignment or Array of sequences or nil. + def query_alignment(seqs) + query_align(seqs) + end + # Performs alignment for +str+. # Str should be a string that can be recognized by the program. + # + # Compatibility Note: arg is deprecated and ignored. def query_string(str, *arg) + if arg.size > 0 then + warn '2nd and other arguments of Bio::MAFFT#query_string is ignored' + end begin tf_in = Tempfile.open('align') *************** *** 188,195 **** # Performs alignment of sequences in the file named +fn+. ! def query_by_filename(fn, seqtype = nil) opt = @options + [ fn ] exec_local(opt) ! @report = Report.new(@output, seqtype) @report end --- 228,240 ---- # Performs alignment of sequences in the file named +fn+. ! # ! # Compatibility Note: 2nd argument (seqtype) is deprecated and ignored. ! def query_by_filename(fn, *arg) ! if arg.size > 0 then ! warn '2nd argument of Bio::MAFFT#query_filename is ignored' ! end opt = @options + [ fn ] exec_local(opt) ! @report = Report.new(@output) @report end *************** *** 200,208 **** @command = [ @program, *opt ] #STDERR.print "DEBUG: ", @command.join(" "), "\n" ! @output = nil Bio::Command.call_command(@command) do |io| io.close_write ! @output = io.read end end --- 245,256 ---- @command = [ @program, *opt ] #STDERR.print "DEBUG: ", @command.join(" "), "\n" ! @data_stdout = nil ! @exit_status = nil Bio::Command.call_command(@command) do |io| io.close_write ! @data_stdout = io.read end + @output = @data_stdout + @exit_status = $? end From ngoto at dev.open-bio.org Mon Jul 16 08:44:06 2007 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Mon, 16 Jul 2007 12:44:06 +0000 Subject: [BioRuby-cvs] bioruby ChangeLog,1.65,1.66 Message-ID: <200707161244.l6GCi6NT020232@dev.open-bio.org> Update of /home/repository/bioruby/bioruby In directory dev.open-bio.org:/tmp/cvs-serv20210 Modified Files: ChangeLog Log Message: documents are added Index: ChangeLog =================================================================== RCS file: /home/repository/bioruby/bioruby/ChangeLog,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** ChangeLog 10 Jul 2007 10:44:47 -0000 1.65 --- ChangeLog 16 Jul 2007 12:44:04 -0000 1.66 *************** *** 1,2 **** --- 1,32 ---- + 2007-07-16 Naohisa Goto + + * lib/bio/mafft/report.rb + + For generic multi-fasta formatted sequence alignment, + Bio::Alignment::MultiFastaFormat is newly added based on + Bio::MAFFT::Report class, and Bio::MAFFT::Report is + changed to inherit the new class. + Tests are added in test/unit/bio/appl/mafft/test_report.rb. + + * lib/bio/alignment.rb + + New modules and classes Bio::Alignment::FactoryTemplate::* are added. + They are used by following three new classes. + + * lib/bio/appl/muscle.rb + * lib/bio/appl/probcons.rb + * lib/bio/appl/tcoffee.rb + + New classess Bio::Muscle, Bio::Probcons, and Bio::Tcoffee are added + for MUSCLE, ProbCons, and T-Coffee multiple alignment programs. + Contributed by Jeffrey Blakeslee and colleagues. + + * lib/bio/appl/clustalw.rb + * lib/bio/appl/mafft.rb + + Interfaces of Bio::ClustalW and Bio::MAFFT are added/modified + to follow Bio::Alignment::FactoryTemplate (but not yet changed to + use it). + 2007-07-09 Naohisa Goto From ngoto at dev.open-bio.org Mon Jul 16 08:44:06 2007 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Mon, 16 Jul 2007 12:44:06 +0000 Subject: [BioRuby-cvs] bioruby/doc Changes-0.7.rd,1.22,1.23 Message-ID: <200707161244.l6GCi6nF020237@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/doc In directory dev.open-bio.org:/tmp/cvs-serv20210/doc Modified Files: Changes-0.7.rd Log Message: documents are added Index: Changes-0.7.rd =================================================================== RCS file: /home/repository/bioruby/bioruby/doc/Changes-0.7.rd,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Changes-0.7.rd 10 Jul 2007 10:44:47 -0000 1.22 --- Changes-0.7.rd 16 Jul 2007 12:44:04 -0000 1.23 *************** *** 297,300 **** --- 297,312 ---- No replacements/alternatives are available. + --- Bio::ClustalW, Bio::MAFFT + + In 1.1.0: + + * Bio::(ClustalW|MAFFT)#query_align, #query_string, #query_by_filename + are changed not to get second (and third, ...) arguments. + * Bio::(ClustalW|MAFFT)#query, #query_string, #query_by_filename + are changed not trying to guess whether given data is nucleotide or protein. + * Return value of Bio::(ClustalW|MAFFT)#query with no arguments is changed. + If the program exists normally (exit status is 0), returns true. + Otherwise, returns false. + --- Bio::MAFFT From k at dev.open-bio.org Mon Jul 16 14:06:14 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Mon, 16 Jul 2007 18:06:14 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io das.rb,1.16,1.17 Message-ID: <200707161806.l6GI6Eln020711@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv20684/lib/bio/io Modified Files: das.rb Log Message: * fixed that get_dsn.each {|dsn| dsn.mapmaster} to return correct value (mapmaster URL). This bug is fixed and reported by Dave Thorne on bioruby list on June 7, 2007. Index: das.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/das.rb,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** das.rb 5 Apr 2007 23:35:41 -0000 1.16 --- das.rb 16 Jul 2007 18:06:12 -0000 1.17 *************** *** 59,63 **** dsn.source_version = e.attributes['version'] when 'MAPMASTER' ! dsn.mapmaster = e.name when 'DESCRIPTION' dsn.description = e.text --- 59,63 ---- dsn.source_version = e.attributes['version'] when 'MAPMASTER' ! dsn.mapmaster = e.text when 'DESCRIPTION' dsn.description = e.text From nakao at dev.open-bio.org Mon Jul 16 15:21:35 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Mon, 16 Jul 2007 19:21:35 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio/appl/iprscan test_report.rb, 1.4, 1.5 Message-ID: <200707161921.l6GJLZJW021139@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio/appl/iprscan In directory dev.open-bio.org:/tmp/cvs-serv21101/test/unit/bio/appl/iprscan Modified Files: test_report.rb Log Message: * Fixed go terms parsing in the raw format. (Thanks ngoto-san). Index: test_report.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/unit/bio/appl/iprscan/test_report.rb,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_report.rb 22 Feb 2007 10:15:01 -0000 1.4 --- test_report.rb 16 Jul 2007 19:21:33 -0000 1.5 *************** *** 213,229 **** @obj = [] while line = test_raw.gets ! if entry != '' and entry.split("\t").first == line.split("\t").first entry << line ! elsif entry != '' @obj << Bio::Iprscan::Report.parse_in_raw(entry) ! entry = line else entry << line end end end def test_obj ! assert_equal(2, @obj.size) end --- 213,230 ---- @obj = [] while line = test_raw.gets ! if entry.split("\t").first == line.split("\t").first entry << line ! elsif entry != '' and entry.split("\t").first != line.split("\t").first @obj << Bio::Iprscan::Report.parse_in_raw(entry) ! entry = '' else entry << line end end + @obj << Bio::Iprscan::Report.parse_in_raw(entry) end def test_obj ! assert_equal(3, @obj.size) end *************** *** 293,297 **** def test_match_go_terms ! assert_equal(["Molecular Function:RNA binding (GO:0003723)"], @obj.first.matches.first.go_terms) end --- 294,301 ---- def test_match_go_terms ! ary = ["Biological Process:phosphorylation (GO:0016310)", ! "Molecular Function:transferase activity, transferring phosphorus-containing groups (GO:0016772)"] ! assert_equal(ary, ! @obj.last.matches.last.go_terms) end From nakao at dev.open-bio.org Mon Jul 16 15:21:35 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Mon, 16 Jul 2007 19:21:35 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/appl/iprscan report.rb,1.6,1.7 Message-ID: <200707161921.l6GJLZ0O021138@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/appl/iprscan In directory dev.open-bio.org:/tmp/cvs-serv21101/lib/bio/appl/iprscan Modified Files: report.rb Log Message: * Fixed go terms parsing in the raw format. (Thanks ngoto-san). Index: report.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/iprscan/report.rb,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** report.rb 5 Apr 2007 23:35:40 -0000 1.6 --- report.rb 16 Jul 2007 19:21:32 -0000 1.7 *************** *** 105,109 **** report.matches.last.ipr_description = line[12] end ! report.matches.last.go_terms = line[13].split(', ') if line[13] end report.query_id = report.matches.first.query_id --- 105,109 ---- report.matches.last.ipr_description = line[12] end ! report.matches.last.go_terms = line[13].scan(/(\w+ \w+\:.+? \(GO:\d+\))/).flatten if line[13] end report.query_id = report.matches.first.query_id From k at dev.open-bio.org Mon Jul 16 15:28:50 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Mon, 16 Jul 2007 19:28:50 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/util restriction_enzyme.rb, 1.15, 1.16 Message-ID: <200707161928.l6GJSoN8021258@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/util In directory dev.open-bio.org:/tmp/cvs-serv21244 Modified Files: restriction_enzyme.rb Log Message: * autoloadified Index: restriction_enzyme.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme.rb,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** restriction_enzyme.rb 13 May 2007 04:08:02 -0000 1.15 --- restriction_enzyme.rb 16 Jul 2007 19:28:48 -0000 1.16 *************** *** 9,27 **** # - require 'bio/db/rebase' - require 'bio/util/restriction_enzyme/double_stranded' - require 'bio/util/restriction_enzyme/single_strand' - require 'bio/util/restriction_enzyme/cut_symbol' - require 'bio/util/restriction_enzyme/analysis' - module Bio #:nodoc: ! # ! # bio/util/restriction_enzyme.rb - Digests DNA based on restriction enzyme cut patterns ! # ! # Author:: Trevor Wennblom ! # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) ! # License:: The Ruby License ! # # = Description # --- 9,16 ---- # module Bio #:nodoc: ! autoload :REBASE, 'bio/db/rebase' ! # = Description # *************** *** 124,129 **** # * Circular DNA cutting # ! ! class Bio::RestrictionEnzyme include CutSymbol extend CutSymbol --- 113,129 ---- # * Circular DNA cutting # ! ! class RestrictionEnzyme ! ! #require 'bio/util/restriction_enzyme/cut_symbol' ! ! autoload :CutSymbol, 'bio/util/restriction_enzyme/cut_symbol' ! autoload :StringFormatting, 'bio/util/restriction_enzyme/string_formatting' ! autoload :SingleStrand, 'bio/util/restriction_enzyme/single_strand' ! autoload :SingleStrandComplement, 'bio/util/restriction_enzyme/single_strand_complement' ! autoload :DoubleStranded, 'bio/util/restriction_enzyme/double_stranded' ! autoload :Analysis, 'bio/util/restriction_enzyme/analysis' ! autoload :Range, 'bio/util/restriction_enzyme/range/sequence_range' ! include CutSymbol extend CutSymbol *************** *** 226,228 **** end end # RestrictionEnzyme ! end # Bio \ No newline at end of file --- 226,228 ---- end end # RestrictionEnzyme ! end # Bio From k at dev.open-bio.org Mon Jul 16 15:28:50 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Mon, 16 Jul 2007 19:28:50 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/util/restriction_enzyme/double_stranded aligned_strands.rb, 1.5, 1.6 cut_location_pair.rb, 1.8, 1.9 cut_location_pair_in_enzyme_notation.rb, 1.6, 1.7 cut_locations.rb, 1.5, 1.6 cut_locations_in_enzyme_notation.rb, 1.6, 1.7 Message-ID: <200707161928.l6GJSoRx021270@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/double_stranded In directory dev.open-bio.org:/tmp/cvs-serv21244/restriction_enzyme/double_stranded Modified Files: aligned_strands.rb cut_location_pair.rb cut_location_pair_in_enzyme_notation.rb cut_locations.rb cut_locations_in_enzyme_notation.rb Log Message: * autoloadified Index: aligned_strands.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/double_stranded/aligned_strands.rb,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** aligned_strands.rb 5 Apr 2007 23:35:42 -0000 1.5 --- aligned_strands.rb 16 Jul 2007 19:28:48 -0000 1.6 *************** *** 1,4 **** # ! # bio/util/restrction_enzyme/double_stranded/aligned_strands.rb - Align two SingleStrand objects # # Author:: Trevor Wennblom --- 1,4 ---- # ! # bio/util/restriction_enzyme/double_stranded/aligned_strands.rb - Align two SingleStrand objects # # Author:: Trevor Wennblom *************** *** 9,27 **** # ! require 'bio/util/restriction_enzyme/single_strand' ! require 'bio/util/restriction_enzyme/cut_symbol' ! require 'bio/util/restriction_enzyme/string_formatting' ! module Bio; end ! class Bio::RestrictionEnzyme class DoubleStranded - # - # bio/util/restrction_enzyme/double_stranded/aligned_strands.rb - Align two SingleStrand objects - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # # Align two SingleStrand objects and return a Result # object with +primary+ and +complement+ accessors. --- 9,18 ---- # ! require 'bio/util/restriction_enzyme' ! module Bio ! class RestrictionEnzyme class DoubleStranded # Align two SingleStrand objects and return a Result # object with +primary+ and +complement+ accessors. *************** *** 136,138 **** end # AlignedStrands end # DoubleStranded ! end # Bio::RestrictionEnzyme --- 127,130 ---- end # AlignedStrands end # DoubleStranded ! end # RestrictionEnzyme ! end # Bio Index: cut_locations.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/double_stranded/cut_locations.rb,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** cut_locations.rb 5 Apr 2007 23:35:42 -0000 1.5 --- cut_locations.rb 16 Jul 2007 19:28:48 -0000 1.6 *************** *** 1,4 **** # ! # bio/util/restrction_enzyme/double_stranded/cut_locations.rb - Contains an Array of CutLocationPair objects # # Author:: Trevor Wennblom --- 1,4 ---- # ! # bio/util/restriction_enzyme/double_stranded/cut_locations.rb - Contains an Array of CutLocationPair objects # # Author:: Trevor Wennblom *************** *** 9,25 **** # ! require 'bio/util/restriction_enzyme/double_stranded/cut_location_pair' ! module Bio; end ! class Bio::RestrictionEnzyme class DoubleStranded - # - # bio/util/restrction_enzyme/double_stranded/cut_locations.rb - Contains an Array of CutLocationPair objects - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # # Contains an +Array+ of CutLocationPair objects. # --- 9,18 ---- # ! require 'bio/util/restriction_enzyme' ! module Bio ! class RestrictionEnzyme class DoubleStranded # Contains an +Array+ of CutLocationPair objects. # *************** *** 80,82 **** end # CutLocations end # DoubleStranded ! end # Bio::RestrictionEnzyme --- 73,76 ---- end # CutLocations end # DoubleStranded ! end # RestrictionEnzyme ! end # Bio Index: cut_locations_in_enzyme_notation.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/double_stranded/cut_locations_in_enzyme_notation.rb,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** cut_locations_in_enzyme_notation.rb 5 Apr 2007 23:35:42 -0000 1.6 --- cut_locations_in_enzyme_notation.rb 16 Jul 2007 19:28:48 -0000 1.7 *************** *** 1,4 **** # ! # bio/util/restrction_enzyme/double_stranded/cut_locations_in_enzyme_notation.rb - Inherits from DoubleStrand::CutLocations # # Author:: Trevor Wennblom --- 1,4 ---- # ! # bio/util/restriction_enzyme/double_stranded/cut_locations_in_enzyme_notation.rb - Inherits from DoubleStrand::CutLocations # # Author:: Trevor Wennblom *************** *** 9,26 **** # ! require 'bio/util/restriction_enzyme/double_stranded/cut_locations' ! require 'bio/util/restriction_enzyme/double_stranded/cut_location_pair_in_enzyme_notation' ! module Bio; end ! class Bio::RestrictionEnzyme class DoubleStranded - # - # bio/util/restrction_enzyme/double_stranded/cut_locations_in_enzyme_notation.rb - Inherits from DoubleStrand::CutLocations - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # # Inherits from DoubleStranded::CutLocations. Contains CutLocationPairInEnzymeNotation objects. # Adds helper methods to convert from enzyme index notation to 0-based array index notation. --- 9,18 ---- # ! require 'bio/util/restriction_enzyme' ! module Bio ! class RestrictionEnzyme class DoubleStranded # Inherits from DoubleStranded::CutLocations. Contains CutLocationPairInEnzymeNotation objects. # Adds helper methods to convert from enzyme index notation to 0-based array index notation. *************** *** 112,114 **** end # CutLocationsInEnzymeNotation end # DoubleStranded ! end # Bio::RestrictionEnzyme --- 104,107 ---- end # CutLocationsInEnzymeNotation end # DoubleStranded ! end # RestrictionEnzyme ! end # Bio Index: cut_location_pair_in_enzyme_notation.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/double_stranded/cut_location_pair_in_enzyme_notation.rb,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** cut_location_pair_in_enzyme_notation.rb 5 Apr 2007 23:35:42 -0000 1.6 --- cut_location_pair_in_enzyme_notation.rb 16 Jul 2007 19:28:48 -0000 1.7 *************** *** 1,4 **** # ! # bio/util/restrction_enzyme/double_stranded/cut_location_pair_in_enzyme_notation.rb - Inherits from DoubleStranded::CutLocationPair # # Author:: Trevor Wennblom --- 1,4 ---- # ! # bio/util/restriction_enzyme/double_stranded/cut_location_pair_in_enzyme_notation.rb - Inherits from DoubleStranded::CutLocationPair # # Author:: Trevor Wennblom *************** *** 9,25 **** # ! require 'bio/util/restriction_enzyme/double_stranded/cut_location_pair' ! module Bio; end ! class Bio::RestrictionEnzyme class DoubleStranded - # - # bio/util/restrction_enzyme/double_stranded/cut_location_pair_in_enzyme_notation.rb - Inherits from DoubleStranded::CutLocationPair - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # # Inherits from DoubleStranded::CutLocationPair , stores the cut location pair in # enzyme notation instead of 0-based. --- 9,18 ---- # ! require 'bio/util/restriction_enzyme' ! module Bio ! class RestrictionEnzyme class DoubleStranded # Inherits from DoubleStranded::CutLocationPair , stores the cut location pair in # enzyme notation instead of 0-based. *************** *** 42,44 **** end # CutLocationPair end # DoubleStranded ! end # Bio::RestrictionEnzyme --- 35,38 ---- end # CutLocationPair end # DoubleStranded ! end # RestrictionEnzyme ! end # Bio Index: cut_location_pair.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/double_stranded/cut_location_pair.rb,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** cut_location_pair.rb 5 Apr 2007 23:35:42 -0000 1.8 --- cut_location_pair.rb 16 Jul 2007 19:28:48 -0000 1.9 *************** *** 1,4 **** # ! # bio/util/restrction_enzyme/double_stranded/cut_location_pair.rb - Stores a cut location pair in 0-based index notation # # Author:: Trevor Wennblom --- 1,4 ---- # ! # bio/util/restriction_enzyme/double_stranded/cut_location_pair.rb - Stores a cut location pair in 0-based index notation # # Author:: Trevor Wennblom *************** *** 9,25 **** # ! require 'bio/util/restriction_enzyme/cut_symbol' ! module Bio; end ! class Bio::RestrictionEnzyme class DoubleStranded - # - # bio/util/restrction_enzyme/double_stranded/cut_location_pair.rb - Stores a cut location pair in 0-based index notation - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # # Stores a single cut location pair in 0-based index notation for use with # DoubleStranded enzyme sequences. --- 9,18 ---- # ! require 'bio/util/restriction_enzyme' ! module Bio ! class RestrictionEnzyme class DoubleStranded # Stores a single cut location pair in 0-based index notation for use with # DoubleStranded enzyme sequences. *************** *** 107,109 **** end # CutLocationPair end # DoubleStranded ! end # Bio::RestrictionEnzyme --- 100,103 ---- end # CutLocationPair end # DoubleStranded ! end # RestrictionEnzyme ! end # Bio From k at dev.open-bio.org Mon Jul 16 15:28:50 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Mon, 16 Jul 2007 19:28:50 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/util/restriction_enzyme/single_strand cut_locations_in_enzyme_notation.rb, 1.6, 1.7 Message-ID: <200707161928.l6GJSoc4021293@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/single_strand In directory dev.open-bio.org:/tmp/cvs-serv21244/restriction_enzyme/single_strand Modified Files: cut_locations_in_enzyme_notation.rb Log Message: * autoloadified Index: cut_locations_in_enzyme_notation.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/single_strand/cut_locations_in_enzyme_notation.rb,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** cut_locations_in_enzyme_notation.rb 5 Apr 2007 23:35:42 -0000 1.6 --- cut_locations_in_enzyme_notation.rb 16 Jul 2007 19:28:48 -0000 1.7 *************** *** 9,26 **** # ! require 'bio/util/restriction_enzyme/cut_symbol' ! require 'bio/sequence' ! module Bio; end ! class Bio::RestrictionEnzyme ! class SingleStrand < Bio::Sequence::NA - # - # bio/util/restriction_enzyme/single_strand/cut_locations_in_enzyme_notation.rb - The cut locations, in enzyme notation - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # # Stores the cut location in thier enzyme index notation # --- 9,18 ---- # ! require 'bio/util/restriction_enzyme' ! module Bio ! class RestrictionEnzyme ! class SingleStrand # Stores the cut location in thier enzyme index notation # *************** *** 140,142 **** end # CutLocationsInEnzymeNotation end # SingleStrand ! end # Bio::RestrictionEnzyme \ No newline at end of file --- 132,135 ---- end # CutLocationsInEnzymeNotation end # SingleStrand ! end # RestrictionEnzyme ! end # Bio From k at dev.open-bio.org Mon Jul 16 15:28:50 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Mon, 16 Jul 2007 19:28:50 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/util/restriction_enzyme/range cut_range.rb, 1.3, 1.4 cut_ranges.rb, 1.4, 1.5 horizontal_cut_range.rb, 1.4, 1.5 sequence_range.rb, 1.8, 1.9 vertical_cut_range.rb, 1.4, 1.5 Message-ID: <200707161928.l6GJSoH9021277@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/range In directory dev.open-bio.org:/tmp/cvs-serv21244/restriction_enzyme/range Modified Files: cut_range.rb cut_ranges.rb horizontal_cut_range.rb sequence_range.rb vertical_cut_range.rb Log Message: * autoloadified Index: vertical_cut_range.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/range/vertical_cut_range.rb,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** vertical_cut_range.rb 5 Apr 2007 23:35:42 -0000 1.4 --- vertical_cut_range.rb 16 Jul 2007 19:28:48 -0000 1.5 *************** *** 1,4 **** # ! # bio/util/restrction_enzyme/range/vertical_cut_range.rb - # # Author:: Trevor Wennblom --- 1,4 ---- # ! # bio/util/restriction_enzyme/range/vertical_cut_range.rb - # # Author:: Trevor Wennblom *************** *** 9,25 **** # ! require 'bio/util/restriction_enzyme/range/cut_range' ! module Bio; end ! class Bio::RestrictionEnzyme class Range - # - # bio/util/restrction_enzyme/range/vertical_cut_range.