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.rb - - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # # FIXME docs are kind of out of date. Change this to VerticalAndHorizontalCutRange class VerticalCutRange < CutRange --- 9,18 ---- # ! require 'bio/util/restriction_enzyme' ! module Bio ! class RestrictionEnzyme class Range # FIXME docs are kind of out of date. Change this to VerticalAndHorizontalCutRange class VerticalCutRange < CutRange *************** *** 81,83 **** end # VerticalCutRange end # Range ! end # Bio::RestrictionEnzyme --- 74,77 ---- end # VerticalCutRange end # Range ! end # RestrictionEnzyme ! end # Bio Index: horizontal_cut_range.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/range/horizontal_cut_range.rb,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** horizontal_cut_range.rb 5 Apr 2007 23:35:42 -0000 1.4 --- horizontal_cut_range.rb 16 Jul 2007 19:28:48 -0000 1.5 *************** *** 1,4 **** # ! # bio/util/restrction_enzyme/range/horizontal_cut_range.rb - # # Author:: Trevor Wennblom --- 1,4 ---- # ! # bio/util/restriction_enzyme/range/horizontal_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/horizontal_cut_range.rb - - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # class HorizontalCutRange < CutRange attr_reader :p_cut_left, :p_cut_right --- 9,18 ---- # ! require 'bio/util/restriction_enzyme' ! module Bio ! class RestrictionEnzyme class Range class HorizontalCutRange < CutRange attr_reader :p_cut_left, :p_cut_right *************** *** 71,73 **** end # HorizontalCutRange end # Range ! end # Bio::RestrictionEnzyme --- 64,67 ---- end # HorizontalCutRange end # Range ! end # RestrictionEnzyme ! end # Bio Index: sequence_range.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/range/sequence_range.rb,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** sequence_range.rb 13 May 2007 04:08:02 -0000 1.8 --- sequence_range.rb 16 Jul 2007 19:28:48 -0000 1.9 *************** *** 1,4 **** # ! # bio/util/restrction_enzyme/range/sequence_range.rb - A defined range over a nucleotide sequence # # Author:: Trevor Wennblom --- 1,4 ---- # ! # bio/util/restriction_enzyme/range/sequence_range.rb - A defined range over a nucleotide sequence # # Author:: Trevor Wennblom *************** *** 9,30 **** # ! require 'bio/util/restriction_enzyme/range/cut_ranges' ! require 'bio/util/restriction_enzyme/range/horizontal_cut_range' ! require 'bio/util/restriction_enzyme/range/vertical_cut_range' ! require 'bio/util/restriction_enzyme/range/sequence_range/calculated_cuts' ! require 'bio/util/restriction_enzyme/range/sequence_range/fragments' ! require 'bio/util/restriction_enzyme/range/sequence_range/fragment' ! require 'bio' ! module Bio; end ! class Bio::RestrictionEnzyme class Range ! # ! # bio/util/restrction_enzyme/range/sequence_range.rb - A defined range over a nucleotide sequence ! # ! # Author:: Trevor Wennblom ! # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) ! # License:: The Ruby License ! # # A defined range over a nucleotide sequence. # --- 9,23 ---- # ! require 'bio/util/restriction_enzyme' ! module Bio ! class RestrictionEnzyme class Range ! ! autoload :CutRange, 'bio/util/restriction_enzyme/range/cut_range' ! autoload :CutRanges, 'bio/util/restriction_enzyme/range/cut_ranges' ! autoload :HorizontalCutRange, 'bio/util/restriction_enzyme/range/horizontal_cut_range' ! autoload :VerticalCutRange, 'bio/util/restriction_enzyme/range/vertical_cut_range' ! # A defined range over a nucleotide sequence. # *************** *** 33,36 **** --- 26,33 ---- class SequenceRange + autoload :Fragment, 'bio/util/restriction_enzyme/range/sequence_range/fragment' + autoload :Fragments, 'bio/util/restriction_enzyme/range/sequence_range/fragments' + autoload :CalculatedCuts, 'bio/util/restriction_enzyme/range/sequence_range/calculated_cuts' + # Left-most index of primary strand attr_reader :p_left *************** *** 257,259 **** end # SequenceRange end # Range ! end # Bio::RestrictionEnzyme \ No newline at end of file --- 254,257 ---- end # SequenceRange end # Range ! end # RestrictionEnzyme ! end # Bio Index: cut_ranges.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/range/cut_ranges.rb,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** cut_ranges.rb 5 Apr 2007 23:35:42 -0000 1.4 --- cut_ranges.rb 16 Jul 2007 19:28:48 -0000 1.5 *************** *** 1,4 **** # ! # bio/util/restrction_enzyme/range/cut_ranges.rb - Container for many CutRange objects or CutRange child objects. # # Author:: Trevor Wennblom --- 1,4 ---- # ! # bio/util/restriction_enzyme/range/cut_ranges.rb - Container for many CutRange objects or CutRange child objects. # # Author:: Trevor Wennblom *************** *** 9,23 **** # ! module Bio; end ! class Bio::RestrictionEnzyme class Range - # - # bio/util/restrction_enzyme/range/cut_ranges.rb - Container for many CutRange objects or CutRange child objects. - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # # Container for many CutRange objects or CutRange child objects. Inherits from array. # --- 9,18 ---- # ! require 'bio/util/restriction_enzyme' ! ! module Bio ! class RestrictionEnzyme class Range # Container for many CutRange objects or CutRange child objects. Inherits from array. # *************** *** 49,51 **** end # CutRanges end # Range ! end # Bio::RestrictionEnzyme --- 44,47 ---- end # CutRanges end # Range ! end # RestrictionEnzyme ! end # Bio Index: cut_range.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/range/cut_range.rb,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** cut_range.rb 5 Apr 2007 23:35:42 -0000 1.3 --- cut_range.rb 16 Jul 2007 19:28:48 -0000 1.4 *************** *** 1,4 **** # ! # bio/util/restrction_enzyme/range/cut_range.rb - Abstract base class for HorizontalCutRange and VerticalCutRange # # Author:: Trevor Wennblom --- 1,4 ---- # ! # bio/util/restriction_enzyme/range/cut_range.rb - Abstract base class for HorizontalCutRange and VerticalCutRange # # Author:: Trevor Wennblom *************** *** 9,29 **** # ! require 'bio' ! module Bio; end ! class Bio::RestrictionEnzyme class Range - # - # bio/util/restrction_enzyme/range/cut_range.rb - Abstract base class for HorizontalCutRange and VerticalCutRange - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # # Abstract base class for HorizontalCutRange and VerticalCutRange # class CutRange end # CutRange end # Range ! end # Bio::RestrictionEnzyme \ No newline at end of file --- 9,24 ---- # ! require 'bio/util/restriction_enzyme' ! module Bio ! class RestrictionEnzyme class Range # Abstract base class for HorizontalCutRange and VerticalCutRange # class CutRange end # CutRange + end # Range ! 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 analysis.rb, 1.19, 1.20 analysis_basic.rb, 1.15, 1.16 cut_symbol.rb, 1.5, 1.6 double_stranded.rb, 1.10, 1.11 single_strand.rb, 1.6, 1.7 single_strand_complement.rb, 1.4, 1.5 string_formatting.rb, 1.5, 1.6 Message-ID: <200707161928.l6GJSoKo021263@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme In directory dev.open-bio.org:/tmp/cvs-serv21244/restriction_enzyme Modified Files: analysis.rb analysis_basic.rb cut_symbol.rb double_stranded.rb single_strand.rb single_strand_complement.rb string_formatting.rb Log Message: * autoloadified Index: analysis_basic.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/analysis_basic.rb,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** analysis_basic.rb 13 May 2007 04:08:02 -0000 1.15 --- analysis_basic.rb 16 Jul 2007 19:28:48 -0000 1.16 *************** *** 1,4 **** # ! # bio/util/restrction_enzyme/analysis_basic.rb - Does the work of fragmenting the DNA from the enzymes # # Author:: Trevor Wennblom --- 1,4 ---- # ! # bio/util/restriction_enzyme/analysis_basic.rb - Does the work of fragmenting the DNA from the enzymes # # Author:: Trevor Wennblom *************** *** 11,25 **** require 'set' # for method create_enzyme_actions require 'bio/util/restriction_enzyme' - require 'bio/util/restriction_enzyme/range/sequence_range' ! class Bio::RestrictionEnzyme - # - # bio/util/restrction_enzyme/analysis_basic.rb - Does the work of fragmenting the DNA from the enzymes - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # class Analysis --- 11,18 ---- require 'set' # for method create_enzyme_actions require 'bio/util/restriction_enzyme' ! module Bio ! class RestrictionEnzyme class Analysis *************** *** 221,223 **** end # Analysis ! end # Bio::RestrictionEnzyme --- 214,217 ---- end # Analysis ! end # RestrictionEnzyme ! end # Bio Index: string_formatting.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/string_formatting.rb,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** string_formatting.rb 5 Apr 2007 23:35:42 -0000 1.5 --- string_formatting.rb 16 Jul 2007 19:28:48 -0000 1.6 *************** *** 9,24 **** # ! require 'bio/util/restriction_enzyme/cut_symbol' ! module Bio; end ! class Bio::RestrictionEnzyme - # - # bio/util/restriction_enzyme/string_formatting.rb - Useful functions for string manipulation - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # module StringFormatting include CutSymbol --- 9,17 ---- # ! require 'bio/util/restriction_enzyme' ! module Bio ! class RestrictionEnzyme module StringFormatting include CutSymbol *************** *** 115,117 **** end end # StringFormatting ! end # Bio::RestrictionEnzyme --- 108,111 ---- end end # StringFormatting ! end # RestrictionEnzyme ! end # Bio Index: cut_symbol.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/cut_symbol.rb,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** cut_symbol.rb 5 Apr 2007 23:35:42 -0000 1.5 --- cut_symbol.rb 16 Jul 2007 19:28:48 -0000 1.6 *************** *** 1,4 **** # ! # bio/util/restrction_enzyme/cut_symbol.rb - Defines the symbol used to mark a cut in an enzyme sequence # # Author:: Trevor Wennblom --- 1,4 ---- # ! # bio/util/restriction_enzyme/cut_symbol.rb - Defines the symbol used to mark a cut in an enzyme sequence # # Author:: Trevor Wennblom *************** *** 9,24 **** # ! nil # to separate file-level rdoc from following statement # !> useless use of nil in void context ! ! module Bio; end ! class Bio::RestrictionEnzyme - # - # bio/util/restrction_enzyme/cut_symbol.rb - Defines the symbol used to mark a cut in an enzyme sequence - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # # = Usage # --- 9,15 ---- # ! module Bio ! class RestrictionEnzyme # = Usage # *************** *** 113,115 **** end # CutSymbol ! end # Bio::RestrictionEnzyme --- 104,107 ---- end # CutSymbol ! end # RestrictionEnzyme ! end # Bio Index: single_strand_complement.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/single_strand_complement.rb,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** single_strand_complement.rb 5 Apr 2007 23:35:42 -0000 1.4 --- single_strand_complement.rb 16 Jul 2007 19:28:48 -0000 1.5 *************** *** 9,24 **** # ! require 'bio/util/restriction_enzyme/single_strand' ! module Bio; end ! class Bio::RestrictionEnzyme - # - # bio/util/restriction_enzyme/single_strand_complement.rb - Single strand restriction enzyme sequence in complement orientation - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # # A single strand of restriction enzyme sequence pattern with a 3' to 5' orientation. # --- 9,17 ---- # ! require 'bio/util/restriction_enzyme' ! module Bio ! class RestrictionEnzyme # A single strand of restriction enzyme sequence pattern with a 3' to 5' orientation. # *************** *** 27,29 **** def orientation; [3, 5]; end end # SingleStrandComplement ! end # Bio::RestrictionEnzyme --- 20,23 ---- def orientation; [3, 5]; end end # SingleStrandComplement ! end # RestrictionEnzyme ! end # Bio Index: double_stranded.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/double_stranded.rb,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** double_stranded.rb 5 Apr 2007 23:35:42 -0000 1.10 --- double_stranded.rb 16 Jul 2007 19:28:48 -0000 1.11 *************** *** 1,4 **** # ! # bio/util/restrction_enzyme/double_stranded.rb - DoubleStranded restriction enzyme sequence # # Author:: Trevor Wennblom --- 1,4 ---- # ! # bio/util/restriction_enzyme/double_stranded.rb - DoubleStranded restriction enzyme sequence # # Author:: Trevor Wennblom *************** *** 9,33 **** # - require 'bio/db/rebase' require 'bio/util/restriction_enzyme' - require 'bio/util/restriction_enzyme/range/sequence_range' - - require 'bio/util/restriction_enzyme/cut_symbol' - require 'bio/util/restriction_enzyme/single_strand' - require 'bio/util/restriction_enzyme/single_strand_complement' - require 'bio/util/restriction_enzyme/double_stranded/aligned_strands' - require 'bio/util/restriction_enzyme/double_stranded/cut_locations' - require 'bio/util/restriction_enzyme/double_stranded/cut_locations_in_enzyme_notation' ! module Bio; end ! class Bio::RestrictionEnzyme - # - # bio/util/restrction_enzyme/double_stranded.rb - DoubleStranded restriction enzyme sequence - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # # A pair of SingleStrand and SingleStrandComplement objects with methods to # add utility to their relation. --- 9,17 ---- # require 'bio/util/restriction_enzyme' ! module Bio ! class RestrictionEnzyme # A pair of SingleStrand and SingleStrandComplement objects with methods to # add utility to their relation. *************** *** 41,44 **** --- 25,35 ---- # FIXME needs better docs class DoubleStranded + + autoload :AlignedStrands, 'bio/util/restriction_enzyme/double_stranded/aligned_strands' + autoload :CutLocations, 'bio/util/restriction_enzyme/double_stranded/cut_locations' + autoload :CutLocationPair, 'bio/util/restriction_enzyme/double_stranded/cut_location_pair' + autoload :CutLocationsInEnzymeNotation, 'bio/util/restriction_enzyme/double_stranded/cut_locations_in_enzyme_notation' + autoload :CutLocationPairInEnzymeNotation, 'bio/util/restriction_enzyme/double_stranded/cut_location_pair_in_enzyme_notation' + include CutSymbol extend CutSymbol *************** *** 327,329 **** end # DoubleStranded ! end # Bio::RestrictionEnzyme --- 318,321 ---- end # DoubleStranded ! end # RestrictionEnzyme ! end # Bio Index: single_strand.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/single_strand.rb,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** single_strand.rb 5 Apr 2007 23:35:42 -0000 1.6 --- single_strand.rb 16 Jul 2007 19:28:48 -0000 1.7 *************** *** 9,27 **** # ! require 'bio/util/restriction_enzyme/single_strand/cut_locations_in_enzyme_notation' ! require 'bio/util/restriction_enzyme/cut_symbol' ! require 'bio/util/restriction_enzyme/string_formatting' require 'bio/sequence' ! module Bio; end ! class Bio::RestrictionEnzyme - # - # bio/util/restriction_enzyme/single_strand.rb - Single strand of a restriction enzyme sequence - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # # A single strand of restriction enzyme sequence pattern with a 5' to 3' # orientation. --- 9,18 ---- # ! require 'bio/util/restriction_enzyme' require 'bio/sequence' ! module Bio ! class RestrictionEnzyme # A single strand of restriction enzyme sequence pattern with a 5' to 3' # orientation. *************** *** 31,34 **** --- 22,28 ---- # class SingleStrand < Bio::Sequence::NA + + autoload :CutLocationsInEnzymeNotation, 'bio/util/restriction_enzyme/single_strand/cut_locations_in_enzyme_notation' + include CutSymbol include StringFormatting *************** *** 202,204 **** end # SingleStrand ! end # Bio::RestrictionEnzyme \ No newline at end of file --- 196,199 ---- end # SingleStrand ! end # RestrictionEnzyme ! end # Bio Index: analysis.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/analysis.rb,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** analysis.rb 13 May 2007 04:08:02 -0000 1.19 --- analysis.rb 16 Jul 2007 19:28:48 -0000 1.20 *************** *** 1,4 **** # ! # bio/util/restrction_enzyme/analysis.rb - Does the work of fragmenting the DNA from the enzymes # # Author:: Trevor Wennblom --- 1,4 ---- # ! # bio/util/restriction_enzyme/analysis.rb - Does the work of fragmenting the DNA from the enzymes # # Author:: Trevor Wennblom *************** *** 9,23 **** # require 'bio/util/restriction_enzyme/analysis_basic' ! class Bio::RestrictionEnzyme - # - # bio/util/restrction_enzyme/analysis.rb - Does the work of fragmenting the DNA from the enzymes - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # class Analysis --- 9,18 ---- # + require 'bio/util/restriction_enzyme' require 'bio/util/restriction_enzyme/analysis_basic' ! module Bio ! class RestrictionEnzyme class Analysis *************** *** 251,253 **** end # Analysis ! end # Bio::RestrictionEnzyme --- 246,249 ---- end # Analysis ! 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/sequence_range calculated_cuts.rb, 1.6, 1.7 fragment.rb, 1.5, 1.6 fragments.rb, 1.4, 1.5 Message-ID: <200707161928.l6GJSoUk021286@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/range/sequence_range In directory dev.open-bio.org:/tmp/cvs-serv21244/restriction_enzyme/range/sequence_range Modified Files: calculated_cuts.rb fragment.rb fragments.rb Log Message: * autoloadified Index: calculated_cuts.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/range/sequence_range/calculated_cuts.rb,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** calculated_cuts.rb 5 Apr 2007 23:35:42 -0000 1.6 --- calculated_cuts.rb 16 Jul 2007 19:28:48 -0000 1.7 *************** *** 1,4 **** # ! # bio/util/restrction_enzyme/range/sequence_range/calculated_cuts.rb - # # Author:: Trevor Wennblom --- 1,4 ---- # ! # bio/util/restriction_enzyme/range/sequence_range/calculated_cuts.rb - # # Author:: Trevor Wennblom *************** *** 9,28 **** # ! require 'bio/util/restriction_enzyme' # test/runner.rb wont load without this ! require 'bio/util/restriction_enzyme/cut_symbol' ! require 'bio/util/restriction_enzyme/string_formatting' ! module Bio; end ! class Bio::RestrictionEnzyme class Range class SequenceRange - # - # bio/util/restrction_enzyme/range/sequence_range/calculated_cuts.rb - - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # # cc = CalculatedCuts.new(@size) # cc.add_cuts_from_cut_ranges(@cut_ranges) --- 9,19 ---- # ! require 'bio/util/restriction_enzyme' ! module Bio ! class RestrictionEnzyme class Range class SequenceRange # cc = CalculatedCuts.new(@size) # cc.add_cuts_from_cut_ranges(@cut_ranges) *************** *** 248,250 **** end # SequenceRange end # Range ! end # Bio::RestrictionEnzyme --- 239,242 ---- end # SequenceRange end # Range ! end # RestrictionEnzyme ! end # Bio Index: fragment.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/range/sequence_range/fragment.rb,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** fragment.rb 13 May 2007 04:08:02 -0000 1.5 --- fragment.rb 16 Jul 2007 19:28:48 -0000 1.6 *************** *** 1,4 **** # ! # bio/util/restrction_enzyme/range/sequence_range/fragment.rb - # # Author:: Trevor Wennblom --- 1,4 ---- # ! # bio/util/restriction_enzyme/range/sequence_range/fragment.rb - # # Author:: Trevor Wennblom *************** *** 9,28 **** # ! require 'bio/util/restriction_enzyme/range/cut_ranges' ! require 'bio/util/restriction_enzyme/range/horizontal_cut_range' ! require 'bio' ! module Bio; end ! class Bio::RestrictionEnzyme class Range class SequenceRange - # - # bio/util/restrction_enzyme/range/sequence_range/fragment.rb - - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # class Fragment --- 9,19 ---- # ! require 'bio/util/restriction_enzyme' ! module Bio ! class RestrictionEnzyme class Range class SequenceRange class Fragment *************** *** 57,59 **** end # SequenceRange end # Range ! end # Bio::RestrictionEnzyme --- 48,51 ---- end # SequenceRange end # Range ! end # RestrictionEnzyme ! end # Bio Index: fragments.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/range/sequence_range/fragments.rb,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** fragments.rb 5 Apr 2007 23:35:42 -0000 1.4 --- fragments.rb 16 Jul 2007 19:28:48 -0000 1.5 *************** *** 1,4 **** # ! # bio/util/restrction_enzyme/analysis/fragments.rb - # # Author:: Trevor Wennblom --- 1,4 ---- # ! # bio/util/restriction_enzyme/analysis/fragments.rb - # # Author:: Trevor Wennblom *************** *** 9,24 **** # ! module Bio; end ! class Bio::RestrictionEnzyme class Range class SequenceRange - # - # bio/util/restrction_enzyme/range/sequence_range/fragments.rb - - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # class Fragments < Array --- 9,19 ---- # ! require 'bio/util/restriction_enzyme' ! ! module Bio ! class RestrictionEnzyme class Range class SequenceRange class Fragments < Array *************** *** 43,45 **** end # SequenceRange end # Range ! end # Bio::RestrictionEnzyme --- 38,41 ---- end # SequenceRange end # Range ! end # RestrictionEnzyme ! end # Bio From k at dev.open-bio.org Mon Jul 16 15:29:34 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Mon, 16 Jul 2007 19:29:34 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio/util/restriction_enzyme test_analysis.rb, 1.12, 1.13 test_double_stranded.rb, 1.5, 1.6 Message-ID: <200707161929.l6GJTY9d021321@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio/util/restriction_enzyme In directory dev.open-bio.org:/tmp/cvs-serv21317 Modified Files: test_analysis.rb test_double_stranded.rb Log Message: * added require 'bio/sequence' to work Index: test_double_stranded.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/unit/bio/util/restriction_enzyme/test_double_stranded.rb,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test_double_stranded.rb 5 Apr 2007 23:35:44 -0000 1.5 --- test_double_stranded.rb 16 Jul 2007 19:29:32 -0000 1.6 *************** *** 15,18 **** --- 15,19 ---- require 'test/unit' require 'bio/util/restriction_enzyme/double_stranded' + require 'bio/sequence' module Bio #:nodoc: Index: test_analysis.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/unit/bio/util/restriction_enzyme/test_analysis.rb,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** test_analysis.rb 13 May 2007 04:08:02 -0000 1.12 --- test_analysis.rb 16 Jul 2007 19:29:32 -0000 1.13 *************** *** 15,18 **** --- 15,19 ---- require 'test/unit' require 'bio/util/restriction_enzyme/analysis' + require 'bio/sequence' module Bio #:nodoc: From nakao at dev.open-bio.org Tue Jul 17 10:16:52 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Tue, 17 Jul 2007 14:16:52 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/appl/iprscan report.rb,1.7,1.8 Message-ID: <200707171416.l6HEGqZj025188@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/appl/iprscan In directory dev.open-bio.org:/tmp/cvs-serv25166/lib/bio/appl/iprscan Modified Files: report.rb Log Message: * Fixed a bug in Bio::Iprscan::Report.reports_in_raw (thanks ngoto-san). Index: report.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/iprscan/report.rb,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** report.rb 16 Jul 2007 19:21:32 -0000 1.7 --- report.rb 17 Jul 2007 14:16:50 -0000 1.8 *************** *** 82,85 **** --- 82,86 ---- end end + yield Bio::Iprscan::Report.parse_in_raw(entry) if entry != '' end *************** *** 260,276 **** @matches.map { |match| [self.query_id, ! self.crc64, ! self.query_length, ! match.method, ! match.accession, ! match.description, ! match.match_start, ! match.match_end, ! match.evalue, ! match.status, ! match.date, ! match.ipr_id, ! match.ipr_description, ! match.go_terms.map {|x| x[0] + ': ' + x[1] + ' (' + x[2] + ')' }.join(', ') ].join("\t") }.join("\n") --- 261,277 ---- @matches.map { |match| [self.query_id, ! self.crc64, ! self.query_length, ! match.method, ! match.accession, ! match.description, ! match.match_start, ! match.match_end, ! match.evalue, ! match.status, ! match.date, ! match.ipr_id, ! match.ipr_description, ! match.go_terms.map {|x| x[0] + ': ' + x[1] + ' (' + x[2] + ')' }.join(', ') ].join("\t") }.join("\n") From nakao at dev.open-bio.org Tue Jul 17 10:16:53 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Tue, 17 Jul 2007 14:16:53 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio/appl/iprscan test_report.rb, 1.5, 1.6 Message-ID: <200707171416.l6HEGrd9025191@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio/appl/iprscan In directory dev.open-bio.org:/tmp/cvs-serv25166/test/unit/bio/appl/iprscan Modified Files: test_report.rb Log Message: * Fixed a bug in Bio::Iprscan::Report.reports_in_raw (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.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test_report.rb 16 Jul 2007 19:21:33 -0000 1.5 --- test_report.rb 17 Jul 2007 14:16:50 -0000 1.6 *************** *** 224,227 **** --- 224,239 ---- @obj << Bio::Iprscan::Report.parse_in_raw(entry) end + + def test_self_reports_in_raw + io = File.open(File.join(Bio::TestIprscanData::TestDataIprscan, + "merged.raw")) + result = [] + Bio::Iprscan::Report.reports_in_raw(io) {|x| result << x } + assert_equal(@obj.size, result.size) + assert_equal(@obj.first.query_id, result.first.query_id) + assert_equal(@obj.first.query_id, result.first.query_id) + assert_equal(@obj[2].query_id, result[2].query_id) + assert_equal(@obj.last.query_id, result.last.query_id) + end def test_obj From k at dev.open-bio.org Wed Jul 18 04:20:51 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 18 Jul 2007 08:20:51 +0000 Subject: [BioRuby-cvs] bioruby ChangeLog,1.66,1.67 Message-ID: <200707180820.l6I8KpIG027894@dev.open-bio.org> Update of /home/repository/bioruby/bioruby In directory dev.open-bio.org:/tmp/cvs-serv27890 Modified Files: ChangeLog Log Message: * Added changes made by Katayama over the past year Index: ChangeLog =================================================================== RCS file: /home/repository/bioruby/bioruby/ChangeLog,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** ChangeLog 16 Jul 2007 12:44:04 -0000 1.66 --- ChangeLog 18 Jul 2007 08:20:48 -0000 1.67 *************** *** 1,16 **** 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 --- 1,23 ---- + 2007-07-17 Toshiaki Katayama + + * lib/bio/io/das.rb + + Fixed that mapmaster method to return correct value (mapmaseter's + URL). This bug is reported and fixed by Dave Thorne. + 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 *************** *** 18,31 **** * 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 --- 25,65 ---- * 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 Toshiaki Katayama ! ! * BioRuby shell on Rails has new CSS theme ! ! 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! ! ! 2007-07-09 Toshiaki Katayama ! ! * lib/bio/db/kegg/taxonomy.rb ! ! Newly added KEGG taxonomy file parser which treats taxonomic tree ! structure of the KEGG organisms. The file is available at ! ftp://ftp.genome.jp/pub/kegg/genes/taxonomy ! and is a replacement of the previously used keggtab file (obsoleted). ! ! * lib/bio/db/kegg/keggtab.rb ! ! Bio::KEGG::Keggtab is obsoleted as the file is no longer provided. ! Use Bio::KEGG::Taxonomy (lib/bio/db/kegg/taxonomy.rb) instead. ! ! * lib/bio/shell/plugin/soap.rb ! ! Newly added web service plugins for BioRuby shell which supports ! NCBI SOAP, EBI SOAP and DDBJ XML in addition to the KEGG API. 2007-07-09 Naohisa Goto *************** *** 33,49 **** * 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 --- 67,83 ---- * 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 *************** *** 51,55 **** * lib/bio/io/flatfile.rb ! Bio::FlatFile.foreach is added (which is suggested by IO.foreach). 2007-04-02 Naohisa Goto --- 85,214 ---- * lib/bio/io/flatfile.rb ! Bio::FlatFile.foreach is added (which is suggested by IO.foreach). ! ! 2007-06-28 Toshiaki Katayama ! ! * lib/bio/shell/setup.rb, core.rb ! ! Changed not to use Dir.chdir by caching full path of the save ! directory at a start up time, so that user can freely change ! the work directory without affecting object/history saving ! functionality. ! ! Bio::Shell.cache[:savedir] stores the session saving directory ! (session means shell/session/{config,history,object} files), ! Bio::Shell.cache[:workdir] stores the working directory at a start ! up time (can be same directory with the :savedir) and both are ! converted and stored as full path allowing user to use Dir.chdir ! in the shell session). ! ! If --rails (-r) option is applied, 'bioruby' command will run in ! the Rails server mode, and the server will start in the :savedir. ! ! (A) IRB mode ! ! 1. run in the current directory and the session will be saved ! in the ~/.bioruby directory ! ! % bioruby ! ! 2. run in the current directory and the session will be saved ! in the foo/bar directory ! ! % bioruby foo/bar ! ! 3. run in the current directory and the session will be saved ! in the /tmp/foo/bar directory ! ! % bioruby /tmp/foo/bar ! ! (B) Rails mode ! ! 4. run in the ~/.bioruby directory and the session will also be saved ! in the ~/.bioruby directory ! ! % bioruby -r ! ! 5. run in the foo/bar directory and the session will also be saved ! in the foo/bar directory ! ! % bioruby -r foo/bar ! ! 6. run in the /tmp/foo/bar directory and the session will also be ! saved in the /tmp/foo/bar directory ! ! % bioruby -r /tmp/foo/bar ! ! (C) Script mode ! ! 7. run in the current directory using the session saved ! in the ~/.bioruby directory ! ! % bioruby ~/.bioruby/shell/script.rb ! ! 8. run in the current directory using the session saved ! in the foo/bar directory ! ! % bioruby foo/bar/shell/script.rb ! ! 9. run in the current directory using the session saved ! in the /tmp/foo/bar directory ! ! % bioruby /tmp/foo/bar/shell/script.rb ! ! 2007-06-21 Toshiaki Katayama ! ! * lib/bio/shell/setup.rb ! ! If no directory is specified to the bioruby command, ! use ~/.bioruby directory as the default save directory ! instead of the current directory, as suggested by Jun Sese. ! ! User can use 'bioruby' command without botherd by directories ! and files previously created by the 'bioruby' command ! in the current directory even when not needed. ! ! 2007-05-19 Toshiaki Katayama ! ! * lib/bio/appl/fasta.rb ! ! Bug fixed that exec_local fails to exec when @ktup is nil. ! This problem is reported and fixed by Fredrik Johansson. ! ! * lib/bio/db/gff.rb ! ! parser_attributes method in GFF3 class is modified to use ! '=' char as a separator instead of ' ' (which is used in ! GFF2 spec). ! ! 2007-04-06 Toshiaki Katayama ! ! * COPYING, COPYING.LIB are removed ! ! BioRuby is now distributed under the same terms as Ruby. ! ! On behalf of the BioRuby developer, I have asked all authors of ! the BioRuby code to change BioRuby's license from LGPL to Ruby's. ! And we have finished to change license of all modules in the BioRuby ! library. This means that Ruby user can freely use BioRuby library ! without being annoyed by licensing issues. ! ! * lib/bio/db/kegg/ko.rb is renamed to lib/bio/db/kegg/ortholog.rb ! ! KEGG KO database is renamed to KEGG ORTHOLOG database, thus we ! follow the change. Bio::KEGG::KO is renamed to Bio::KEGG::ORTHOLOG. ! ! Bio::KEGG::ORTHOLOG#genes, dblinks methods are rewrited to use ! lines_fetch method. ! ! * lib/bio/data/aa.rb ! ! to_re method is changed that the generated regexp to include ! ambiguous amino acid itself - replacement of amino acid X should ! include X itself. ! ! 2007-04-05 Trevor Wennblom ! ! * License headers are completely rewrited to Ruby's. 2007-04-02 Naohisa Goto *************** *** 57,64 **** * lib/bio/appl/mafft.rb ! Incompatible change: Bio::MAFFT#output is changed to return ! a string of multi-fasta formmatted text. To get an array of ! Bio::FastaFormat objects (as of 1.0 or before), please use ! report.data instead. 2007-03-27 Naohisa Goto --- 216,302 ---- * lib/bio/appl/mafft.rb ! Incompatible change: Bio::MAFFT#output is changed to return ! a string of multi-fasta formmatted text. To get an array of ! Bio::FastaFormat objects (as of 1.0 or before), please use ! report.data instead. ! ! 2007-03-29 Toshiaki Katayama ! ! * lib/bio/db/kegg/cell.rb ! ! Obsoleted as the KEGG CELL database is not publically available ! any more. ! ! 2007-03-28 Toshiaki Katayama ! ! * lib/bio/shell/rails/.../bioruby_controller.rb ! ! BioRuby shell on Rails access is changed to be limited only from ! the localhost for security reason (if local_request?). ! ! * lib/bio/command.rb ! ! The post_form method is modified to accept URL as a string and ! extended to accept params as ! array of string ! array of hash ! array of array ! or ! string ! in addition to hash (also can be ommited if not needed - defaults ! to nil). ! ! Keys and parameters of params are forced to use to_s for sure. ! ! * lib/bio/io/ensembl.rb ! ! Re-designed to allows user to use Bio::Ensembl.new without ! creating inherited sub class. ! ! Changed to use Bio::Command.post_form ! ! * lib/bio/das.rb ! ! Changed to use Bio::Command ! ! * lib/bio/shell/plugin/das.rb ! ! Newly added BioDAS client plugin for BioRuby shell. ! ! das.list_sequences ! das.dna ! das.features ! ! 2007-03-15 Toshiaki Katayama ! ! * lib/bio/shell/irb.rb ! ! Changed to load Rails environment when bioruby shell is invoked ! in the Rails project directory. This means that user can use ! 'bioruby' command as a better './script/console' which has ! persistent objects and shared history. ! ! 2007-03-08 Toshiaki Katayama ! ! * lib/bio/db/kegg/drug.rb ! ! Newly added KEGG DRUG database parser. ! ! * lib/bio/db/kegg/glycan.rb ! ! Bio::KEGG::GLYCAN#bindings method is removed. ! Bio::KEGG::GLYCAN#comment, remarks methods are added. ! Bio::KEGG::GLYCAN#orthologs and dblinks methods are changed to use ! lines_fetch method. ! ! * lib/bio/kegg/compound.rb ! ! Bio::KEGG::COMPOUND#glycans method is added ! Bio::KEGG::COMPOUND#names method is changed to return an array ! of stripped strings. ! ! * lib/bio/db/kegg/genes.rb ! ! Bio::KEGG::GENES#orthologs method is added. 2007-03-27 Naohisa Goto *************** *** 66,76 **** * lib/bio/command.rb ! Bio::Command.call_command_fork and query_command_fork methods ! are changed to handle all Ruby exceptions in the child process. * lib/bio/io/flatfile.rb ! UniProt format autodetection was changed to follow the change of ! UniProtKB release 9.0 of 31-Oct-2006. 2007-02-12 Naohisa Goto --- 304,314 ---- * lib/bio/command.rb ! Bio::Command.call_command_fork and query_command_fork methods ! are changed to handle all Ruby exceptions in the child process. * lib/bio/io/flatfile.rb ! UniProt format autodetection was changed to follow the change of ! UniProtKB release 9.0 of 31-Oct-2006. 2007-02-12 Naohisa Goto *************** *** 78,84 **** * lib/bio/io/flatfile.rb ! Exception class UnknownDataFormatError is added. ! It will be raised before reading data from IO when data format ! hasn't been specified due to failure of file format autodetection. 2007-02-02 Trevor Wennblom --- 316,328 ---- * lib/bio/io/flatfile.rb ! Exception class UnknownDataFormatError is added. ! It will be raised before reading data from IO when data format ! hasn't been specified due to failure of file format autodetection. ! ! 2007-02-12 Toshiaki Katayama ! ! * lib/bio/io/flatfile.rb ! ! Added support for KEGG EGENES. 2007-02-02 Trevor Wennblom *************** *** 100,106 **** --- 344,404 ---- Bio::SOFT for reading SOFT formatted NCBI GEO files. + 2007-01-16 Toshiaki Katayama + + * BioRuby shell on Rails new features and fixes + + New features: + * Input [#] is linked to action for filling textarea from history + * [methods] is separated into columns for readability + + Fixes and improvements: + * HIDE_VARIABLES is moved from helper to controller to avoid warning + "already initialized constant - HIDE_VARIABLES" repeated on reload. + *
is renamed to "log_#" with number for future + extention. + *
are inserted in the
+ + 2007-01-15 Toshiaki Katayama + + * lib/bio/db.rb + + lines_fetch method (internally used various bio/db/*.rb modules) + is rewrited to concatenate indented sub field. + + * lib/bio/db/kegg/compound.rb + + Bio::KEGG::COMPOUND#comment method which returns contents of + the COMMENT line is added + + * lib/bio/db/kegg/enzyme.rb + + Bio::KEGG::ENZYME#entry_id is changed to return EC number only. + Previous version of entry_id method is renamed to entry method + which returns a "EC x.x.x.x Enzyme" style string. + + Bio::KEGG::ENZYME#obsolete? method is added which returns boolean + value (true or false) according to the ENTRY line contains + a string 'Obsolete' or not. + + Bio::KEGG::ENZYME#all_reac, iubmb_reactions, kegg_reactions methods + are added to support newly added ALL_REAC field. + + Bio::KEGG::ENZYME#inhibitors and orthologs methods are added. + + Bio::KEGG::ENZYME#substrates, products, inhibitors, cofactors, + pathways, orthologs, diseases, motifs methods are rewrited to + utilizes new lines_fetch method in db.rb to process continuous + sub field. + + * lib/bio/db/kegg/genome.rb + + Bio::KEGG::GENOME#scaffolds, gc, genomemap methods are obsoleted. + Bio::KEGG::GENOME#distance, data_source, original_db methods are + added. + 2006-12-24 Toshiaki Katayama * bin/bioruby, lib/bio/shell/, lib/bio/shell/rails/ + (lib/bio/shell/rails/vendor/plugins/generators/) Web functionallity of the BioRuby shell is completely rewrited *************** *** 113,116 **** --- 411,433 ---- visual effects. + * lib/bio/.rb + + Extended to have Bio.command where command can be any BioRuby + shell methods. + ex. puts Bio.getseq("atgc" * 10).randomize.translate + + * lib/bio/shell/plugin/entry.rb, seq.rb + + seq, ent, obj commands are renamed to getseq, getent, getobj + respectively. This getseq is also changed to return Bio::Sequence + with @moltype = Bio::Sequence::NA object instead of Bio::Sequence::NA + object. + + * lib/bio/db/kegg/kgml.rb + + Some method names are changed to avoid confusion: + * entry_type is renamed to category () + * map is renamed to pathway () + 2006-12-19 Christian Zmasek *************** *** 177,180 **** --- 494,501 ---- NHX (New Hampshire eXtended) parser/writer support are added. + 2006-12-13 Toshiaki Katayama + + * doc/Desing.rd.ja, doc/TODO.rd.ja, doc/BioRuby.rd.ja are obsoletd. + 2006-10-05 Naohisa Goto *************** *** 189,192 **** --- 510,610 ---- is newly added. + 2006-09-19 Toshiaki Katayama + + * lib/bio/io/soapwsdl.rb + * lib/bio/io/ebisoap.rb + * lib/bio/io/ncbisoap.rb + + Newly added web service modules. + + * lib/bio/db/kegg/kgml.rb + + Accessor for the attribute is added. + + * lib/bio/shell/plugin/codon.rb + + Support for Pyrrolysine and Selenocysteine are added in the + BioRuby shell. + + * lib/bio/sshell/plugin/seq.rb + + sixtrans, skip, step methods are added in the BioRuby shell. + bioruby> seqtrans(seq) + + bioruby> seq.step(window_size) {|subseq| + # do something on subseq + } + + bioruby> seq.skip(window_sizep, step_size) {|subseq| + # do something on subseq + } + + 2006-07-26 Toshiaki Katayama + + * lib/bio/data/aa.rb + + Amino acids J (Xle: I/L), O (Pyl: pyrrolysine) and X (unknown) + are added (now we have consumed 26 alphabets!). + + * lib/bio/io/fastacmd.rb + + Fixed that new version of fastacmd (in BLAST package) changed + the option from '-D T' to '-D 1', contributed by the author + of this module Shuji Shigenobu. + + * lib/bio/shell/plugin/psort.rb + + Newly added BioRuby shell plugin for PSORT + + * lib/bio/shell/plugin/blast.rb + + Newly added BioRuby shell plugin for BLAST search against KEGG GENES + + * lib/bio/db/prosite.rb + + PROSITE#re instance method is added to translate PATTERN of + the entry to Regexp using PROSITE.pa2re class method. + + * lib/bio/db/kegg/genes.rb + + Bio::KEGG::GENES#keggclass method is renamed to pathway + Bio::KEGG::GENES#splinks method is removed + Bio::KEGG::GENES#motifs method is added + these reflect changes made in the original KEGG GENES database. + + Bio::KEGG::GENES#locations method is added to return Bio::Locations + Bio::KEGG::GENES#codon_usage is renamed cu_list (returns as Array) + Bio::KEGG::GENES#cu is renamed to codon_usage (returns as Hash) + Bio::KEGG::GENES#aalen, nalen methods are changed to return + the number written in the entry (use seq.length to obtain calculated + number as before). + + * lib/bio/db/kegg/kgml.rb + + Names of some accessors have been changed (including bug fixes) + and instance variable @dom is obsoleted. Here's a list of + incompatible attribute names with KGML tags by this change: + + :id -> :entry_id + :type -> :entry_type + names() + + :name -> :label + :type -> :shape + + :entry1 -> :node1 + :entry2 -> :node2 + :type -> :rel + + edge() + + :name -> :entry_id + :type -> :direction + + * lib/bio/io/das.rb + + Bug fixed that the value of segment.stop was overwritten by + segment.orientation. + 2006-07-14 Naohisa Goto *************** *** 235,238 **** --- 653,663 ---- Bug fix: Bio::FlatFile.open(klass, filename) didn't work. + 2006-05-30 Toshiaki Katayama + + * lib/bio/io/soapwsdl.rb + + Generic list_methods method which extracts web service methods + defined in the WSDL file is added. + 2006-05-02 Mitsuteru Nakao From ngoto at dev.open-bio.org Wed Jul 18 04:47:41 2007 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Wed, 18 Jul 2007 08:47:41 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/appl/clustalw report.rb,1.12,1.13 Message-ID: <200707180847.l6I8lfKg028076@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/appl/clustalw In directory dev.open-bio.org:/tmp/cvs-serv28056/lib/bio/appl/clustalw Modified Files: report.rb Log Message: changed messages and documents Index: report.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/clustalw/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:39 -0000 1.12 --- report.rb 18 Jul 2007 08:47:39 -0000 1.13 *************** *** 92,105 **** # 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. def to_fasta(*arg) ! alignment.to_fasta(*arg) end # Gets an array of the sequences. # Returns an array of Bio::FastaFormat objects. --- 92,111 ---- # Returns a Bio::Alignment object. def align ! warn "Bio::ClustalW#align will be 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. def to_fasta(*arg) ! warn "Bio::ClustalW::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 objects. From nakao at dev.open-bio.org Wed Jul 18 07:11:59 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Wed, 18 Jul 2007 11:11:59 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/appl/iprscan report.rb,1.8,1.9 Message-ID: <200707181111.l6IBBxFq028516@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/appl/iprscan In directory dev.open-bio.org:/tmp/cvs-serv28494/lib/bio/appl/iprscan Modified Files: report.rb Log Message: * Changed method names: 1. reports_in_* -> parse_* 2. parse_in_* -> parse_*_entry 3. to_* -> format_* * Added Report#output(:format_type) method to be the facade pattern of format_* methods. Index: report.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/iprscan/report.rb,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** report.rb 17 Jul 2007 14:16:50 -0000 1.8 --- report.rb 18 Jul 2007 11:11:57 -0000 1.9 *************** *** 24,28 **** # == USAGE # # Read a marged.txt and split each entry. ! # Bio::Iprscan::Report.reports_in_txt(File.read("marged.txt")) do |report| # report.query_id # report.matches.size --- 24,28 ---- # == USAGE # # Read a marged.txt and split each entry. ! # Bio::Iprscan::Report.parse_txt(File.read("marged.txt")) do |report| # report.query_id # report.matches.size *************** *** 41,45 **** # end # ! # Bio::Iprscan::Report.reports_in_raw(File.read("marged.raw")) do |report| # report.class #=> Bio::Iprscan::Report # end --- 41,45 ---- # end # ! # Bio::Iprscan::Report.parse_raw(File.read("marged.raw")) do |report| # report.class #=> Bio::Iprscan::Report # end *************** *** 66,74 **** # == USAGE ! # Bio::Iprscan::Report.reports_in_raw(File.open("merged.raw")) do |report| # report # end # ! def self.reports_in_raw(io) entry = '' while line = io.gets --- 66,74 ---- # == USAGE ! # Bio::Iprscan::Report.parse_raw(File.open("merged.raw")) do |report| # report # end # ! def self.parse_raw(io) entry = '' while line = io.gets *************** *** 76,80 **** entry << line elsif entry != '' ! yield Bio::Iprscan::Report.parse_in_raw(entry) entry = line else --- 76,80 ---- entry << line elsif entry != '' ! yield Bio::Iprscan::Report.parse_raw_entry(entry) entry = line else *************** *** 82,91 **** end end ! yield Bio::Iprscan::Report.parse_in_raw(entry) if entry != '' end # Parser method for a raw formated entry. Retruns a Bio::Iprscan::Report # object. ! def self.parse_in_raw(str) report = self.new str.split(/\n/).each do |line| --- 82,91 ---- end end ! yield Bio::Iprscan::Report.parse_raw_entry(entry) if entry != '' end # Parser method for a raw formated entry. Retruns a Bio::Iprscan::Report # object. ! def self.parse_raw_entry(str) report = self.new str.split(/\n/).each do |line| *************** *** 117,123 **** # Parser method for a xml formated entry. Retruns a Bio::Iprscan::Report # object. ! def self.parse_in_xml(str) ! NotImplementedError ! end # Splits the entry stream. --- 117,122 ---- # Parser method for a xml formated entry. Retruns a Bio::Iprscan::Report # object. ! # def self.parse_xml(str) ! # end # Splits the entry stream. *************** *** 125,133 **** # == Usage # ! # Bio::Iprscan::Report.reports_in_txt(File.open("merged.txt")) do |report| # report.class #=> Bio::Iprscan::Report # end # ! def self.reports_in_txt(io) io.each("\n\nSequence") do |entry| if entry =~ /Sequence$/ --- 124,132 ---- # == Usage # ! # Bio::Iprscan::Report.reports_txt(File.open("merged.txt")) do |report| # report.class #=> Bio::Iprscan::Report # end # ! def self.parse_txt(io) io.each("\n\nSequence") do |entry| if entry =~ /Sequence$/ *************** *** 137,141 **** entry = 'Sequence' + entry end ! yield self.parse_in_txt(entry) end end --- 136,140 ---- entry = 'Sequence' + entry end ! yield self.parse_txt_entry(entry) end end *************** *** 146,150 **** # object. # ! def self.parse_in_txt(str) unless str =~ /^Sequence / raise ArgumentError, "Invalid format: \n\n#{str}" --- 145,149 ---- # object. # ! def self.parse_txt_entry(str) unless str =~ /^Sequence / raise ArgumentError, "Invalid format: \n\n#{str}" *************** *** 190,199 **** # # == Usage ! # Bio::Iprscan::Report.reports_in_ptxt(File.open("merged.txt")) do |report| # report # end ! def self.reports_in_ptxt(io) io.each("\n\/\/\n") do |entry| ! yield self.parse_in_ptxt(entry) end end --- 189,198 ---- # # == Usage ! # Bio::Iprscan::Report.parse_ptxt(File.open("merged.txt")) do |report| # report # end ! def self.parse_ptxt(io) io.each("\n\/\/\n") do |entry| ! yield self.parse_ptxt_entry(entry) end end *************** *** 205,212 **** # # File.read("marged.txt").each(Bio::Iprscan::Report::RS) do |e| ! # report = Bio::Iprscan::Report.parse_in_ptxt(e) # end # ! def self.parse_in_ptxt(str) report = self.new ipr_line = '' --- 204,211 ---- # # File.read("marged.txt").each(Bio::Iprscan::Report::RS) do |e| ! # report = Bio::Iprscan::Report.parse_ptxt_entry(e) # end # ! def self.parse_ptxt_entry(str) report = self.new ipr_line = '' *************** *** 242,267 **** end ! def to_html ! NotImplementedError end ! def to_xml ! NotImplementedError ! end ! def to_ebixml ! NotImplementedError ! end ! def to_txt ! NotImplementedError ! end ! def to_raw @matches.map { |match| [self.query_id, self.crc64, self.query_length, ! match.method, match.accession, match.description, --- 241,273 ---- end ! ! # Output interpro matches in the format_type. ! def output(format_type) ! case format_type ! when 'raw', :raw ! format_raw ! else ! raise NameError, "Invalid format_type." ! end end + + # def format_html + # end ! # def format_xml ! # end ! # def format_ebixml ! # end ! # def format_txt ! # end ! def format_raw @matches.map { |match| [self.query_id, self.crc64, self.query_length, ! match.method_name, match.accession, match.description, *************** *** 278,302 **** end ! def to_gff3 ! NotImplementedError ! end ! # Returns a Hash (key as an interpro id and value as index key for ! # matches (Array). # ! # report.list_of_interpro.each do |ipr_id, indexes| ! # indexes.each do |index| ! # report.matches[index].ipr_id == ipr_id #=> true # end # end # ! def list_of_interpro ! @ipr_ids = {} unless @ipr_ids ! @matches.each_with_index do |match, i| ! @ipr_ids[match.ipr_id] = [] unless @ipr_ids[match.ipr_id] ! @ipr_ids[match.ipr_id] << i end - @ipr_ids end --- 284,310 ---- end ! # def format_gff3 ! # end ! # Returns a Hash (key as an Interpro ID and value as a Match). # ! # report.to_hash.each do |ipr_id, matches| ! # matches.each do |match| ! # report.matches.ipr_id == ipr_id #=> true # end # end # ! def to_hash ! unless @ipr_ids ! @ipr_ids = {} ! @matches.each_with_index do |match, i| ! @ipr_ids[match.ipr_id] ||= [] ! @ipr_ids[match.ipr_id] << match ! end ! return @ipr_ids ! else ! return @ipr_ids end end *************** *** 333,338 **** def length; @data[:length]; end # the analysis method launched. ! def method; @data[:method]; end # Object#metod overrided by Match#method ! # the Gene Ontology description for the InterPro entry, in "Aspect:term (ID)" format. def go_terms; @data[:go_terms]; end # Id of the input sequence. --- 341,346 ---- def length; @data[:length]; end # the analysis method launched. ! def method_name; @data[:method]; end ! # the Gene Ontology description for the InterPro entry, in "Aspect :term (ID)" format. def go_terms; @data[:go_terms]; end # Id of the input sequence. From nakao at dev.open-bio.org Wed Jul 18 07:11:59 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Wed, 18 Jul 2007 11:11:59 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio/appl/iprscan test_report.rb, 1.6, 1.7 Message-ID: <200707181111.l6IBBxCL028521@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio/appl/iprscan In directory dev.open-bio.org:/tmp/cvs-serv28494/test/unit/bio/appl/iprscan Modified Files: test_report.rb Log Message: * Changed method names: 1. reports_in_* -> parse_* 2. parse_in_* -> parse_*_entry 3. to_* -> format_* * Added Report#output(:format_type) method to be the facade pattern of format_* methods. Index: test_report.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/unit/bio/appl/iprscan/test_report.rb,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** test_report.rb 17 Jul 2007 14:16:50 -0000 1.6 --- test_report.rb 18 Jul 2007 11:11:57 -0000 1.7 *************** *** 44,48 **** // END ! @obj = Bio::Iprscan::Report.parse_in_ptxt(test_entry) end --- 44,48 ---- // END ! @obj = Bio::Iprscan::Report.parse_ptxt_entry(test_entry) end *************** *** 69,73 **** def test_match_method ! assert_equal('BlastProDom', @obj.matches.first.method) end --- 69,73 ---- def test_match_method ! assert_equal('BlastProDom', @obj.matches.first.method_name) end *************** *** 98,102 **** def setup test_txt = Bio::TestIprscanData.txt_format.read.split(/\n\nSequence/)[0] ! @obj = Bio::Iprscan::Report.parse_in_txt(test_txt) end --- 98,102 ---- def setup test_txt = Bio::TestIprscanData.txt_format.read.split(/\n\nSequence/)[0] ! @obj = Bio::Iprscan::Report.parse_txt_entry(test_txt) end *************** *** 126,130 **** def test_match_method ! assert_equal('FPrintScan', @obj.matches.first.method) end --- 126,130 ---- def test_match_method ! assert_equal('FPrintScan', @obj.matches.first.method_name) end *************** *** 170,188 **** def setup test_txt = Bio::TestIprscanData.txt_format.read.split(/\n\nSequence/)[0] ! @obj = Bio::Iprscan::Report.parse_in_txt(test_txt) end ! def test_list_of_interpro ! hsh = {"IPR008994"=>[12, 13, 14], ! "IPR000110"=>[0, 1, 2], ! "IPR003029"=>[3, 4, 5, 6, 7, 8, 9, 10, 11], ! "NULL"=>[15]} ! assert_equal(hsh, @obj.list_of_interpro) end ! def test_list_of_interpro_match? ! @obj.list_of_interpro.each do |ipr_id, indexes| ! indexes.each do |index| ! assert_equal(ipr_id, @obj.matches[index].ipr_id) end end --- 170,189 ---- def setup test_txt = Bio::TestIprscanData.txt_format.read.split(/\n\nSequence/)[0] ! @obj = Bio::Iprscan::Report.parse_txt_entry(test_txt) end ! def test_to_hash ! hsh = {"IPR008994" => [12, 13, 14].map {|x| @obj.matches[x] }, ! "IPR000110" => [0, 1, 2].map {|x| @obj.matches[x] }, ! "IPR003029" => [3, 4, 5, 6, 7, 8, 9, 10, 11].map {|x| @obj.matches[x] }, ! "NULL" => [15].map {|x| @obj.matches[x] }} ! assert_equal(hsh.keys.sort, @obj.to_hash.keys.sort) ! assert_equal(hsh, @obj.to_hash) end ! def test_to_hash_match? ! @obj.to_hash.each do |ipr_id, matches| ! matches.each do |match| ! assert_equal(ipr_id, match.ipr_id) end end *************** *** 196,201 **** end ! def test_reports_in_txt ! Bio::Iprscan::Report.reports_in_txt(@test_txt) do |report| assert_equal(Bio::Iprscan::Report, report.class) end --- 197,202 ---- end ! def test_parse_txt ! Bio::Iprscan::Report.parse_txt(@test_txt) do |report| assert_equal(Bio::Iprscan::Report, report.class) end *************** *** 216,220 **** entry << line elsif entry != '' and entry.split("\t").first != line.split("\t").first ! @obj << Bio::Iprscan::Report.parse_in_raw(entry) entry = '' else --- 217,221 ---- entry << line elsif entry != '' and entry.split("\t").first != line.split("\t").first ! @obj << Bio::Iprscan::Report.parse_raw_entry(entry) entry = '' else *************** *** 222,226 **** end end ! @obj << Bio::Iprscan::Report.parse_in_raw(entry) end --- 223,227 ---- end end ! @obj << Bio::Iprscan::Report.parse_raw_entry(entry) end *************** *** 229,233 **** "merged.raw")) result = [] ! Bio::Iprscan::Report.reports_in_raw(io) {|x| result << x } assert_equal(@obj.size, result.size) assert_equal(@obj.first.query_id, result.first.query_id) --- 230,234 ---- "merged.raw")) result = [] ! Bio::Iprscan::Report.parse_raw(io) {|x| result << x } assert_equal(@obj.size, result.size) assert_equal(@obj.first.query_id, result.first.query_id) *************** *** 266,270 **** def test_match_method ! assert_equal('HMMPfam', @obj.first.matches.first.method) end --- 267,271 ---- def test_match_method ! assert_equal('HMMPfam', @obj.first.matches.first.method_name) end *************** *** 316,325 **** class TestIprscanReport < Test::Unit::TestCase def setup ! test_txt = Bio::TestIprscanData.txt_format.read.split(/\n\nSequence/)[0] ! @obj = Bio::Iprscan::Report.parse_in_txt(test_txt) end def test_to_raw ! # puts @obj.to_raw end --- 317,335 ---- class TestIprscanReport < Test::Unit::TestCase def setup ! @test_txt = Bio::TestIprscanData.txt_format.read.split(/\n\nSequence/)[0] ! @obj = Bio::Iprscan::Report.parse_txt_entry(@test_txt) ! @test_raw = Bio::TestIprscanData.raw_format.read.split("RS16_ECOLI")[0] end def test_to_raw ! # assert_equal(@test_raw.split("\n").sort, ! # @obj.format_raw.split("\n").sort) ! end ! ! def test_output_raw ! # assert_equal(@test_raw.split("\n").sort, ! # @obj.output(:raw).split("\n").sort) ! # assert_equal(@test_raw.split("\n").sort, ! # @obj.output('raw').split("\n").sort) end From k at dev.open-bio.org Thu Jul 19 00:08:49 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 19 Jul 2007 04:08:49 +0000 Subject: [BioRuby-cvs] bioruby ChangeLog,1.67,1.68 Message-ID: <200707190408.l6J48n7v029776@dev.open-bio.org> Update of /home/repository/bioruby/bioruby In directory dev.open-bio.org:/tmp/cvs-serv29772 Modified Files: ChangeLog Log Message: * BioRuby 1.1.0 is released Index: ChangeLog =================================================================== RCS file: /home/repository/bioruby/bioruby/ChangeLog,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** ChangeLog 18 Jul 2007 08:20:48 -0000 1.67 --- ChangeLog 19 Jul 2007 04:08:47 -0000 1.68 *************** *** 1,2 **** --- 1,6 ---- + 2007-07-19 Toshiaki Katayama + + * BioRuby 1.1.0 released + 2007-07-17 Toshiaki Katayama From k at dev.open-bio.org Fri Jul 20 17:56:47 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Fri, 20 Jul 2007 21:56:47 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io keggapi.rb,1.14,1.15 Message-ID: <200707202156.l6KLulPC001352@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv1348 Modified Files: keggapi.rb Log Message: * Fixed that To define singleton method to Fixnum is not allowed. - can't define singleton method "filter" for Fixnum (TypeError) Index: keggapi.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/keggapi.rb,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** keggapi.rb 5 Apr 2007 23:35:41 -0000 1.14 --- keggapi.rb 20 Jul 2007 21:56:45 -0000 1.15 *************** *** 332,335 **** --- 332,336 ---- if results.is_a?(Array) results.each do |result| + next if result.is_a?(Fixnum) def result.filter(fields) fields.collect { |field| self.send(field) } From k at dev.open-bio.org Thu Jul 26 06:40:41 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 26 Jul 2007 10:40:41 +0000 Subject: [BioRuby-cvs] bioruby/bin bioruby,1.19,1.20 Message-ID: <200707261040.l6QAefro023557@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/bin In directory dev.open-bio.org:/tmp/cvs-serv23553 Modified Files: bioruby Log Message: * changed to use gem instead of require_gem Index: bioruby =================================================================== RCS file: /home/repository/bioruby/bioruby/bin/bioruby,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** bioruby 5 Apr 2007 23:35:39 -0000 1.19 --- bioruby 26 Jul 2007 10:40:39 -0000 1.20 *************** *** 3,7 **** # = BioRuby shell - command line interface for the BioRuby library # ! # Copyright:: Copyright (C) 2005, 2006 # Toshiaki Katayama # License:: The Ruby License --- 3,7 ---- # = BioRuby shell - command line interface for the BioRuby library # ! # Copyright:: Copyright (C) 2005, 2006, 2007 # Toshiaki Katayama # License:: The Ruby License *************** *** 12,20 **** begin require 'rubygems' ! require_gem 'bio', '>= 1.1.0' rescue LoadError end require 'bio/shell' # required to run commands (getseq, ls etc.) include Bio::Shell --- 12,26 ---- begin require 'rubygems' ! gem 'bio', '>= 1.1.0' rescue LoadError + require 'bio' end require 'bio/shell' + # utilize existing rails application + if File.exists?("./config/environment.rb") + load("./config/environment.rb") + end + # required to run commands (getseq, ls etc.) include Bio::Shell *************** *** 39,42 **** --- 45,53 ---- end + # utilize existing rails application + if File.exists?("./config/environment.rb") + load("./config/environment.rb") + end + # saving workspace, command history and configuration before exit Bio::Shell.save_session From k at dev.open-bio.org Thu Jul 26 06:46:48 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 26 Jul 2007 10:46:48 +0000 Subject: [BioRuby-cvs] bioruby/bin bioruby,1.20,1.21 Message-ID: <200707261046.l6QAkmV7023579@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/bin In directory dev.open-bio.org:/tmp/cvs-serv23575/bin Modified Files: bioruby Log Message: * removed unnecessary lines which are temporally added during several attempts to integrate Rails in shell (but now it is supported by shell/irb.rb and shell/web.rb) Index: bioruby =================================================================== RCS file: /home/repository/bioruby/bioruby/bin/bioruby,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** bioruby 26 Jul 2007 10:40:39 -0000 1.20 --- bioruby 26 Jul 2007 10:46:46 -0000 1.21 *************** *** 18,26 **** require 'bio/shell' - # utilize existing rails application - if File.exists?("./config/environment.rb") - load("./config/environment.rb") - end - # required to run commands (getseq, ls etc.) include Bio::Shell --- 18,21 ---- *************** *** 45,53 **** end - # utilize existing rails application - if File.exists?("./config/environment.rb") - load("./config/environment.rb") - end - # saving workspace, command history and configuration before exit Bio::Shell.save_session --- 40,43 ---- From pjotr at dev.open-bio.org Mon Jul 9 08:28:13 2007 From: pjotr at dev.open-bio.org (Pjotr Prins) Date: Mon, 09 Jul 2007 12:28:13 -0000 Subject: [BioRuby-cvs] bioruby/doc Tutorial.rd,1.12,1.13 Message-ID: <200707091228.l69CS9lG030424@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/doc In directory dev.open-bio.org:/tmp/cvs-serv30404/doc Modified Files: Tutorial.rd Log Message: Updated tutorial to include generating a random sequence and an example of using the rebase library. Index: Tutorial.rd =================================================================== RCS file: /home/repository/bioruby/bioruby/doc/Tutorial.rd,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Tutorial.rd 17 Feb 2006 14:59:26 -0000 1.12 --- Tutorial.rd 9 Jul 2007 12:28:07 -0000 1.13 *************** *** 9,16 **** Editor: PjotrPrins

! Copyright (C) 2001-2003 KATAYAMA Toshiaki , 2005-2006 all ! others ! ! NOTE: This page is a work in progress at this point IMPORTANT NOTICE: This page is maintained in the BioRuby CVS --- 9,13 ---- Editor: PjotrPrins

! Copyright (C) 2001-2003 KATAYAMA Toshiaki , 2005-2007 Pjotr Prins, Naohisa Goto and others IMPORTANT NOTICE: This page is maintained in the BioRuby CVS *************** *** 39,43 **** command. Showing something like: ! ruby 1.8.2 (2005-04-11) [powerpc-linux] --- 36,40 ---- command. Showing something like: ! ruby 1.8.5 (2006-08-25) [powerpc-linux] *************** *** 97,100 **** --- 94,100 ---- puts seq.complement.translate # translation of complemental strand + counts = {'a'=>seq.count('a'),'c'=>seq.count('c'),'g'=>seq.count('g'),'t'=>seq.count('t')} + p randomseq = Bio::Sequence::NA.randomize(counts) # reshuffle sequence with same freq. + The p, print and puts methods are standard Ruby ways of outputting to the screen. If you want to know more about standard Ruby commands you *************** *** 463,466 **** --- 463,500 ---- a2 = a.do_align(factory) + == Restriction Enzymes (Bio::RE) + + BioRuby has extensive support for restriction enzymes (REs). It contains a full + library of commonly used REs (from REBASE) which can be used to cut single + stranded RNA or dubbel stranded DNA into fragments. To list all enzymes: + + rebase = Bio::RestrictionEnzyme.rebase + rebase.each do |enzyme_name, info| + p enzyme_name + end + + and cut a sequence with an enzyme follow up with: + + res = seq.cut_with_enzyme('EcoRII', {:max_permutations => 0}, {:view_ranges => true}) + if res.kind_of? Symbol #error + err = Err.find_by_code(res.to_s) + unless err + err = Err.new(:code => res.to_s) + end + end + res.each do |frag| + em = EnzymeMatch.new + + em.p_left = frag.p_left + em.p_right = frag.p_right + em.c_left = frag.c_left + em.c_right = frag.c_right + + em.err = nil + em.enzyme = ar_enz + em.sequence = ar_seq + p em + end + == Sequence homology search by using the FASTA program (Bio::Fasta) *************** *** 1124,1135 **** * (()) == Using BioRuby with R ! The R libraries can be accessed from Ruby using the @@FIXME ! package. This allows at least use of the standard R library ! functions. Unfortunately there is no binding for dynamic R - so at ! this point you'll have to create some command line interface. ! == Using BioPerl from Ruby == Installing required external library --- 1158,1172 ---- * (()) + == Comparing BioProjects + + For a quick functional comparison of BioRuby, BioPerl, BioPython and Bioconductor (R) see (()) + == Using BioRuby with R ! Using Ruby with R Pjotr wrote a section on SciRuby. See (()) ! == Using BioPerl or BioPython from Ruby ! ! At the moment there is no easy way of accessing BioPerl from Ruby. The best way, perhaps, is to create a Perl server that gets accessed through XML/RPC or SOAP. == Installing required external library From k at dev.open-bio.org Mon Jul 9 08: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 08: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 10: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 11: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 11: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

    *************** *** 5,7 **** <% end %>
! --- 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 11: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 11: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 11: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 11: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 11: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 14: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 14: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 10: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 10: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 10: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 12: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 12: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 12: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 12: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 12: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 12: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 12: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 12: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 12: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 18: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 19: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 19: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 19: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 19: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 19: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 19: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.rb - - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # # FIXME docs are kind of out of date. Change this to VerticalAndHorizontalCutRange class VerticalCutRange < CutRange --- 9,18 ---- # ! require 'bio/util/restriction_enzyme' ! module Bio ! class RestrictionEnzyme class Range # FIXME docs are kind of out of date. Change this to VerticalAndHorizontalCutRange class VerticalCutRange < CutRange *************** *** 81,83 **** end # VerticalCutRange end # Range ! end # Bio::RestrictionEnzyme --- 74,77 ---- end # VerticalCutRange end # Range ! end # RestrictionEnzyme ! end # Bio Index: horizontal_cut_range.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/range/horizontal_cut_range.rb,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** horizontal_cut_range.rb 5 Apr 2007 23:35:42 -0000 1.4 --- horizontal_cut_range.rb 16 Jul 2007 19:28:48 -0000 1.5 *************** *** 1,4 **** # ! # bio/util/restrction_enzyme/range/horizontal_cut_range.rb - # # Author:: Trevor Wennblom --- 1,4 ---- # ! # bio/util/restriction_enzyme/range/horizontal_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/horizontal_cut_range.rb - - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # class HorizontalCutRange < CutRange attr_reader :p_cut_left, :p_cut_right --- 9,18 ---- # ! require 'bio/util/restriction_enzyme' ! module Bio ! class RestrictionEnzyme class Range class HorizontalCutRange < CutRange attr_reader :p_cut_left, :p_cut_right *************** *** 71,73 **** end # HorizontalCutRange end # Range ! end # Bio::RestrictionEnzyme --- 64,67 ---- end # HorizontalCutRange end # Range ! end # RestrictionEnzyme ! end # Bio Index: sequence_range.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/range/sequence_range.rb,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** sequence_range.rb 13 May 2007 04:08:02 -0000 1.8 --- sequence_range.rb 16 Jul 2007 19:28:48 -0000 1.9 *************** *** 1,4 **** # ! # bio/util/restrction_enzyme/range/sequence_range.rb - A defined range over a nucleotide sequence # # Author:: Trevor Wennblom --- 1,4 ---- # ! # bio/util/restriction_enzyme/range/sequence_range.rb - A defined range over a nucleotide sequence # # Author:: Trevor Wennblom *************** *** 9,30 **** # ! require 'bio/util/restriction_enzyme/range/cut_ranges' ! require 'bio/util/restriction_enzyme/range/horizontal_cut_range' ! require 'bio/util/restriction_enzyme/range/vertical_cut_range' ! require 'bio/util/restriction_enzyme/range/sequence_range/calculated_cuts' ! require 'bio/util/restriction_enzyme/range/sequence_range/fragments' ! require 'bio/util/restriction_enzyme/range/sequence_range/fragment' ! require 'bio' ! module Bio; end ! class Bio::RestrictionEnzyme class Range ! # ! # bio/util/restrction_enzyme/range/sequence_range.rb - A defined range over a nucleotide sequence ! # ! # Author:: Trevor Wennblom ! # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) ! # License:: The Ruby License ! # # A defined range over a nucleotide sequence. # --- 9,23 ---- # ! require 'bio/util/restriction_enzyme' ! module Bio ! class RestrictionEnzyme class Range ! ! autoload :CutRange, 'bio/util/restriction_enzyme/range/cut_range' ! autoload :CutRanges, 'bio/util/restriction_enzyme/range/cut_ranges' ! autoload :HorizontalCutRange, 'bio/util/restriction_enzyme/range/horizontal_cut_range' ! autoload :VerticalCutRange, 'bio/util/restriction_enzyme/range/vertical_cut_range' ! # A defined range over a nucleotide sequence. # *************** *** 33,36 **** --- 26,33 ---- class SequenceRange + autoload :Fragment, 'bio/util/restriction_enzyme/range/sequence_range/fragment' + autoload :Fragments, 'bio/util/restriction_enzyme/range/sequence_range/fragments' + autoload :CalculatedCuts, 'bio/util/restriction_enzyme/range/sequence_range/calculated_cuts' + # Left-most index of primary strand attr_reader :p_left *************** *** 257,259 **** end # SequenceRange end # Range ! end # Bio::RestrictionEnzyme \ No newline at end of file --- 254,257 ---- end # SequenceRange end # Range ! end # RestrictionEnzyme ! end # Bio Index: cut_ranges.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/range/cut_ranges.rb,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** cut_ranges.rb 5 Apr 2007 23:35:42 -0000 1.4 --- cut_ranges.rb 16 Jul 2007 19:28:48 -0000 1.5 *************** *** 1,4 **** # ! # bio/util/restrction_enzyme/range/cut_ranges.rb - Container for many CutRange objects or CutRange child objects. # # Author:: Trevor Wennblom --- 1,4 ---- # ! # bio/util/restriction_enzyme/range/cut_ranges.rb - Container for many CutRange objects or CutRange child objects. # # Author:: Trevor Wennblom *************** *** 9,23 **** # ! module Bio; end ! class Bio::RestrictionEnzyme class Range - # - # bio/util/restrction_enzyme/range/cut_ranges.rb - Container for many CutRange objects or CutRange child objects. - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # # Container for many CutRange objects or CutRange child objects. Inherits from array. # --- 9,18 ---- # ! require 'bio/util/restriction_enzyme' ! ! module Bio ! class RestrictionEnzyme class Range # Container for many CutRange objects or CutRange child objects. Inherits from array. # *************** *** 49,51 **** end # CutRanges end # Range ! end # Bio::RestrictionEnzyme --- 44,47 ---- end # CutRanges end # Range ! end # RestrictionEnzyme ! end # Bio Index: cut_range.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/range/cut_range.rb,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** cut_range.rb 5 Apr 2007 23:35:42 -0000 1.3 --- cut_range.rb 16 Jul 2007 19:28:48 -0000 1.4 *************** *** 1,4 **** # ! # bio/util/restrction_enzyme/range/cut_range.rb - Abstract base class for HorizontalCutRange and VerticalCutRange # # Author:: Trevor Wennblom --- 1,4 ---- # ! # bio/util/restriction_enzyme/range/cut_range.rb - Abstract base class for HorizontalCutRange and VerticalCutRange # # Author:: Trevor Wennblom *************** *** 9,29 **** # ! require 'bio' ! module Bio; end ! class Bio::RestrictionEnzyme class Range - # - # bio/util/restrction_enzyme/range/cut_range.rb - Abstract base class for HorizontalCutRange and VerticalCutRange - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # # Abstract base class for HorizontalCutRange and VerticalCutRange # class CutRange end # CutRange end # Range ! end # Bio::RestrictionEnzyme \ No newline at end of file --- 9,24 ---- # ! require 'bio/util/restriction_enzyme' ! module Bio ! class RestrictionEnzyme class Range # Abstract base class for HorizontalCutRange and VerticalCutRange # class CutRange end # CutRange + end # Range ! end # RestrictionEnzyme ! end # Bio From k at dev.open-bio.org Mon Jul 16 19: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 analysis.rb, 1.19, 1.20 analysis_basic.rb, 1.15, 1.16 cut_symbol.rb, 1.5, 1.6 double_stranded.rb, 1.10, 1.11 single_strand.rb, 1.6, 1.7 single_strand_complement.rb, 1.4, 1.5 string_formatting.rb, 1.5, 1.6 Message-ID: <200707161928.l6GJSoKo021263@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme In directory dev.open-bio.org:/tmp/cvs-serv21244/restriction_enzyme Modified Files: analysis.rb analysis_basic.rb cut_symbol.rb double_stranded.rb single_strand.rb single_strand_complement.rb string_formatting.rb Log Message: * autoloadified Index: analysis_basic.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/analysis_basic.rb,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** analysis_basic.rb 13 May 2007 04:08:02 -0000 1.15 --- analysis_basic.rb 16 Jul 2007 19:28:48 -0000 1.16 *************** *** 1,4 **** # ! # bio/util/restrction_enzyme/analysis_basic.rb - Does the work of fragmenting the DNA from the enzymes # # Author:: Trevor Wennblom --- 1,4 ---- # ! # bio/util/restriction_enzyme/analysis_basic.rb - Does the work of fragmenting the DNA from the enzymes # # Author:: Trevor Wennblom *************** *** 11,25 **** require 'set' # for method create_enzyme_actions require 'bio/util/restriction_enzyme' - require 'bio/util/restriction_enzyme/range/sequence_range' ! class Bio::RestrictionEnzyme - # - # bio/util/restrction_enzyme/analysis_basic.rb - Does the work of fragmenting the DNA from the enzymes - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # class Analysis --- 11,18 ---- require 'set' # for method create_enzyme_actions require 'bio/util/restriction_enzyme' ! module Bio ! class RestrictionEnzyme class Analysis *************** *** 221,223 **** end # Analysis ! end # Bio::RestrictionEnzyme --- 214,217 ---- end # Analysis ! end # RestrictionEnzyme ! end # Bio Index: string_formatting.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/string_formatting.rb,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** string_formatting.rb 5 Apr 2007 23:35:42 -0000 1.5 --- string_formatting.rb 16 Jul 2007 19:28:48 -0000 1.6 *************** *** 9,24 **** # ! require 'bio/util/restriction_enzyme/cut_symbol' ! module Bio; end ! class Bio::RestrictionEnzyme - # - # bio/util/restriction_enzyme/string_formatting.rb - Useful functions for string manipulation - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # module StringFormatting include CutSymbol --- 9,17 ---- # ! require 'bio/util/restriction_enzyme' ! module Bio ! class RestrictionEnzyme module StringFormatting include CutSymbol *************** *** 115,117 **** end end # StringFormatting ! end # Bio::RestrictionEnzyme --- 108,111 ---- end end # StringFormatting ! end # RestrictionEnzyme ! end # Bio Index: cut_symbol.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/cut_symbol.rb,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** cut_symbol.rb 5 Apr 2007 23:35:42 -0000 1.5 --- cut_symbol.rb 16 Jul 2007 19:28:48 -0000 1.6 *************** *** 1,4 **** # ! # bio/util/restrction_enzyme/cut_symbol.rb - Defines the symbol used to mark a cut in an enzyme sequence # # Author:: Trevor Wennblom --- 1,4 ---- # ! # bio/util/restriction_enzyme/cut_symbol.rb - Defines the symbol used to mark a cut in an enzyme sequence # # Author:: Trevor Wennblom *************** *** 9,24 **** # ! nil # to separate file-level rdoc from following statement # !> useless use of nil in void context ! ! module Bio; end ! class Bio::RestrictionEnzyme - # - # bio/util/restrction_enzyme/cut_symbol.rb - Defines the symbol used to mark a cut in an enzyme sequence - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # # = Usage # --- 9,15 ---- # ! module Bio ! class RestrictionEnzyme # = Usage # *************** *** 113,115 **** end # CutSymbol ! end # Bio::RestrictionEnzyme --- 104,107 ---- end # CutSymbol ! end # RestrictionEnzyme ! end # Bio Index: single_strand_complement.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/single_strand_complement.rb,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** single_strand_complement.rb 5 Apr 2007 23:35:42 -0000 1.4 --- single_strand_complement.rb 16 Jul 2007 19:28:48 -0000 1.5 *************** *** 9,24 **** # ! require 'bio/util/restriction_enzyme/single_strand' ! module Bio; end ! class Bio::RestrictionEnzyme - # - # bio/util/restriction_enzyme/single_strand_complement.rb - Single strand restriction enzyme sequence in complement orientation - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # # A single strand of restriction enzyme sequence pattern with a 3' to 5' orientation. # --- 9,17 ---- # ! require 'bio/util/restriction_enzyme' ! module Bio ! class RestrictionEnzyme # A single strand of restriction enzyme sequence pattern with a 3' to 5' orientation. # *************** *** 27,29 **** def orientation; [3, 5]; end end # SingleStrandComplement ! end # Bio::RestrictionEnzyme --- 20,23 ---- def orientation; [3, 5]; end end # SingleStrandComplement ! end # RestrictionEnzyme ! end # Bio Index: double_stranded.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/double_stranded.rb,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** double_stranded.rb 5 Apr 2007 23:35:42 -0000 1.10 --- double_stranded.rb 16 Jul 2007 19:28:48 -0000 1.11 *************** *** 1,4 **** # ! # bio/util/restrction_enzyme/double_stranded.rb - DoubleStranded restriction enzyme sequence # # Author:: Trevor Wennblom --- 1,4 ---- # ! # bio/util/restriction_enzyme/double_stranded.rb - DoubleStranded restriction enzyme sequence # # Author:: Trevor Wennblom *************** *** 9,33 **** # - require 'bio/db/rebase' require 'bio/util/restriction_enzyme' - require 'bio/util/restriction_enzyme/range/sequence_range' - - require 'bio/util/restriction_enzyme/cut_symbol' - require 'bio/util/restriction_enzyme/single_strand' - require 'bio/util/restriction_enzyme/single_strand_complement' - require 'bio/util/restriction_enzyme/double_stranded/aligned_strands' - require 'bio/util/restriction_enzyme/double_stranded/cut_locations' - require 'bio/util/restriction_enzyme/double_stranded/cut_locations_in_enzyme_notation' ! module Bio; end ! class Bio::RestrictionEnzyme - # - # bio/util/restrction_enzyme/double_stranded.rb - DoubleStranded restriction enzyme sequence - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # # A pair of SingleStrand and SingleStrandComplement objects with methods to # add utility to their relation. --- 9,17 ---- # require 'bio/util/restriction_enzyme' ! module Bio ! class RestrictionEnzyme # A pair of SingleStrand and SingleStrandComplement objects with methods to # add utility to their relation. *************** *** 41,44 **** --- 25,35 ---- # FIXME needs better docs class DoubleStranded + + autoload :AlignedStrands, 'bio/util/restriction_enzyme/double_stranded/aligned_strands' + autoload :CutLocations, 'bio/util/restriction_enzyme/double_stranded/cut_locations' + autoload :CutLocationPair, 'bio/util/restriction_enzyme/double_stranded/cut_location_pair' + autoload :CutLocationsInEnzymeNotation, 'bio/util/restriction_enzyme/double_stranded/cut_locations_in_enzyme_notation' + autoload :CutLocationPairInEnzymeNotation, 'bio/util/restriction_enzyme/double_stranded/cut_location_pair_in_enzyme_notation' + include CutSymbol extend CutSymbol *************** *** 327,329 **** end # DoubleStranded ! end # Bio::RestrictionEnzyme --- 318,321 ---- end # DoubleStranded ! end # RestrictionEnzyme ! end # Bio Index: single_strand.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/single_strand.rb,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** single_strand.rb 5 Apr 2007 23:35:42 -0000 1.6 --- single_strand.rb 16 Jul 2007 19:28:48 -0000 1.7 *************** *** 9,27 **** # ! require 'bio/util/restriction_enzyme/single_strand/cut_locations_in_enzyme_notation' ! require 'bio/util/restriction_enzyme/cut_symbol' ! require 'bio/util/restriction_enzyme/string_formatting' require 'bio/sequence' ! module Bio; end ! class Bio::RestrictionEnzyme - # - # bio/util/restriction_enzyme/single_strand.rb - Single strand of a restriction enzyme sequence - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # # A single strand of restriction enzyme sequence pattern with a 5' to 3' # orientation. --- 9,18 ---- # ! require 'bio/util/restriction_enzyme' require 'bio/sequence' ! module Bio ! class RestrictionEnzyme # A single strand of restriction enzyme sequence pattern with a 5' to 3' # orientation. *************** *** 31,34 **** --- 22,28 ---- # class SingleStrand < Bio::Sequence::NA + + autoload :CutLocationsInEnzymeNotation, 'bio/util/restriction_enzyme/single_strand/cut_locations_in_enzyme_notation' + include CutSymbol include StringFormatting *************** *** 202,204 **** end # SingleStrand ! end # Bio::RestrictionEnzyme \ No newline at end of file --- 196,199 ---- end # SingleStrand ! end # RestrictionEnzyme ! end # Bio Index: analysis.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/analysis.rb,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** analysis.rb 13 May 2007 04:08:02 -0000 1.19 --- analysis.rb 16 Jul 2007 19:28:48 -0000 1.20 *************** *** 1,4 **** # ! # bio/util/restrction_enzyme/analysis.rb - Does the work of fragmenting the DNA from the enzymes # # Author:: Trevor Wennblom --- 1,4 ---- # ! # bio/util/restriction_enzyme/analysis.rb - Does the work of fragmenting the DNA from the enzymes # # Author:: Trevor Wennblom *************** *** 9,23 **** # require 'bio/util/restriction_enzyme/analysis_basic' ! class Bio::RestrictionEnzyme - # - # bio/util/restrction_enzyme/analysis.rb - Does the work of fragmenting the DNA from the enzymes - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # class Analysis --- 9,18 ---- # + require 'bio/util/restriction_enzyme' require 'bio/util/restriction_enzyme/analysis_basic' ! module Bio ! class RestrictionEnzyme class Analysis *************** *** 251,253 **** end # Analysis ! end # Bio::RestrictionEnzyme --- 246,249 ---- end # Analysis ! end # RestrictionEnzyme ! end # Bio From k at dev.open-bio.org Mon Jul 16 19: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/sequence_range calculated_cuts.rb, 1.6, 1.7 fragment.rb, 1.5, 1.6 fragments.rb, 1.4, 1.5 Message-ID: <200707161928.l6GJSoUk021286@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/range/sequence_range In directory dev.open-bio.org:/tmp/cvs-serv21244/restriction_enzyme/range/sequence_range Modified Files: calculated_cuts.rb fragment.rb fragments.rb Log Message: * autoloadified Index: calculated_cuts.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/range/sequence_range/calculated_cuts.rb,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** calculated_cuts.rb 5 Apr 2007 23:35:42 -0000 1.6 --- calculated_cuts.rb 16 Jul 2007 19:28:48 -0000 1.7 *************** *** 1,4 **** # ! # bio/util/restrction_enzyme/range/sequence_range/calculated_cuts.rb - # # Author:: Trevor Wennblom --- 1,4 ---- # ! # bio/util/restriction_enzyme/range/sequence_range/calculated_cuts.rb - # # Author:: Trevor Wennblom *************** *** 9,28 **** # ! require 'bio/util/restriction_enzyme' # test/runner.rb wont load without this ! require 'bio/util/restriction_enzyme/cut_symbol' ! require 'bio/util/restriction_enzyme/string_formatting' ! module Bio; end ! class Bio::RestrictionEnzyme class Range class SequenceRange - # - # bio/util/restrction_enzyme/range/sequence_range/calculated_cuts.rb - - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # # cc = CalculatedCuts.new(@size) # cc.add_cuts_from_cut_ranges(@cut_ranges) --- 9,19 ---- # ! require 'bio/util/restriction_enzyme' ! module Bio ! class RestrictionEnzyme class Range class SequenceRange # cc = CalculatedCuts.new(@size) # cc.add_cuts_from_cut_ranges(@cut_ranges) *************** *** 248,250 **** end # SequenceRange end # Range ! end # Bio::RestrictionEnzyme --- 239,242 ---- end # SequenceRange end # Range ! end # RestrictionEnzyme ! end # Bio Index: fragment.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/range/sequence_range/fragment.rb,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** fragment.rb 13 May 2007 04:08:02 -0000 1.5 --- fragment.rb 16 Jul 2007 19:28:48 -0000 1.6 *************** *** 1,4 **** # ! # bio/util/restrction_enzyme/range/sequence_range/fragment.rb - # # Author:: Trevor Wennblom --- 1,4 ---- # ! # bio/util/restriction_enzyme/range/sequence_range/fragment.rb - # # Author:: Trevor Wennblom *************** *** 9,28 **** # ! require 'bio/util/restriction_enzyme/range/cut_ranges' ! require 'bio/util/restriction_enzyme/range/horizontal_cut_range' ! require 'bio' ! module Bio; end ! class Bio::RestrictionEnzyme class Range class SequenceRange - # - # bio/util/restrction_enzyme/range/sequence_range/fragment.rb - - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # class Fragment --- 9,19 ---- # ! require 'bio/util/restriction_enzyme' ! module Bio ! class RestrictionEnzyme class Range class SequenceRange class Fragment *************** *** 57,59 **** end # SequenceRange end # Range ! end # Bio::RestrictionEnzyme --- 48,51 ---- end # SequenceRange end # Range ! end # RestrictionEnzyme ! end # Bio Index: fragments.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/range/sequence_range/fragments.rb,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** fragments.rb 5 Apr 2007 23:35:42 -0000 1.4 --- fragments.rb 16 Jul 2007 19:28:48 -0000 1.5 *************** *** 1,4 **** # ! # bio/util/restrction_enzyme/analysis/fragments.rb - # # Author:: Trevor Wennblom --- 1,4 ---- # ! # bio/util/restriction_enzyme/analysis/fragments.rb - # # Author:: Trevor Wennblom *************** *** 9,24 **** # ! module Bio; end ! class Bio::RestrictionEnzyme class Range class SequenceRange - # - # bio/util/restrction_enzyme/range/sequence_range/fragments.rb - - # - # Author:: Trevor Wennblom - # Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com) - # License:: The Ruby License - # class Fragments < Array --- 9,19 ---- # ! require 'bio/util/restriction_enzyme' ! ! module Bio ! class RestrictionEnzyme class Range class SequenceRange class Fragments < Array *************** *** 43,45 **** end # SequenceRange end # Range ! end # Bio::RestrictionEnzyme --- 38,41 ---- end # SequenceRange end # Range ! end # RestrictionEnzyme ! end # Bio From k at dev.open-bio.org Mon Jul 16 19:29:34 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Mon, 16 Jul 2007 19:29:34 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio/util/restriction_enzyme test_analysis.rb, 1.12, 1.13 test_double_stranded.rb, 1.5, 1.6 Message-ID: <200707161929.l6GJTY9d021321@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio/util/restriction_enzyme In directory dev.open-bio.org:/tmp/cvs-serv21317 Modified Files: test_analysis.rb test_double_stranded.rb Log Message: * added require 'bio/sequence' to work Index: test_double_stranded.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/unit/bio/util/restriction_enzyme/test_double_stranded.rb,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test_double_stranded.rb 5 Apr 2007 23:35:44 -0000 1.5 --- test_double_stranded.rb 16 Jul 2007 19:29:32 -0000 1.6 *************** *** 15,18 **** --- 15,19 ---- require 'test/unit' require 'bio/util/restriction_enzyme/double_stranded' + require 'bio/sequence' module Bio #:nodoc: Index: test_analysis.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/unit/bio/util/restriction_enzyme/test_analysis.rb,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** test_analysis.rb 13 May 2007 04:08:02 -0000 1.12 --- test_analysis.rb 16 Jul 2007 19:29:32 -0000 1.13 *************** *** 15,18 **** --- 15,19 ---- require 'test/unit' require 'bio/util/restriction_enzyme/analysis' + require 'bio/sequence' module Bio #:nodoc: From nakao at dev.open-bio.org Tue Jul 17 14:16:52 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Tue, 17 Jul 2007 14:16:52 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/appl/iprscan report.rb,1.7,1.8 Message-ID: <200707171416.l6HEGqZj025188@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/appl/iprscan In directory dev.open-bio.org:/tmp/cvs-serv25166/lib/bio/appl/iprscan Modified Files: report.rb Log Message: * Fixed a bug in Bio::Iprscan::Report.reports_in_raw (thanks ngoto-san). Index: report.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/iprscan/report.rb,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** report.rb 16 Jul 2007 19:21:32 -0000 1.7 --- report.rb 17 Jul 2007 14:16:50 -0000 1.8 *************** *** 82,85 **** --- 82,86 ---- end end + yield Bio::Iprscan::Report.parse_in_raw(entry) if entry != '' end *************** *** 260,276 **** @matches.map { |match| [self.query_id, ! self.crc64, ! self.query_length, ! match.method, ! match.accession, ! match.description, ! match.match_start, ! match.match_end, ! match.evalue, ! match.status, ! match.date, ! match.ipr_id, ! match.ipr_description, ! match.go_terms.map {|x| x[0] + ': ' + x[1] + ' (' + x[2] + ')' }.join(', ') ].join("\t") }.join("\n") --- 261,277 ---- @matches.map { |match| [self.query_id, ! self.crc64, ! self.query_length, ! match.method, ! match.accession, ! match.description, ! match.match_start, ! match.match_end, ! match.evalue, ! match.status, ! match.date, ! match.ipr_id, ! match.ipr_description, ! match.go_terms.map {|x| x[0] + ': ' + x[1] + ' (' + x[2] + ')' }.join(', ') ].join("\t") }.join("\n") From nakao at dev.open-bio.org Tue Jul 17 14:16:53 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Tue, 17 Jul 2007 14:16:53 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio/appl/iprscan test_report.rb, 1.5, 1.6 Message-ID: <200707171416.l6HEGrd9025191@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio/appl/iprscan In directory dev.open-bio.org:/tmp/cvs-serv25166/test/unit/bio/appl/iprscan Modified Files: test_report.rb Log Message: * Fixed a bug in Bio::Iprscan::Report.reports_in_raw (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.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test_report.rb 16 Jul 2007 19:21:33 -0000 1.5 --- test_report.rb 17 Jul 2007 14:16:50 -0000 1.6 *************** *** 224,227 **** --- 224,239 ---- @obj << Bio::Iprscan::Report.parse_in_raw(entry) end + + def test_self_reports_in_raw + io = File.open(File.join(Bio::TestIprscanData::TestDataIprscan, + "merged.raw")) + result = [] + Bio::Iprscan::Report.reports_in_raw(io) {|x| result << x } + assert_equal(@obj.size, result.size) + assert_equal(@obj.first.query_id, result.first.query_id) + assert_equal(@obj.first.query_id, result.first.query_id) + assert_equal(@obj[2].query_id, result[2].query_id) + assert_equal(@obj.last.query_id, result.last.query_id) + end def test_obj From k at dev.open-bio.org Wed Jul 18 08:20:51 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 18 Jul 2007 08:20:51 +0000 Subject: [BioRuby-cvs] bioruby ChangeLog,1.66,1.67 Message-ID: <200707180820.l6I8KpIG027894@dev.open-bio.org> Update of /home/repository/bioruby/bioruby In directory dev.open-bio.org:/tmp/cvs-serv27890 Modified Files: ChangeLog Log Message: * Added changes made by Katayama over the past year Index: ChangeLog =================================================================== RCS file: /home/repository/bioruby/bioruby/ChangeLog,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** ChangeLog 16 Jul 2007 12:44:04 -0000 1.66 --- ChangeLog 18 Jul 2007 08:20:48 -0000 1.67 *************** *** 1,16 **** 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 --- 1,23 ---- + 2007-07-17 Toshiaki Katayama + + * lib/bio/io/das.rb + + Fixed that mapmaster method to return correct value (mapmaseter's + URL). This bug is reported and fixed by Dave Thorne. + 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 *************** *** 18,31 **** * 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 --- 25,65 ---- * 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 Toshiaki Katayama ! ! * BioRuby shell on Rails has new CSS theme ! ! 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! ! ! 2007-07-09 Toshiaki Katayama ! ! * lib/bio/db/kegg/taxonomy.rb ! ! Newly added KEGG taxonomy file parser which treats taxonomic tree ! structure of the KEGG organisms. The file is available at ! ftp://ftp.genome.jp/pub/kegg/genes/taxonomy ! and is a replacement of the previously used keggtab file (obsoleted). ! ! * lib/bio/db/kegg/keggtab.rb ! ! Bio::KEGG::Keggtab is obsoleted as the file is no longer provided. ! Use Bio::KEGG::Taxonomy (lib/bio/db/kegg/taxonomy.rb) instead. ! ! * lib/bio/shell/plugin/soap.rb ! ! Newly added web service plugins for BioRuby shell which supports ! NCBI SOAP, EBI SOAP and DDBJ XML in addition to the KEGG API. 2007-07-09 Naohisa Goto *************** *** 33,49 **** * 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 --- 67,83 ---- * 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 *************** *** 51,55 **** * lib/bio/io/flatfile.rb ! Bio::FlatFile.foreach is added (which is suggested by IO.foreach). 2007-04-02 Naohisa Goto --- 85,214 ---- * lib/bio/io/flatfile.rb ! Bio::FlatFile.foreach is added (which is suggested by IO.foreach). ! ! 2007-06-28 Toshiaki Katayama ! ! * lib/bio/shell/setup.rb, core.rb ! ! Changed not to use Dir.chdir by caching full path of the save ! directory at a start up time, so that user can freely change ! the work directory without affecting object/history saving ! functionality. ! ! Bio::Shell.cache[:savedir] stores the session saving directory ! (session means shell/session/{config,history,object} files), ! Bio::Shell.cache[:workdir] stores the working directory at a start ! up time (can be same directory with the :savedir) and both are ! converted and stored as full path allowing user to use Dir.chdir ! in the shell session). ! ! If --rails (-r) option is applied, 'bioruby' command will run in ! the Rails server mode, and the server will start in the :savedir. ! ! (A) IRB mode ! ! 1. run in the current directory and the session will be saved ! in the ~/.bioruby directory ! ! % bioruby ! ! 2. run in the current directory and the session will be saved ! in the foo/bar directory ! ! % bioruby foo/bar ! ! 3. run in the current directory and the session will be saved ! in the /tmp/foo/bar directory ! ! % bioruby /tmp/foo/bar ! ! (B) Rails mode ! ! 4. run in the ~/.bioruby directory and the session will also be saved ! in the ~/.bioruby directory ! ! % bioruby -r ! ! 5. run in the foo/bar directory and the session will also be saved ! in the foo/bar directory ! ! % bioruby -r foo/bar ! ! 6. run in the /tmp/foo/bar directory and the session will also be ! saved in the /tmp/foo/bar directory ! ! % bioruby -r /tmp/foo/bar ! ! (C) Script mode ! ! 7. run in the current directory using the session saved ! in the ~/.bioruby directory ! ! % bioruby ~/.bioruby/shell/script.rb ! ! 8. run in the current directory using the session saved ! in the foo/bar directory ! ! % bioruby foo/bar/shell/script.rb ! ! 9. run in the current directory using the session saved ! in the /tmp/foo/bar directory ! ! % bioruby /tmp/foo/bar/shell/script.rb ! ! 2007-06-21 Toshiaki Katayama ! ! * lib/bio/shell/setup.rb ! ! If no directory is specified to the bioruby command, ! use ~/.bioruby directory as the default save directory ! instead of the current directory, as suggested by Jun Sese. ! ! User can use 'bioruby' command without botherd by directories ! and files previously created by the 'bioruby' command ! in the current directory even when not needed. ! ! 2007-05-19 Toshiaki Katayama ! ! * lib/bio/appl/fasta.rb ! ! Bug fixed that exec_local fails to exec when @ktup is nil. ! This problem is reported and fixed by Fredrik Johansson. ! ! * lib/bio/db/gff.rb ! ! parser_attributes method in GFF3 class is modified to use ! '=' char as a separator instead of ' ' (which is used in ! GFF2 spec). ! ! 2007-04-06 Toshiaki Katayama ! ! * COPYING, COPYING.LIB are removed ! ! BioRuby is now distributed under the same terms as Ruby. ! ! On behalf of the BioRuby developer, I have asked all authors of ! the BioRuby code to change BioRuby's license from LGPL to Ruby's. ! And we have finished to change license of all modules in the BioRuby ! library. This means that Ruby user can freely use BioRuby library ! without being annoyed by licensing issues. ! ! * lib/bio/db/kegg/ko.rb is renamed to lib/bio/db/kegg/ortholog.rb ! ! KEGG KO database is renamed to KEGG ORTHOLOG database, thus we ! follow the change. Bio::KEGG::KO is renamed to Bio::KEGG::ORTHOLOG. ! ! Bio::KEGG::ORTHOLOG#genes, dblinks methods are rewrited to use ! lines_fetch method. ! ! * lib/bio/data/aa.rb ! ! to_re method is changed that the generated regexp to include ! ambiguous amino acid itself - replacement of amino acid X should ! include X itself. ! ! 2007-04-05 Trevor Wennblom ! ! * License headers are completely rewrited to Ruby's. 2007-04-02 Naohisa Goto *************** *** 57,64 **** * lib/bio/appl/mafft.rb ! Incompatible change: Bio::MAFFT#output is changed to return ! a string of multi-fasta formmatted text. To get an array of ! Bio::FastaFormat objects (as of 1.0 or before), please use ! report.data instead. 2007-03-27 Naohisa Goto --- 216,302 ---- * lib/bio/appl/mafft.rb ! Incompatible change: Bio::MAFFT#output is changed to return ! a string of multi-fasta formmatted text. To get an array of ! Bio::FastaFormat objects (as of 1.0 or before), please use ! report.data instead. ! ! 2007-03-29 Toshiaki Katayama ! ! * lib/bio/db/kegg/cell.rb ! ! Obsoleted as the KEGG CELL database is not publically available ! any more. ! ! 2007-03-28 Toshiaki Katayama ! ! * lib/bio/shell/rails/.../bioruby_controller.rb ! ! BioRuby shell on Rails access is changed to be limited only from ! the localhost for security reason (if local_request?). ! ! * lib/bio/command.rb ! ! The post_form method is modified to accept URL as a string and ! extended to accept params as ! array of string ! array of hash ! array of array ! or ! string ! in addition to hash (also can be ommited if not needed - defaults ! to nil). ! ! Keys and parameters of params are forced to use to_s for sure. ! ! * lib/bio/io/ensembl.rb ! ! Re-designed to allows user to use Bio::Ensembl.new without ! creating inherited sub class. ! ! Changed to use Bio::Command.post_form ! ! * lib/bio/das.rb ! ! Changed to use Bio::Command ! ! * lib/bio/shell/plugin/das.rb ! ! Newly added BioDAS client plugin for BioRuby shell. ! ! das.list_sequences ! das.dna ! das.features ! ! 2007-03-15 Toshiaki Katayama ! ! * lib/bio/shell/irb.rb ! ! Changed to load Rails environment when bioruby shell is invoked ! in the Rails project directory. This means that user can use ! 'bioruby' command as a better './script/console' which has ! persistent objects and shared history. ! ! 2007-03-08 Toshiaki Katayama ! ! * lib/bio/db/kegg/drug.rb ! ! Newly added KEGG DRUG database parser. ! ! * lib/bio/db/kegg/glycan.rb ! ! Bio::KEGG::GLYCAN#bindings method is removed. ! Bio::KEGG::GLYCAN#comment, remarks methods are added. ! Bio::KEGG::GLYCAN#orthologs and dblinks methods are changed to use ! lines_fetch method. ! ! * lib/bio/kegg/compound.rb ! ! Bio::KEGG::COMPOUND#glycans method is added ! Bio::KEGG::COMPOUND#names method is changed to return an array ! of stripped strings. ! ! * lib/bio/db/kegg/genes.rb ! ! Bio::KEGG::GENES#orthologs method is added. 2007-03-27 Naohisa Goto *************** *** 66,76 **** * lib/bio/command.rb ! Bio::Command.call_command_fork and query_command_fork methods ! are changed to handle all Ruby exceptions in the child process. * lib/bio/io/flatfile.rb ! UniProt format autodetection was changed to follow the change of ! UniProtKB release 9.0 of 31-Oct-2006. 2007-02-12 Naohisa Goto --- 304,314 ---- * lib/bio/command.rb ! Bio::Command.call_command_fork and query_command_fork methods ! are changed to handle all Ruby exceptions in the child process. * lib/bio/io/flatfile.rb ! UniProt format autodetection was changed to follow the change of ! UniProtKB release 9.0 of 31-Oct-2006. 2007-02-12 Naohisa Goto *************** *** 78,84 **** * lib/bio/io/flatfile.rb ! Exception class UnknownDataFormatError is added. ! It will be raised before reading data from IO when data format ! hasn't been specified due to failure of file format autodetection. 2007-02-02 Trevor Wennblom --- 316,328 ---- * lib/bio/io/flatfile.rb ! Exception class UnknownDataFormatError is added. ! It will be raised before reading data from IO when data format ! hasn't been specified due to failure of file format autodetection. ! ! 2007-02-12 Toshiaki Katayama ! ! * lib/bio/io/flatfile.rb ! ! Added support for KEGG EGENES. 2007-02-02 Trevor Wennblom *************** *** 100,106 **** --- 344,404 ---- Bio::SOFT for reading SOFT formatted NCBI GEO files. + 2007-01-16 Toshiaki Katayama + + * BioRuby shell on Rails new features and fixes + + New features: + * Input [#] is linked to action for filling textarea from history + * [methods] is separated into columns for readability + + Fixes and improvements: + * HIDE_VARIABLES is moved from helper to controller to avoid warning + "already initialized constant - HIDE_VARIABLES" repeated on reload. + *
is renamed to "log_#" with number for future + extention. + *
are inserted in the
+ + 2007-01-15 Toshiaki Katayama + + * lib/bio/db.rb + + lines_fetch method (internally used various bio/db/*.rb modules) + is rewrited to concatenate indented sub field. + + * lib/bio/db/kegg/compound.rb + + Bio::KEGG::COMPOUND#comment method which returns contents of + the COMMENT line is added + + * lib/bio/db/kegg/enzyme.rb + + Bio::KEGG::ENZYME#entry_id is changed to return EC number only. + Previous version of entry_id method is renamed to entry method + which returns a "EC x.x.x.x Enzyme" style string. + + Bio::KEGG::ENZYME#obsolete? method is added which returns boolean + value (true or false) according to the ENTRY line contains + a string 'Obsolete' or not. + + Bio::KEGG::ENZYME#all_reac, iubmb_reactions, kegg_reactions methods + are added to support newly added ALL_REAC field. + + Bio::KEGG::ENZYME#inhibitors and orthologs methods are added. + + Bio::KEGG::ENZYME#substrates, products, inhibitors, cofactors, + pathways, orthologs, diseases, motifs methods are rewrited to + utilizes new lines_fetch method in db.rb to process continuous + sub field. + + * lib/bio/db/kegg/genome.rb + + Bio::KEGG::GENOME#scaffolds, gc, genomemap methods are obsoleted. + Bio::KEGG::GENOME#distance, data_source, original_db methods are + added. + 2006-12-24 Toshiaki Katayama * bin/bioruby, lib/bio/shell/, lib/bio/shell/rails/ + (lib/bio/shell/rails/vendor/plugins/generators/) Web functionallity of the BioRuby shell is completely rewrited *************** *** 113,116 **** --- 411,433 ---- visual effects. + * lib/bio/.rb + + Extended to have Bio.command where command can be any BioRuby + shell methods. + ex. puts Bio.getseq("atgc" * 10).randomize.translate + + * lib/bio/shell/plugin/entry.rb, seq.rb + + seq, ent, obj commands are renamed to getseq, getent, getobj + respectively. This getseq is also changed to return Bio::Sequence + with @moltype = Bio::Sequence::NA object instead of Bio::Sequence::NA + object. + + * lib/bio/db/kegg/kgml.rb + + Some method names are changed to avoid confusion: + * entry_type is renamed to category () + * map is renamed to pathway () + 2006-12-19 Christian Zmasek *************** *** 177,180 **** --- 494,501 ---- NHX (New Hampshire eXtended) parser/writer support are added. + 2006-12-13 Toshiaki Katayama + + * doc/Desing.rd.ja, doc/TODO.rd.ja, doc/BioRuby.rd.ja are obsoletd. + 2006-10-05 Naohisa Goto *************** *** 189,192 **** --- 510,610 ---- is newly added. + 2006-09-19 Toshiaki Katayama + + * lib/bio/io/soapwsdl.rb + * lib/bio/io/ebisoap.rb + * lib/bio/io/ncbisoap.rb + + Newly added web service modules. + + * lib/bio/db/kegg/kgml.rb + + Accessor for the attribute is added. + + * lib/bio/shell/plugin/codon.rb + + Support for Pyrrolysine and Selenocysteine are added in the + BioRuby shell. + + * lib/bio/sshell/plugin/seq.rb + + sixtrans, skip, step methods are added in the BioRuby shell. + bioruby> seqtrans(seq) + + bioruby> seq.step(window_size) {|subseq| + # do something on subseq + } + + bioruby> seq.skip(window_sizep, step_size) {|subseq| + # do something on subseq + } + + 2006-07-26 Toshiaki Katayama + + * lib/bio/data/aa.rb + + Amino acids J (Xle: I/L), O (Pyl: pyrrolysine) and X (unknown) + are added (now we have consumed 26 alphabets!). + + * lib/bio/io/fastacmd.rb + + Fixed that new version of fastacmd (in BLAST package) changed + the option from '-D T' to '-D 1', contributed by the author + of this module Shuji Shigenobu. + + * lib/bio/shell/plugin/psort.rb + + Newly added BioRuby shell plugin for PSORT + + * lib/bio/shell/plugin/blast.rb + + Newly added BioRuby shell plugin for BLAST search against KEGG GENES + + * lib/bio/db/prosite.rb + + PROSITE#re instance method is added to translate PATTERN of + the entry to Regexp using PROSITE.pa2re class method. + + * lib/bio/db/kegg/genes.rb + + Bio::KEGG::GENES#keggclass method is renamed to pathway + Bio::KEGG::GENES#splinks method is removed + Bio::KEGG::GENES#motifs method is added + these reflect changes made in the original KEGG GENES database. + + Bio::KEGG::GENES#locations method is added to return Bio::Locations + Bio::KEGG::GENES#codon_usage is renamed cu_list (returns as Array) + Bio::KEGG::GENES#cu is renamed to codon_usage (returns as Hash) + Bio::KEGG::GENES#aalen, nalen methods are changed to return + the number written in the entry (use seq.length to obtain calculated + number as before). + + * lib/bio/db/kegg/kgml.rb + + Names of some accessors have been changed (including bug fixes) + and instance variable @dom is obsoleted. Here's a list of + incompatible attribute names with KGML tags by this change: + + :id -> :entry_id + :type -> :entry_type + names() + + :name -> :label + :type -> :shape + + :entry1 -> :node1 + :entry2 -> :node2 + :type -> :rel + + edge() + + :name -> :entry_id + :type -> :direction + + * lib/bio/io/das.rb + + Bug fixed that the value of segment.stop was overwritten by + segment.orientation. + 2006-07-14 Naohisa Goto *************** *** 235,238 **** --- 653,663 ---- Bug fix: Bio::FlatFile.open(klass, filename) didn't work. + 2006-05-30 Toshiaki Katayama + + * lib/bio/io/soapwsdl.rb + + Generic list_methods method which extracts web service methods + defined in the WSDL file is added. + 2006-05-02 Mitsuteru Nakao From ngoto at dev.open-bio.org Wed Jul 18 08:47:41 2007 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Wed, 18 Jul 2007 08:47:41 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/appl/clustalw report.rb,1.12,1.13 Message-ID: <200707180847.l6I8lfKg028076@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/appl/clustalw In directory dev.open-bio.org:/tmp/cvs-serv28056/lib/bio/appl/clustalw Modified Files: report.rb Log Message: changed messages and documents Index: report.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/clustalw/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:39 -0000 1.12 --- report.rb 18 Jul 2007 08:47:39 -0000 1.13 *************** *** 92,105 **** # 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. def to_fasta(*arg) ! alignment.to_fasta(*arg) end # Gets an array of the sequences. # Returns an array of Bio::FastaFormat objects. --- 92,111 ---- # Returns a Bio::Alignment object. def align ! warn "Bio::ClustalW#align will be 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. def to_fasta(*arg) ! warn "Bio::ClustalW::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 objects. From nakao at dev.open-bio.org Wed Jul 18 11:11:59 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Wed, 18 Jul 2007 11:11:59 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/appl/iprscan report.rb,1.8,1.9 Message-ID: <200707181111.l6IBBxFq028516@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/appl/iprscan In directory dev.open-bio.org:/tmp/cvs-serv28494/lib/bio/appl/iprscan Modified Files: report.rb Log Message: * Changed method names: 1. reports_in_* -> parse_* 2. parse_in_* -> parse_*_entry 3. to_* -> format_* * Added Report#output(:format_type) method to be the facade pattern of format_* methods. Index: report.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/iprscan/report.rb,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** report.rb 17 Jul 2007 14:16:50 -0000 1.8 --- report.rb 18 Jul 2007 11:11:57 -0000 1.9 *************** *** 24,28 **** # == USAGE # # Read a marged.txt and split each entry. ! # Bio::Iprscan::Report.reports_in_txt(File.read("marged.txt")) do |report| # report.query_id # report.matches.size --- 24,28 ---- # == USAGE # # Read a marged.txt and split each entry. ! # Bio::Iprscan::Report.parse_txt(File.read("marged.txt")) do |report| # report.query_id # report.matches.size *************** *** 41,45 **** # end # ! # Bio::Iprscan::Report.reports_in_raw(File.read("marged.raw")) do |report| # report.class #=> Bio::Iprscan::Report # end --- 41,45 ---- # end # ! # Bio::Iprscan::Report.parse_raw(File.read("marged.raw")) do |report| # report.class #=> Bio::Iprscan::Report # end *************** *** 66,74 **** # == USAGE ! # Bio::Iprscan::Report.reports_in_raw(File.open("merged.raw")) do |report| # report # end # ! def self.reports_in_raw(io) entry = '' while line = io.gets --- 66,74 ---- # == USAGE ! # Bio::Iprscan::Report.parse_raw(File.open("merged.raw")) do |report| # report # end # ! def self.parse_raw(io) entry = '' while line = io.gets *************** *** 76,80 **** entry << line elsif entry != '' ! yield Bio::Iprscan::Report.parse_in_raw(entry) entry = line else --- 76,80 ---- entry << line elsif entry != '' ! yield Bio::Iprscan::Report.parse_raw_entry(entry) entry = line else *************** *** 82,91 **** end end ! yield Bio::Iprscan::Report.parse_in_raw(entry) if entry != '' end # Parser method for a raw formated entry. Retruns a Bio::Iprscan::Report # object. ! def self.parse_in_raw(str) report = self.new str.split(/\n/).each do |line| --- 82,91 ---- end end ! yield Bio::Iprscan::Report.parse_raw_entry(entry) if entry != '' end # Parser method for a raw formated entry. Retruns a Bio::Iprscan::Report # object. ! def self.parse_raw_entry(str) report = self.new str.split(/\n/).each do |line| *************** *** 117,123 **** # Parser method for a xml formated entry. Retruns a Bio::Iprscan::Report # object. ! def self.parse_in_xml(str) ! NotImplementedError ! end # Splits the entry stream. --- 117,122 ---- # Parser method for a xml formated entry. Retruns a Bio::Iprscan::Report # object. ! # def self.parse_xml(str) ! # end # Splits the entry stream. *************** *** 125,133 **** # == Usage # ! # Bio::Iprscan::Report.reports_in_txt(File.open("merged.txt")) do |report| # report.class #=> Bio::Iprscan::Report # end # ! def self.reports_in_txt(io) io.each("\n\nSequence") do |entry| if entry =~ /Sequence$/ --- 124,132 ---- # == Usage # ! # Bio::Iprscan::Report.reports_txt(File.open("merged.txt")) do |report| # report.class #=> Bio::Iprscan::Report # end # ! def self.parse_txt(io) io.each("\n\nSequence") do |entry| if entry =~ /Sequence$/ *************** *** 137,141 **** entry = 'Sequence' + entry end ! yield self.parse_in_txt(entry) end end --- 136,140 ---- entry = 'Sequence' + entry end ! yield self.parse_txt_entry(entry) end end *************** *** 146,150 **** # object. # ! def self.parse_in_txt(str) unless str =~ /^Sequence / raise ArgumentError, "Invalid format: \n\n#{str}" --- 145,149 ---- # object. # ! def self.parse_txt_entry(str) unless str =~ /^Sequence / raise ArgumentError, "Invalid format: \n\n#{str}" *************** *** 190,199 **** # # == Usage ! # Bio::Iprscan::Report.reports_in_ptxt(File.open("merged.txt")) do |report| # report # end ! def self.reports_in_ptxt(io) io.each("\n\/\/\n") do |entry| ! yield self.parse_in_ptxt(entry) end end --- 189,198 ---- # # == Usage ! # Bio::Iprscan::Report.parse_ptxt(File.open("merged.txt")) do |report| # report # end ! def self.parse_ptxt(io) io.each("\n\/\/\n") do |entry| ! yield self.parse_ptxt_entry(entry) end end *************** *** 205,212 **** # # File.read("marged.txt").each(Bio::Iprscan::Report::RS) do |e| ! # report = Bio::Iprscan::Report.parse_in_ptxt(e) # end # ! def self.parse_in_ptxt(str) report = self.new ipr_line = '' --- 204,211 ---- # # File.read("marged.txt").each(Bio::Iprscan::Report::RS) do |e| ! # report = Bio::Iprscan::Report.parse_ptxt_entry(e) # end # ! def self.parse_ptxt_entry(str) report = self.new ipr_line = '' *************** *** 242,267 **** end ! def to_html ! NotImplementedError end ! def to_xml ! NotImplementedError ! end ! def to_ebixml ! NotImplementedError ! end ! def to_txt ! NotImplementedError ! end ! def to_raw @matches.map { |match| [self.query_id, self.crc64, self.query_length, ! match.method, match.accession, match.description, --- 241,273 ---- end ! ! # Output interpro matches in the format_type. ! def output(format_type) ! case format_type ! when 'raw', :raw ! format_raw ! else ! raise NameError, "Invalid format_type." ! end end + + # def format_html + # end ! # def format_xml ! # end ! # def format_ebixml ! # end ! # def format_txt ! # end ! def format_raw @matches.map { |match| [self.query_id, self.crc64, self.query_length, ! match.method_name, match.accession, match.description, *************** *** 278,302 **** end ! def to_gff3 ! NotImplementedError ! end ! # Returns a Hash (key as an interpro id and value as index key for ! # matches (Array). # ! # report.list_of_interpro.each do |ipr_id, indexes| ! # indexes.each do |index| ! # report.matches[index].ipr_id == ipr_id #=> true # end # end # ! def list_of_interpro ! @ipr_ids = {} unless @ipr_ids ! @matches.each_with_index do |match, i| ! @ipr_ids[match.ipr_id] = [] unless @ipr_ids[match.ipr_id] ! @ipr_ids[match.ipr_id] << i end - @ipr_ids end --- 284,310 ---- end ! # def format_gff3 ! # end ! # Returns a Hash (key as an Interpro ID and value as a Match). # ! # report.to_hash.each do |ipr_id, matches| ! # matches.each do |match| ! # report.matches.ipr_id == ipr_id #=> true # end # end # ! def to_hash ! unless @ipr_ids ! @ipr_ids = {} ! @matches.each_with_index do |match, i| ! @ipr_ids[match.ipr_id] ||= [] ! @ipr_ids[match.ipr_id] << match ! end ! return @ipr_ids ! else ! return @ipr_ids end end *************** *** 333,338 **** def length; @data[:length]; end # the analysis method launched. ! def method; @data[:method]; end # Object#metod overrided by Match#method ! # the Gene Ontology description for the InterPro entry, in "Aspect:term (ID)" format. def go_terms; @data[:go_terms]; end # Id of the input sequence. --- 341,346 ---- def length; @data[:length]; end # the analysis method launched. ! def method_name; @data[:method]; end ! # the Gene Ontology description for the InterPro entry, in "Aspect :term (ID)" format. def go_terms; @data[:go_terms]; end # Id of the input sequence. From nakao at dev.open-bio.org Wed Jul 18 11:11:59 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Wed, 18 Jul 2007 11:11:59 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio/appl/iprscan test_report.rb, 1.6, 1.7 Message-ID: <200707181111.l6IBBxCL028521@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio/appl/iprscan In directory dev.open-bio.org:/tmp/cvs-serv28494/test/unit/bio/appl/iprscan Modified Files: test_report.rb Log Message: * Changed method names: 1. reports_in_* -> parse_* 2. parse_in_* -> parse_*_entry 3. to_* -> format_* * Added Report#output(:format_type) method to be the facade pattern of format_* methods. Index: test_report.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/unit/bio/appl/iprscan/test_report.rb,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** test_report.rb 17 Jul 2007 14:16:50 -0000 1.6 --- test_report.rb 18 Jul 2007 11:11:57 -0000 1.7 *************** *** 44,48 **** // END ! @obj = Bio::Iprscan::Report.parse_in_ptxt(test_entry) end --- 44,48 ---- // END ! @obj = Bio::Iprscan::Report.parse_ptxt_entry(test_entry) end *************** *** 69,73 **** def test_match_method ! assert_equal('BlastProDom', @obj.matches.first.method) end --- 69,73 ---- def test_match_method ! assert_equal('BlastProDom', @obj.matches.first.method_name) end *************** *** 98,102 **** def setup test_txt = Bio::TestIprscanData.txt_format.read.split(/\n\nSequence/)[0] ! @obj = Bio::Iprscan::Report.parse_in_txt(test_txt) end --- 98,102 ---- def setup test_txt = Bio::TestIprscanData.txt_format.read.split(/\n\nSequence/)[0] ! @obj = Bio::Iprscan::Report.parse_txt_entry(test_txt) end *************** *** 126,130 **** def test_match_method ! assert_equal('FPrintScan', @obj.matches.first.method) end --- 126,130 ---- def test_match_method ! assert_equal('FPrintScan', @obj.matches.first.method_name) end *************** *** 170,188 **** def setup test_txt = Bio::TestIprscanData.txt_format.read.split(/\n\nSequence/)[0] ! @obj = Bio::Iprscan::Report.parse_in_txt(test_txt) end ! def test_list_of_interpro ! hsh = {"IPR008994"=>[12, 13, 14], ! "IPR000110"=>[0, 1, 2], ! "IPR003029"=>[3, 4, 5, 6, 7, 8, 9, 10, 11], ! "NULL"=>[15]} ! assert_equal(hsh, @obj.list_of_interpro) end ! def test_list_of_interpro_match? ! @obj.list_of_interpro.each do |ipr_id, indexes| ! indexes.each do |index| ! assert_equal(ipr_id, @obj.matches[index].ipr_id) end end --- 170,189 ---- def setup test_txt = Bio::TestIprscanData.txt_format.read.split(/\n\nSequence/)[0] ! @obj = Bio::Iprscan::Report.parse_txt_entry(test_txt) end ! def test_to_hash ! hsh = {"IPR008994" => [12, 13, 14].map {|x| @obj.matches[x] }, ! "IPR000110" => [0, 1, 2].map {|x| @obj.matches[x] }, ! "IPR003029" => [3, 4, 5, 6, 7, 8, 9, 10, 11].map {|x| @obj.matches[x] }, ! "NULL" => [15].map {|x| @obj.matches[x] }} ! assert_equal(hsh.keys.sort, @obj.to_hash.keys.sort) ! assert_equal(hsh, @obj.to_hash) end ! def test_to_hash_match? ! @obj.to_hash.each do |ipr_id, matches| ! matches.each do |match| ! assert_equal(ipr_id, match.ipr_id) end end *************** *** 196,201 **** end ! def test_reports_in_txt ! Bio::Iprscan::Report.reports_in_txt(@test_txt) do |report| assert_equal(Bio::Iprscan::Report, report.class) end --- 197,202 ---- end ! def test_parse_txt ! Bio::Iprscan::Report.parse_txt(@test_txt) do |report| assert_equal(Bio::Iprscan::Report, report.class) end *************** *** 216,220 **** entry << line elsif entry != '' and entry.split("\t").first != line.split("\t").first ! @obj << Bio::Iprscan::Report.parse_in_raw(entry) entry = '' else --- 217,221 ---- entry << line elsif entry != '' and entry.split("\t").first != line.split("\t").first ! @obj << Bio::Iprscan::Report.parse_raw_entry(entry) entry = '' else *************** *** 222,226 **** end end ! @obj << Bio::Iprscan::Report.parse_in_raw(entry) end --- 223,227 ---- end end ! @obj << Bio::Iprscan::Report.parse_raw_entry(entry) end *************** *** 229,233 **** "merged.raw")) result = [] ! Bio::Iprscan::Report.reports_in_raw(io) {|x| result << x } assert_equal(@obj.size, result.size) assert_equal(@obj.first.query_id, result.first.query_id) --- 230,234 ---- "merged.raw")) result = [] ! Bio::Iprscan::Report.parse_raw(io) {|x| result << x } assert_equal(@obj.size, result.size) assert_equal(@obj.first.query_id, result.first.query_id) *************** *** 266,270 **** def test_match_method ! assert_equal('HMMPfam', @obj.first.matches.first.method) end --- 267,271 ---- def test_match_method ! assert_equal('HMMPfam', @obj.first.matches.first.method_name) end *************** *** 316,325 **** class TestIprscanReport < Test::Unit::TestCase def setup ! test_txt = Bio::TestIprscanData.txt_format.read.split(/\n\nSequence/)[0] ! @obj = Bio::Iprscan::Report.parse_in_txt(test_txt) end def test_to_raw ! # puts @obj.to_raw end --- 317,335 ---- class TestIprscanReport < Test::Unit::TestCase def setup ! @test_txt = Bio::TestIprscanData.txt_format.read.split(/\n\nSequence/)[0] ! @obj = Bio::Iprscan::Report.parse_txt_entry(@test_txt) ! @test_raw = Bio::TestIprscanData.raw_format.read.split("RS16_ECOLI")[0] end def test_to_raw ! # assert_equal(@test_raw.split("\n").sort, ! # @obj.format_raw.split("\n").sort) ! end ! ! def test_output_raw ! # assert_equal(@test_raw.split("\n").sort, ! # @obj.output(:raw).split("\n").sort) ! # assert_equal(@test_raw.split("\n").sort, ! # @obj.output('raw').split("\n").sort) end From k at dev.open-bio.org Thu Jul 19 04:08:49 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 19 Jul 2007 04:08:49 +0000 Subject: [BioRuby-cvs] bioruby ChangeLog,1.67,1.68 Message-ID: <200707190408.l6J48n7v029776@dev.open-bio.org> Update of /home/repository/bioruby/bioruby In directory dev.open-bio.org:/tmp/cvs-serv29772 Modified Files: ChangeLog Log Message: * BioRuby 1.1.0 is released Index: ChangeLog =================================================================== RCS file: /home/repository/bioruby/bioruby/ChangeLog,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** ChangeLog 18 Jul 2007 08:20:48 -0000 1.67 --- ChangeLog 19 Jul 2007 04:08:47 -0000 1.68 *************** *** 1,2 **** --- 1,6 ---- + 2007-07-19 Toshiaki Katayama + + * BioRuby 1.1.0 released + 2007-07-17 Toshiaki Katayama From k at dev.open-bio.org Fri Jul 20 21:56:47 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Fri, 20 Jul 2007 21:56:47 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io keggapi.rb,1.14,1.15 Message-ID: <200707202156.l6KLulPC001352@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv1348 Modified Files: keggapi.rb Log Message: * Fixed that To define singleton method to Fixnum is not allowed. - can't define singleton method "filter" for Fixnum (TypeError) Index: keggapi.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/keggapi.rb,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** keggapi.rb 5 Apr 2007 23:35:41 -0000 1.14 --- keggapi.rb 20 Jul 2007 21:56:45 -0000 1.15 *************** *** 332,335 **** --- 332,336 ---- if results.is_a?(Array) results.each do |result| + next if result.is_a?(Fixnum) def result.filter(fields) fields.collect { |field| self.send(field) } From k at dev.open-bio.org Thu Jul 26 10:40:41 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 26 Jul 2007 10:40:41 +0000 Subject: [BioRuby-cvs] bioruby/bin bioruby,1.19,1.20 Message-ID: <200707261040.l6QAefro023557@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/bin In directory dev.open-bio.org:/tmp/cvs-serv23553 Modified Files: bioruby Log Message: * changed to use gem instead of require_gem Index: bioruby =================================================================== RCS file: /home/repository/bioruby/bioruby/bin/bioruby,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** bioruby 5 Apr 2007 23:35:39 -0000 1.19 --- bioruby 26 Jul 2007 10:40:39 -0000 1.20 *************** *** 3,7 **** # = BioRuby shell - command line interface for the BioRuby library # ! # Copyright:: Copyright (C) 2005, 2006 # Toshiaki Katayama # License:: The Ruby License --- 3,7 ---- # = BioRuby shell - command line interface for the BioRuby library # ! # Copyright:: Copyright (C) 2005, 2006, 2007 # Toshiaki Katayama # License:: The Ruby License *************** *** 12,20 **** begin require 'rubygems' ! require_gem 'bio', '>= 1.1.0' rescue LoadError end require 'bio/shell' # required to run commands (getseq, ls etc.) include Bio::Shell --- 12,26 ---- begin require 'rubygems' ! gem 'bio', '>= 1.1.0' rescue LoadError + require 'bio' end require 'bio/shell' + # utilize existing rails application + if File.exists?("./config/environment.rb") + load("./config/environment.rb") + end + # required to run commands (getseq, ls etc.) include Bio::Shell *************** *** 39,42 **** --- 45,53 ---- end + # utilize existing rails application + if File.exists?("./config/environment.rb") + load("./config/environment.rb") + end + # saving workspace, command history and configuration before exit Bio::Shell.save_session From k at dev.open-bio.org Thu Jul 26 10:46:48 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 26 Jul 2007 10:46:48 +0000 Subject: [BioRuby-cvs] bioruby/bin bioruby,1.20,1.21 Message-ID: <200707261046.l6QAkmV7023579@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/bin In directory dev.open-bio.org:/tmp/cvs-serv23575/bin Modified Files: bioruby Log Message: * removed unnecessary lines which are temporally added during several attempts to integrate Rails in shell (but now it is supported by shell/irb.rb and shell/web.rb) Index: bioruby =================================================================== RCS file: /home/repository/bioruby/bioruby/bin/bioruby,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** bioruby 26 Jul 2007 10:40:39 -0000 1.20 --- bioruby 26 Jul 2007 10:46:46 -0000 1.21 *************** *** 18,26 **** require 'bio/shell' - # utilize existing rails application - if File.exists?("./config/environment.rb") - load("./config/environment.rb") - end - # required to run commands (getseq, ls etc.) include Bio::Shell --- 18,21 ---- *************** *** 45,53 **** end - # utilize existing rails application - if File.exists?("./config/environment.rb") - load("./config/environment.rb") - end - # saving workspace, command history and configuration before exit Bio::Shell.save_session --- 40,43 ---- From pjotr at dev.open-bio.org Mon Jul 9 12:28:13 2007 From: pjotr at dev.open-bio.org (Pjotr Prins) Date: Mon, 09 Jul 2007 12:28:13 -0000 Subject: [BioRuby-cvs] bioruby/doc Tutorial.rd,1.12,1.13 Message-ID: <200707091228.l69CS9lG030424@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/doc In directory dev.open-bio.org:/tmp/cvs-serv30404/doc Modified Files: Tutorial.rd Log Message: Updated tutorial to include generating a random sequence and an example of using the rebase library. Index: Tutorial.rd =================================================================== RCS file: /home/repository/bioruby/bioruby/doc/Tutorial.rd,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Tutorial.rd 17 Feb 2006 14:59:26 -0000 1.12 --- Tutorial.rd 9 Jul 2007 12:28:07 -0000 1.13 *************** *** 9,16 **** Editor: PjotrPrins

! Copyright (C) 2001-2003 KATAYAMA Toshiaki , 2005-2006 all ! others ! ! NOTE: This page is a work in progress at this point IMPORTANT NOTICE: This page is maintained in the BioRuby CVS --- 9,13 ---- Editor: PjotrPrins

! Copyright (C) 2001-2003 KATAYAMA Toshiaki , 2005-2007 Pjotr Prins, Naohisa Goto and others IMPORTANT NOTICE: This page is maintained in the BioRuby CVS *************** *** 39,43 **** command. Showing something like: ! ruby 1.8.2 (2005-04-11) [powerpc-linux] --- 36,40 ---- command. Showing something like: ! ruby 1.8.5 (2006-08-25) [powerpc-linux] *************** *** 97,100 **** --- 94,100 ---- puts seq.complement.translate # translation of complemental strand + counts = {'a'=>seq.count('a'),'c'=>seq.count('c'),'g'=>seq.count('g'),'t'=>seq.count('t')} + p randomseq = Bio::Sequence::NA.randomize(counts) # reshuffle sequence with same freq. + The p, print and puts methods are standard Ruby ways of outputting to the screen. If you want to know more about standard Ruby commands you *************** *** 463,466 **** --- 463,500 ---- a2 = a.do_align(factory) + == Restriction Enzymes (Bio::RE) + + BioRuby has extensive support for restriction enzymes (REs). It contains a full + library of commonly used REs (from REBASE) which can be used to cut single + stranded RNA or dubbel stranded DNA into fragments. To list all enzymes: + + rebase = Bio::RestrictionEnzyme.rebase + rebase.each do |enzyme_name, info| + p enzyme_name + end + + and cut a sequence with an enzyme follow up with: + + res = seq.cut_with_enzyme('EcoRII', {:max_permutations => 0}, {:view_ranges => true}) + if res.kind_of? Symbol #error + err = Err.find_by_code(res.to_s) + unless err + err = Err.new(:code => res.to_s) + end + end + res.each do |frag| + em = EnzymeMatch.new + + em.p_left = frag.p_left + em.p_right = frag.p_right + em.c_left = frag.c_left + em.c_right = frag.c_right + + em.err = nil + em.enzyme = ar_enz + em.sequence = ar_seq + p em + end + == Sequence homology search by using the FASTA program (Bio::Fasta) *************** *** 1124,1135 **** * (()) == Using BioRuby with R ! The R libraries can be accessed from Ruby using the @@FIXME ! package. This allows at least use of the standard R library ! functions. Unfortunately there is no binding for dynamic R - so at ! this point you'll have to create some command line interface. ! == Using BioPerl from Ruby == Installing required external library --- 1158,1172 ---- * (()) + == Comparing BioProjects + + For a quick functional comparison of BioRuby, BioPerl, BioPython and Bioconductor (R) see (()) + == Using BioRuby with R ! Using Ruby with R Pjotr wrote a section on SciRuby. See (()) ! == Using BioPerl or BioPython from Ruby ! ! At the moment there is no easy way of accessing BioPerl from Ruby. The best way, perhaps, is to create a Perl server that gets accessed through XML/RPC or SOAP. == Installing required external library