From k at dev.open-bio.org Wed Mar 7 19:04:00 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 08 Mar 2007 00:04:00 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates bioruby.css, 1.2, 1.3 Message-ID: <200703080004.l28040Qq013745@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-serv13741/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates Modified Files: bioruby.css Log Message: * better font size for textarea, leftified h1 Index: bioruby.css =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/bioruby.css,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** bioruby.css 16 Jan 2007 05:47:05 -0000 1.2 --- bioruby.css 8 Mar 2007 00:03:58 -0000 1.3 *************** *** 136,145 **** h1 { ! font-size: 200%; color: #ffffff; background-color: #6e8377; line-height: 64px; ! text-align: right; ! padding-right: 20px; } --- 136,145 ---- h1 { ! font-size: 180%; color: #ffffff; background-color: #6e8377; line-height: 64px; ! text-align: left; ! padding-left: 20px; } *************** *** 212,215 **** --- 212,216 ---- textarea { font-family: monospace; + font-size: 100%; overflow: auto; } From k at dev.open-bio.org Wed Mar 7 19:10:07 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 08 Mar 2007 00:10:07 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg compound.rb,0.13,0.14 Message-ID: <200703080010.l280A7KM013862@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg In directory dev.open-bio.org:/tmp/cvs-serv13858 Modified Files: compound.rb Log Message: * glycans method is added * names method is changed to return array of strings which ';' is strippe and surrounding spaces are consumed Index: compound.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/compound.rb,v retrieving revision 0.13 retrieving revision 0.14 diff -C2 -d -r0.13 -r0.14 *** compound.rb 15 Jan 2007 04:34:32 -0000 0.13 --- compound.rb 8 Mar 2007 00:10:05 -0000 0.14 *************** *** 32,39 **** # NAME def names ! lines_fetch('NAME') end def name ! names[0] end --- 32,40 ---- # NAME def names ! field_fetch('NAME').split(/\s*;\s*/) end + def name ! names.first end *************** *** 48,51 **** --- 49,60 ---- end + # GLYCAN + def glycans + unless @data['GLYCAN'] + @data['GLYCAN'] = fetch('GLYCAN').split(/\s+/) + end + @data['GLYCAN'] + end + # REACTION def reactions From k at dev.open-bio.org Wed Mar 7 19:10:52 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 08 Mar 2007 00:10:52 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg genes.rb,0.23,0.24 Message-ID: <200703080010.l280AqLP013905@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg In directory dev.open-bio.org:/tmp/cvs-serv13901 Modified Files: genes.rb Log Message: * orthologs method is added Index: genes.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/genes.rb,v retrieving revision 0.23 retrieving revision 0.24 diff -C2 -d -r0.23 -r0.24 *** genes.rb 25 Jul 2006 19:12:32 -0000 0.23 --- genes.rb 8 Mar 2007 00:10:50 -0000 0.24 *************** *** 137,140 **** --- 137,144 ---- end + def orthologs + lines_fetch('ORTHOLOG') + end + def pathway field_fetch('PATHWAY') From k at dev.open-bio.org Wed Mar 7 19:11:51 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 08 Mar 2007 00:11:51 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg drug.rb,NONE,1.1 Message-ID: <200703080011.l280BpJA013948@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg In directory dev.open-bio.org:/tmp/cvs-serv13944 Added Files: drug.rb Log Message: * newly added KEGG DRUG parser --- NEW FILE: drug.rb --- # # = bio/db/kegg/drug.rb - KEGG DRUG database class # # Copyright:: Copyright (C) 2007 Toshiaki Katayama # License:: Ruby's # # $Id: drug.rb,v 1.1 2007/03/08 00:11:49 k Exp $ # require 'bio/db' module Bio class KEGG class DRUG < KEGGDB DELIMITER = RS = "\n///\n" TAGSIZE = 12 def initialize(entry) super(entry, TAGSIZE) end # ENTRY def entry_id unless @data['ENTRY'] @data['ENTRY'] = fetch('ENTRY').split(/\s+/).first end @data['ENTRY'] end # NAME def names field_fetch('NAME').split(/\s*;\s*/) end def name names.first end # FORMULA def formula field_fetch('FORMULA') end # MASS def mass field_fetch('MASS').to_f end # ACTIVITY def activity field_fetch('ACTIVITY') end # REMARK def remark field_fetch('REMARK') end # COMMENT def comment field_fetch('COMMENT') end # PATHWAY def pathways lines_fetch('DBLINKS') end # DBLINKS def dblinks lines_fetch('DBLINKS') end # ATOM, BOND def kcf return "#{get('ATOM')}#{get('BOND')}" end end # DRUG end # KEGG end # Bio if __FILE__ == $0 entry = ARGF.read # dr:D00001 dr = Bio::KEGG::DRUG.new(entry) p dr.entry_id p dr.names p dr.name p dr.formula p dr.mass p dr.activity p dr.remark p dr.comment p dr.dblinks p dr.kcf end From k at dev.open-bio.org Wed Mar 7 19:14:18 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 08 Mar 2007 00:14:18 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg glycan.rb,1.3,1.4 Message-ID: <200703080014.l280EITo013991@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg In directory dev.open-bio.org:/tmp/cvs-serv13987 Modified Files: glycan.rb Log Message: * bindings method is removed * comment and remarks methods are added * orthologs and dblinks methods are changed to use lines_fetch Index: glycan.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/glycan.rb,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** glycan.rb 19 Sep 2006 05:53:13 -0000 1.3 --- glycan.rb 8 Mar 2007 00:14:16 -0000 1.4 *************** *** 64,84 **** end - # BINDING - def bindings - unless @data['BINDING'] - ary = Array.new - lines = lines_fetch('BINDING') - lines.each do |line| - if /^\S/.match(line) - ary << line - else - ary.last << " #{line.strip}" - end - end - @data['BINDING'] = ary - end - @data['BINDING'] - end - # COMPOUND def compounds --- 64,67 ---- *************** *** 118,135 **** def orthologs unless @data['ORTHOLOG'] ! ary = Array.new ! lines = lines_fetch('ORTHOLOG') ! lines.each do |line| ! if /^\S/.match(line) ! ary << line ! else ! ary.last << " #{line.strip}" ! end ! end ! @data['ORTHOLOG'] = ary end @data['ORTHOLOG'] end # REFERENCE def references --- 101,119 ---- def orthologs unless @data['ORTHOLOG'] ! @data['ORTHOLOG'] = lines_fetch('ORTHOLOG') end @data['ORTHOLOG'] end + # COMMENT + def comment + field_fetch('COMMENT') + end + + # REMARK + def remark + field_fetch('REMARK') + end + # REFERENCE def references *************** *** 152,165 **** def dblinks unless @data['DBLINKS'] ! ary = Array.new ! lines = lines_fetch('DBLINKS') ! lines.each do |line| ! if /^\S/.match(line) ! ary << line ! else ! ary.last << " #{line.strip}" ! end ! end ! @data['DBLINKS'] = ary end @data['DBLINKS'] --- 136,140 ---- def dblinks unless @data['DBLINKS'] ! @data['DBLINKS'] = lines_fetch('DBLINKS') end @data['DBLINKS'] From k at dev.open-bio.org Wed Mar 7 19:20:23 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 08 Mar 2007 00:20:23 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg ortholog.rb, NONE, 1.1 ko.rb, 1.6, NONE Message-ID: <200703080020.l280KNX8014070@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg In directory dev.open-bio.org:/tmp/cvs-serv14066 Added Files: ortholog.rb Removed Files: ko.rb Log Message: * Recently, KEGG KO database is renamed to KEGG ORTHOLOG, so we follow the change as * ko.rb is renamed to ortholog.rb * Bio::KEGG::KO is renamed to Bio::KEGG::ORTHOLOG * genes and dblinks methods are rewrited to use lines_fetch --- NEW FILE: ortholog.rb --- # # = bio/db/kegg/ortholog.rb - KEGG ORTHOLOG database class # # Copyright:: Copyright (C) 2003-2007 Toshiaki Katayama # Copyright:: Copyright (C) 2003 Masumi Itoh # # $Id: ortholog.rb,v 1.1 2007/03/08 00:20:21 k Exp $ # require 'bio/db' module Bio class KEGG # == Description # # KO (KEGG Orthology) entry parser. # # == References # # * http://www.genome.jp/dbget-bin/get_htext?KO # * ftp://ftp.genome.jp/pub/kegg/tarfiles/ko # class ORTHOLOG < KEGGDB DELIMITER = RS = "\n///\n" TAGSIZE = 12 # Reads a flat file format entry of the KO database. def initialize(entry) super(entry, TAGSIZE) end # Returns ID of the entry. def entry_id field_fetch('ENTRY')[/\S+/] end # Returns NAME field of the entry. def name field_fetch('NAME') end # Returns an Array of names in NAME field. def names name.split(', ') end # Returns DEFINITION field of the entry. def definition field_fetch('DEFINITION') end # Returns CLASS field of the entry. def keggclass field_fetch('CLASS') end # Returns an Array of biological classes in CLASS field. def keggclasses keggclass.gsub(/ \[[^\]]+/, '').split(/\] ?/) end # Returns an Array of KEGG/PATHWAY ID in CLASS field. def pathways keggclass.scan(/\[PATH:(.*?)\]/).flatten end # Returns a Hash of Array of a database name and entry IDs in DBLINKS field. def dblinks unless @data['DBLINKS'] @data['DBLINKS'] = lines_fetch('DBLINKS') end @data['DBLINKS'] end # Returns a Hash of Array of the organism ID and entry IDs in GENES field. def genes unless @data['GENES'] @data['GENES'] = lines_fetch('GENES') end @data['DBLINKS'] end end # KO end # KEGG end # Bio if __FILE__ == $0 require 'bio/io/fetch' flat = Bio::Fetch.query('ko', 'K00001') entry = Bio::KEGG::KO.new(flat) p entry.entry_id p entry.name p entry.names p entry.definition p entry.keggclass p entry.keggclasses p entry.pathways p entry.dblinks p entry.genes end --- ko.rb DELETED --- From k at dev.open-bio.org Wed Mar 7 19:25:28 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 08 Mar 2007 00:25:28 +0000 Subject: [BioRuby-cvs] bioruby/lib bio.rb,1.81,1.82 Message-ID: <200703080025.l280PS0b014113@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib In directory dev.open-bio.org:/tmp/cvs-serv14109 Modified Files: bio.rb Log Message: * Bio::KEGG::DRUG is added * Bio::KEGG::KO is renamed to Bio::KEGG::ORTHOLOG Index: bio.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio.rb,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** bio.rb 2 Feb 2007 06:13:10 -0000 1.81 --- bio.rb 8 Mar 2007 00:25:26 -0000 1.82 *************** *** 89,92 **** --- 89,93 ---- autoload :ENZYME, 'bio/db/kegg/enzyme' autoload :COMPOUND, 'bio/db/kegg/compound' + autoload :DRUG, 'bio/db/kegg/drug' autoload :GLYCAN, 'bio/db/kegg/glycan' autoload :REACTION, 'bio/db/kegg/reaction' *************** *** 94,100 **** autoload :CELL, 'bio/db/kegg/cell' autoload :EXPRESSION, 'bio/db/kegg/expression' ! autoload :Keggtab, 'bio/db/kegg/keggtab' ! autoload :KO, 'bio/db/kegg/ko' autoload :KGML, 'bio/db/kegg/kgml' end --- 95,101 ---- autoload :CELL, 'bio/db/kegg/cell' autoload :EXPRESSION, 'bio/db/kegg/expression' ! autoload :ORTHOLOG, 'bio/db/kegg/ortholog' autoload :KGML, 'bio/db/kegg/kgml' + autoload :Keggtab, 'bio/db/kegg/keggtab' end From k at dev.open-bio.org Wed Mar 7 19:27:20 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 08 Mar 2007 00:27:20 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io flatfile.rb,1.55,1.56 Message-ID: <200703080027.l280RK2N014156@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv14152 Modified Files: flatfile.rb Log Message: * Bio::KEGG::DRUG is added * Bio::KEGG::KO is renamed to Bio::KEGG::ORTHOLOG Index: flatfile.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/flatfile.rb,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** flatfile.rb 12 Feb 2007 09:59:37 -0000 1.55 --- flatfile.rb 8 Mar 2007 00:27:18 -0000 1.56 *************** *** 1145,1150 **** brite = RuleRegexp[ 'Bio::KEGG::BRITE', /^Entry [A-Z0-9]+/ ], ! ko = RuleRegexp[ 'Bio::KEGG::KO', /^ENTRY .+ KO\s*/ ], glycan = RuleRegexp[ 'Bio::KEGG::GLYCAN', /^ENTRY .+ Glycan\s*/ ], --- 1145,1152 ---- brite = RuleRegexp[ 'Bio::KEGG::BRITE', /^Entry [A-Z0-9]+/ ], ! ortholog = RuleRegexp[ 'Bio::KEGG::ORTHOLOG', /^ENTRY .+ KO\s*/ ], + drug = RuleRegexp[ 'Bio::KEGG::DRUG', + /^ENTRY .+ Drug\s*/ ], glycan = RuleRegexp[ 'Bio::KEGG::GLYCAN', /^ENTRY .+ Glycan\s*/ ], *************** *** 1247,1252 **** #aaindex.is_prior_to litdb #litdb.is_prior_to brite ! brite.is_prior_to ko ! ko.is_prior_to glycan glycan.is_prior_to enzyme enzyme.is_prior_to compound --- 1249,1255 ---- #aaindex.is_prior_to litdb #litdb.is_prior_to brite ! brite.is_prior_to ortholog ! ortholog.is_prior_to drug ! drug.is_prior_to glycan glycan.is_prior_to enzyme enzyme.is_prior_to compound From k at dev.open-bio.org Thu Mar 8 03:30:18 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 08 Mar 2007 08:30:18 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg ortholog.rb,1.1,1.2 Message-ID: <200703080830.l288UIfN014845@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg In directory dev.open-bio.org:/tmp/cvs-serv14841 Modified Files: ortholog.rb Log Message: * fixed a bug in genes method Index: ortholog.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/ortholog.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ortholog.rb 8 Mar 2007 00:20:21 -0000 1.1 --- ortholog.rb 8 Mar 2007 08:30:15 -0000 1.2 *************** *** 80,84 **** @data['GENES'] = lines_fetch('GENES') end ! @data['DBLINKS'] end --- 80,84 ---- @data['GENES'] = lines_fetch('GENES') end ! @data['GENES'] end From nakao at dev.open-bio.org Tue Mar 13 13:03:57 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Tue, 13 Mar 2007 17:03:57 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db/embl embl.rb,1.27,1.28 Message-ID: <200703131703.l2DH3vWq007326@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db/embl In directory dev.open-bio.org:/tmp/cvs-serv7300/lib/bio/db/embl Modified Files: embl.rb Log Message: * Fixed a bug for parsing id_line in the EMBL release 89 format reported by Michael Han. * Added the unit test and data files for EMBL release 89 format. Index: embl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/embl/embl.rb,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** embl.rb 14 Apr 2006 05:49:30 -0000 1.27 --- embl.rb 13 Mar 2007 17:03:55 -0000 1.28 *************** *** 3,7 **** # # ! # Copyright:: Copyright (C) 2001-2006 Mitsuteru C. Nakao # License:: Ruby's # --- 3,7 ---- # # ! # Copyright:: Copyright (C) 2001-2007 Mitsuteru C. Nakao # License:: Ruby's # *************** *** 41,45 **** # where is: # {'ENTRY_NAME' => String, 'MOLECULE_TYPE' => String, 'DIVISION' => String, ! # 'SEQUENCE_LENGTH' => Int} # # ID Line --- 41,45 ---- # where is: # {'ENTRY_NAME' => String, 'MOLECULE_TYPE' => String, 'DIVISION' => String, ! # 'SEQUENCE_LENGTH' => Int, 'SEQUENCE_VERSION' => Int} # # ID Line *************** *** 70,81 **** # VRL (Viruses) # def id_line(key=nil) unless @data['ID'] tmp = Hash.new idline = fetch('ID').split(/; +/) ! tmp['ENTRY_NAME'], tmp['DATA_CLASS'] = idline[0].split(/ +/) ! tmp['MOLECULE_TYPE'] = idline[1] ! tmp['DIVISION'] = idline[2] ! tmp['SEQUENCE_LENGTH'] = idline[3].strip.split(' ').first.to_i @data['ID'] = tmp --- 70,98 ---- # VRL (Viruses) # + # Rel 89- + # ID CD789012; SV 4; linear; genomic DNA; HTG; MAM; 500 BP. + # ID <1>; SV <2>; <3>; <4>; <5>; <6>; <7> BP. + # 1. Primary accession number + # 2. Sequence version number + # 3. Topology: 'circular' or 'linear' + # 4. Molecule type (see note 1 below) + # 5. Data class (see section 3.1) + # 6. Taxonomic division (see section 3.2) + # 7. Sequence length (see note 2 below) def id_line(key=nil) unless @data['ID'] tmp = Hash.new idline = fetch('ID').split(/; +/) ! tmp['ENTRY_NAME'], tmp['DATA_CLASS'] = idline.shift.split(/ +/) ! if idline.first =~ /^SV/ ! tmp['SEQUENCE_VERSION'] = idline.shift.split(' ').last ! tmp['TOPOLOGY'] = idline.shift ! tmp['MOLECULE_TYPE'] = idline.shift ! tmp['DATA_CLASS'] = idline.shift ! else ! tmp['MOLECULE_TYPE'] = idline.shift ! end ! tmp['DIVISION'] = idline.shift ! tmp['SEQUENCE_LENGTH'] = idline.shift.strip.split(' ').first.to_i @data['ID'] = tmp *************** *** 129,136 **** # SV Accession.Version def sv ! field_fetch('SV').sub(/;/,'') end def version ! sv.split(".")[1].to_i end --- 146,157 ---- # SV Accession.Version def sv ! if (v = field_fetch('SV').sub(/;/,'')) == "" ! [id_line['ENTRY_NAME'], id_line['SEQUENCE_VERSION']].join('.') ! else ! v ! end end def version ! (sv.split(".")[1] || id_line['SEQUENCE_VERSION']).to_i end From nakao at dev.open-bio.org Tue Mar 13 13:03:57 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Tue, 13 Mar 2007 17:03:57 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio/db/embl test_embl_rel89.rb, NONE, 1.1 Message-ID: <200703131703.l2DH3vCL007331@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio/db/embl In directory dev.open-bio.org:/tmp/cvs-serv7300/test/unit/bio/db/embl Added Files: test_embl_rel89.rb Log Message: * Fixed a bug for parsing id_line in the EMBL release 89 format reported by Michael Han. * Added the unit test and data files for EMBL release 89 format. --- NEW FILE: test_embl_rel89.rb --- # # test/unit/bio/db/embl/test_embl_rel89.rb - Unit test for Bio::EMBL # # Copyright:: Copyright (C) 2007 Mitsuteru Nakao # License:: Ruby's # # $Id: test_embl_rel89.rb,v 1.1 2007/03/13 17:03:55 nakao 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/db/embl/embl' module Bio class TestEMBL < Test::Unit::TestCase def setup bioruby_root = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 5)).cleanpath.to_s output = File.open(File.join(bioruby_root, 'test', 'data', 'embl', 'AB090716.embl.rel89')).read @obj = Bio::EMBL.new(output) end # http://www.ebi.ac.uk/embl/Documentation/User_manual/usrman.html#s_3_4_1 def test_id_line assert(@obj.id_line) end def test_id_line_iterator assert(@obj.id_line {|key, value| }) end def test_id_line_entry_name assert_equal('AB090716', @obj.id_line('ENTRY_NAME')) end def test_id_line_data_class assert_equal('STD', @obj.id_line('DATA_CLASS')) end def test_id_line_sequence_version assert_equal('1', @obj.id_line('SEQUENCE_VERSION')) end def test_id_line_molecule_type assert_equal('genomic DNA', @obj.id_line('MOLECULE_TYPE')) end def test_id_line_division assert_equal('VRT', @obj.id_line('DIVISION')) end def test_id_line_sequence_length assert_equal(166, @obj.id_line('SEQUENCE_LENGTH')) end def test_entry entry_id = 'AB090716' assert_equal(entry_id, @obj.entry) assert_equal(entry_id, @obj.entry_name) assert_equal(entry_id, @obj.entry_id) end def test_molecule molecule = 'genomic DNA' assert_equal(molecule, @obj.molecule) assert_equal(molecule, @obj.molecule_type) end def test_division assert_equal('VRT', @obj.division) end def test_sequence_length seqlen = 166 assert_equal(seqlen, @obj.sequence_length) assert_equal(seqlen, @obj.seqlen) end # Bio::EMBLDB::COMMON#ac def test_ac ac = ['AB090716'] assert_equal(ac, @obj.ac) assert_equal(ac, @obj.accessions) end # Bio::EMBLDB::COMMON#accession def test_accession assert_equal('AB090716', @obj.accession) end def test_sv assert_equal('AB090716.1', @obj.sv) end def test_version assert_equal(1, @obj.version) end def test_dt assert(@obj.dt) end def test_dt_iterator assert(@obj.dt {|key, value| }) end def test_dt_created assert_equal('25-OCT-2002 (Rel. 73, Created)', @obj.dt('created')) end def test_dt_updated assert_equal('14-NOV-2006 (Rel. 89, Last updated, Version 3)', @obj.dt('updated')) end # Bio::EMBLDB::COMMON#de def test_de assert_equal("Haplochromis sp. 'muzu, rukwa' LWS gene for long wavelength-sensitive opsin, partial cds, specimen_voucher:specimen No. HT-9361.", @obj.de) end # Bio::EMBLDB::COMMON#kw def test_kw k = [] assert_equal([], @obj.kw) assert_equal([], @obj.keywords) end def test_os # assert_equal('', @obj.os) assert_raises(RuntimeError) { @obj.os } end def test_os_valid @obj.instance_eval { @data['OS'] = "Haplochromis sp. 'muzu rukwa'" } assert_equal("Haplochromis sp. 'muzu rukwa'", @obj.os) end # Bio::EMBLDB::COMMON#oc def test_oc assert_equal('Eukaryota', @obj.oc.first) end # Bio::EMBLDB::COMMON#og def test_og assert_equal([], @obj.og) end # Bio::EMBLDB::COMMON#ref def test_ref assert_equal(2, @obj.ref.size) end # Bio::EMBLDB::COMMON#references def test_references assert_equal(Bio::References, @obj.references.class) end # Bio::EMBLDB::COMMON#dr def test_dr assert_equal({}, @obj.dr) end def test_fh assert_equal('Key Location/Qualifiers', @obj.fh) end def test_ft assert_equal(Bio::Features, @obj.ft.class) end def test_ft_iterator @obj.ft.each do |feature| assert_equal(Bio::Feature, feature.class) end end def test_ft_accessor assert_equal('CDS', @obj.ft.features[1].feature) end def test_each_cds @obj.each_cds do |x| assert_equal('CDS', x.feature) end end def test_each_gene @obj.each_gene do |x| assert_equal('gene', x.feature) end end def test_cc assert_equal('', @obj.cc) end # def test_xx # end def test_sq data = {"a"=>29, "c"=>42, "ntlen"=>166, "g"=>41, "t"=>54, "other"=>0} assert_equal(data, @obj.sq) end def test_sq_get assert_equal(29, @obj.sq("a")) end def test_seq seq = 'gttctggcctcatggactgaagacttcctgtggacctgatgtgttcagtggaagtgaagaccctggagtacagtcctacatgattgttctcatgattacttgctgtttcatccccctggctatcatcatcctgtgctaccttgctgtgtggatggccatccgtgct' assert_equal(seq, @obj.seq) assert_equal(seq, @obj.naseq) assert_equal(seq, @obj.ntseq) end end end From nakao at dev.open-bio.org Tue Mar 13 13:03:57 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Tue, 13 Mar 2007 17:03:57 +0000 Subject: [BioRuby-cvs] bioruby/test/data/embl AB090716.embl.rel89,NONE,1.1 Message-ID: <200703131703.l2DH3vdZ007336@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/data/embl In directory dev.open-bio.org:/tmp/cvs-serv7300/test/data/embl Added Files: AB090716.embl.rel89 Log Message: * Fixed a bug for parsing id_line in the EMBL release 89 format reported by Michael Han. * Added the unit test and data files for EMBL release 89 format. --- NEW FILE: AB090716.embl.rel89 --- ID AB090716; SV 1; linear; genomic DNA; STD; VRT; 166 BP. XX AC AB090716; XX DT 25-OCT-2002 (Rel. 73, Created) DT 14-NOV-2006 (Rel. 89, Last updated, Version 3) XX DE Haplochromis sp. 'muzu, rukwa' LWS gene for long wavelength-sensitive DE opsin, partial cds, specimen_voucher:specimen No. HT-9361. XX KW . XX OS Haplochromis sp. 'muzu, rukwa' OC Eukaryota; Metazoa; Chordata; Craniata; Vertebrata; Euteleostomi; OC Actinopterygii; Neopterygii; Teleostei; Euteleostei; Neoteleostei; OC Acanthomorpha; Acanthopterygii; Percomorpha; Perciformes; Labroidei; OC Cichlidae; African cichlids; Pseudocrenilabrinae; Haplochromini; OC Haplochromis. XX RN [1] RP 1-166 RA Terai Y., Mayer W.E., Klein J., Tichy H., Okada N.; RT ; RL Submitted (26-AUG-2002) to the EMBL/GenBank/DDBJ databases. RL Yohey Terai, Tokyo Institute of Technology, Graduate School of Bioscience RL and Biotechnology; 4259 Nagatsuta-cho, Midori-ku, Yokohama, Kanagawa RL 226-8501, Japan (E-mail:yterai at bio.titech.ac.jp, Tel:81-45-924-5744, RL Fax:81-45-924-5835) XX RN [2] RX DOI; 10.1073/pnas.232561099. RX PUBMED; 12438648. RA Terai Y., Mayer W.E., Klein J., Tichy H., Okada N.; RT "The effect of selection on a long wavelength-sensitive (LWS) opsin gene of RT Lake Victoria cichlid fishes"; RL Proc. Natl. Acad. Sci. U.S.A. 99(24):15501-15506(2002). XX FH Key Location/Qualifiers FH FT source 1..166 FT /organism="Haplochromis sp. 'muzu, rukwa'" FT /mol_type="genomic DNA" FT /specimen_voucher="specimen No. HT-9361" FT /tissue_type="piece of fin" FT /db_xref="taxon:205497" FT CDS <1..>166 FT /codon_start=2 FT /gene="LWS" FT /product="long wavelength-sensitive opsin" FT /db_xref="UniProtKB/TrEMBL:Q8AUS6" FT /protein_id="BAC22028.1" FT /translation="FWPHGLKTSCGPDVFSGSEDPGVQSYMIVLMITCCFIPLAIIILC FT YLAVWMAIRA" FT exon 1..166 FT /gene="LWS" FT /product="long wavelength-sensitive opsin" FT /number=4 XX SQ Sequence 166 BP; 29 A; 42 C; 41 G; 54 T; 0 other; gttctggcct catggactga agacttcctg tggacctgat gtgttcagtg gaagtgaaga 60 ccctggagta cagtcctaca tgattgttct catgattact tgctgtttca tccccctggc 120 tatcatcatc ctgtgctacc ttgctgtgtg gatggccatc cgtgct 166 // From k at dev.open-bio.org Wed Mar 14 15:50:16 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 14 Mar 2007 19:50:16 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates bioruby_controller.rb, 1.2, 1.3 Message-ID: <200703141950.l2EJoGWr023012@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-serv23008/shell/rails/vendor/plugins/generators/bioruby/templates Modified Files: bioruby_controller.rb Log Message: * to avoid error on Mongrel 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.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** bioruby_controller.rb 16 Jan 2007 05:47:05 -0000 1.2 --- bioruby_controller.rb 14 Mar 2007 19:50:14 -0000 1.3 *************** *** 11,17 **** ActiveSupport::CoreExtensions::Numeric::Bytes, ActiveSupport::CoreExtensions::Numeric::Time, ! WEBrick, Base64::Deprecated, Base64, PP::ObjectMixin, Bio::Shell ] HIDE_VARIABLES = [ --- 11,18 ---- ActiveSupport::CoreExtensions::Numeric::Bytes, ActiveSupport::CoreExtensions::Numeric::Time, ! Base64::Deprecated, Base64, PP::ObjectMixin, Bio::Shell ] + HIDE_MODULES << WEBrick if defined?(WEBrick) HIDE_VARIABLES = [ From k at dev.open-bio.org Wed Mar 14 15:54:53 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 14 Mar 2007 19:54:53 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/shell irb.rb,1.1,1.2 Message-ID: <200703141954.l2EJsrXp023073@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/shell In directory dev.open-bio.org:/tmp/cvs-serv23069/shell Modified Files: irb.rb Log Message: * activate rails environment (models) if rails is installed in the current project. this means you can use 'bioruby' command as a better './scriopt/console' shell having persistent history and object serialization. Index: irb.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/irb.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** irb.rb 24 Dec 2006 08:32:08 -0000 1.1 --- irb.rb 14 Mar 2007 19:54:51 -0000 1.2 *************** *** 48,51 **** --- 48,57 ---- return line end + + if File.exists?("./config/boot.rb") + require "./config/boot" + require "./config/environment" + #require 'commands/console' + end end From k at dev.open-bio.org Wed Mar 14 15:55:12 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 14 Mar 2007 19:55:12 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/shell web.rb,1.2,1.3 Message-ID: <200703141955.l2EJtC9o023098@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/shell In directory dev.open-bio.org:/tmp/cvs-serv23094/shell Modified Files: web.rb Log Message: * minor update Index: web.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/web.rb,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** web.rb 24 Dec 2006 08:32:08 -0000 1.2 --- web.rb 14 Mar 2007 19:55:10 -0000 1.3 *************** *** 31,35 **** puts ">>>" puts ! puts '(port # may differ if opts for rails are given "bioruby --web proj -- -p port")' puts end --- 31,35 ---- puts ">>>" puts ! puts '(You can change the port number by adding "-- -p 4000" option)' puts end From ngoto at dev.open-bio.org Mon Mar 26 13:09:47 2007 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Mon, 26 Mar 2007 17:09:47 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio command.rb,1.12,1.13 Message-ID: <200703261709.l2QH9lYD026611@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio In directory dev.open-bio.org:/tmp/cvs-serv26590/lib/bio Modified Files: command.rb Log Message: changed to handle exceptions and to do exit! to avoid failure on error (e.g. commmand not found) Index: command.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/command.rb,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** command.rb 14 Jul 2006 14:23:47 -0000 1.12 --- command.rb 26 Mar 2007 17:09:45 -0000 1.13 *************** *** 116,120 **** else # child ! Kernel.exec(*cmd) end end --- 116,126 ---- else # child ! begin ! Kernel.exec(*cmd) ! rescue Errno::ENOENT, Errno::EACCES ! Process.exit!(127) ! rescue Exception ! end ! Process.exit!(1) end end *************** *** 179,183 **** else # child ! Kernel.exec(*cmd) end end --- 185,195 ---- else # child ! begin ! Kernel.exec(*cmd) ! rescue Errno::ENOENT, Errno::EACCES ! Process.exit!(127) ! rescue Exception ! end ! Process.exit!(1) end end From ngoto at dev.open-bio.org Tue Mar 27 05:26:05 2007 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Tue, 27 Mar 2007 09:26:05 +0000 Subject: [BioRuby-cvs] bioruby ChangeLog,1.61,1.62 Message-ID: <200703270926.l2R9Q5P7028897@dev.open-bio.org> Update of /home/repository/bioruby/bioruby In directory dev.open-bio.org:/tmp/cvs-serv28875 Modified Files: ChangeLog Log Message: UniProt format autodetection was changed to follow the change of UniProtKB release 9.0 of 31-Oct-2006. Index: ChangeLog =================================================================== RCS file: /home/repository/bioruby/bioruby/ChangeLog,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** ChangeLog 12 Feb 2007 10:04:59 -0000 1.61 --- ChangeLog 27 Mar 2007 09:26:02 -0000 1.62 *************** *** 1,2 **** --- 1,14 ---- + 2007-03-27 Naohisa Goto + + * 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 From ngoto at dev.open-bio.org Tue Mar 27 05:26:05 2007 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Tue, 27 Mar 2007 09:26:05 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io flatfile.rb,1.56,1.57 Message-ID: <200703270926.l2R9Q5R5028900@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv28875/lib/bio/io Modified Files: flatfile.rb Log Message: UniProt format autodetection was changed to follow the change of UniProtKB release 9.0 of 31-Oct-2006. Index: flatfile.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/flatfile.rb,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** flatfile.rb 8 Mar 2007 00:27:18 -0000 1.56 --- flatfile.rb 27 Mar 2007 09:26:03 -0000 1.57 *************** *** 1120,1125 **** embl = RuleRegexp[ 'Bio::EMBL', /^ID .+\; .*(DNA|RNA|XXX)\;/ ], ! sptr = RuleRegexp[ 'Bio::SPTR', ! /^ID .+\; *PRT\;/ ], prosite = RuleRegexp[ 'Bio::PROSITE', /^ID [-A-Za-z0-9_\.]+\; (PATTERN|RULE|MATRIX)\.$/ ], --- 1120,1126 ---- embl = RuleRegexp[ 'Bio::EMBL', /^ID .+\; .*(DNA|RNA|XXX)\;/ ], ! sptr = RuleRegexp2[ 'Bio::SPTR', ! /^ID .+\; *PRT\;/, ! /^ID [-A-Za-z0-9_\.]+ .+\; *[0-9]+ *AA\./ ], prosite = RuleRegexp[ 'Bio::PROSITE', /^ID [-A-Za-z0-9_\.]+\; (PATTERN|RULE|MATRIX)\.$/ ], From ngoto at dev.open-bio.org Tue Mar 27 12:29:34 2007 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Tue, 27 Mar 2007 16:29:34 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db/pdb pdb.rb,1.16,1.17 Message-ID: <200703271629.l2RGTYPY003750@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db/pdb In directory dev.open-bio.org:/tmp/cvs-serv3725 Modified Files: pdb.rb Log Message: Atom name of ATOM record output changed to be more precisely (Mailing list: [BioRuby] Bug in writing PDB ATOM). For the purpose, private method justify_atomname was added to Bio::PDB::Record::ATOM. Index: pdb.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb/pdb.rb,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** pdb.rb 27 Jun 2006 14:23:45 -0000 1.16 --- pdb.rb 27 Mar 2007 16:29:32 -0000 1.17 *************** *** 1011,1020 **** end ! def to_s atomname = self.name.to_s elem = self.element.to_s.strip ! if elem.length == 1 and atomname.lstrip[0, 1] == elem then ! atomname = ' ' + atomname end sprintf("%-6s%5d %-4s%-1s%3s %-1s%4d%-1s %8.3f%8.3f%8.3f%6.2f%6.2f %-4s%2s%-2s\n", self.record_name, --- 1011,1063 ---- end ! def justify_atomname atomname = self.name.to_s + return atomname[0, 4] if atomname.length >= 4 + case atomname.length + when 0 + return ' ' + when 1 + return ' ' + atomname + ' ' + when 2 + if /\A[0-9]/ =~ atomname then + return sprintf('%-4s', atomname) + elsif /[0-9]\z/ =~ atomname then + return sprintf(' %-3s', atomname) + end + when 3 + if /\A[0-9]/ =~ atomname then + return sprintf('%-4s', atomname) + end + end + # ambiguous case for two- or three-letter name elem = self.element.to_s.strip ! if elem.size > 0 and i = atomname.index(elem) then ! if i == 0 and elem.size == 1 then ! return sprintf(' %-3s', atomname) ! else ! return sprintf('%-4s', atomname) ! end ! end ! if self.class == HETATM then ! if /\A(B[^AEHIKR]|C[^ADEFLMORSU]|F[^EMR]|H[^EFGOS]|I[^NR]|K[^R]|N[^ABDEIOP]|O[^S]|P[^ABDMORTU]|S[^BCEGIMNR]|V|W|Y[^B])/ =~ ! atomname then ! return sprintf(' %-3s', atomname) ! else ! return sprintf('%-4s', atomname) ! end ! else # ATOM ! if /\A[CHONS]/ =~ atomname then ! return sprintf(' %-3s', atomname) ! else ! return sprintf('%-4s', atomname) ! end end + # could not be reached here + raise 'bug!' + end + private :justify_atomname + + def to_s + atomname = justify_atomname sprintf("%-6s%5d %-4s%-1s%3s %-1s%4d%-1s %8.3f%8.3f%8.3f%6.2f%6.2f %-4s%2s%-2s\n", self.record_name, From ngoto at dev.open-bio.org Tue Mar 27 12:37:35 2007 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Tue, 27 Mar 2007 16:37:35 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db/pdb pdb.rb,1.17,1.18 Message-ID: <200703271637.l2RGbZDO003823@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db/pdb In directory dev.open-bio.org:/tmp/cvs-serv3803 Modified Files: pdb.rb Log Message: fixed a bug: Bio::PDB::Record::***.new.inspect fails. Index: pdb.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb/pdb.rb,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** pdb.rb 27 Mar 2007 16:29:32 -0000 1.17 --- pdb.rb 27 Mar 2007 16:37:33 -0000 1.18 *************** *** 355,359 **** # def do_parse ! return self if @parsed str = @str each_symbol do |key, klass, ranges| --- 355,359 ---- # def do_parse ! return self if @parsed or !@str str = @str each_symbol do |key, klass, ranges| *************** *** 991,995 **** def do_parse ! return self if @parsed self.serial = @str[6..10].to_i self.name = @str[12..15].strip --- 991,995 ---- def do_parse ! return self if @parsed or !@str self.serial = @str[6..10].to_i self.name = @str[12..15].strip From k at dev.open-bio.org Wed Mar 28 05:11:05 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 28 Mar 2007 09:11:05 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io ncbisoap.rb, 1.1, 1.2 ebisoap.rb, 1.1, 1.2 ddbjxml.rb, 1.12, 1.13 Message-ID: <200703280911.l2S9B525005842@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv5838/lib/bio/io Modified Files: ncbisoap.rb ebisoap.rb ddbjxml.rb Log Message: * assign default wsdl to Bio::DDBJ::XML, Bio::EBI::SOAP, Bio::NCBI::SOAP Index: ddbjxml.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/ddbjxml.rb,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ddbjxml.rb 19 Sep 2006 05:44:41 -0000 1.12 --- ddbjxml.rb 28 Mar 2007 09:11:02 -0000 1.13 *************** *** 28,31 **** --- 28,34 ---- BASE_URI = "http://xml.nig.ac.jp/wsdl/" + # set default to GetEntry + SERVER_URI = BASE_URI + "GetEntry.wsdl" + def initialize(wsdl = nil) super(wsdl || self.class::SERVER_URI) Index: ncbisoap.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/ncbisoap.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ncbisoap.rb 19 Sep 2006 05:41:45 -0000 1.1 --- ncbisoap.rb 28 Mar 2007 09:11:02 -0000 1.2 *************** *** 68,71 **** --- 68,74 ---- BASE_URI = "http://www.ncbi.nlm.nih.gov/entrez/eutils/soap/" + # set default to EUtils + SERVER_URI = BASE_URI + "eutils.wsdl" + def initialize(wsdl = nil) super(wsdl || self.class::SERVER_URI) Index: ebisoap.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/ebisoap.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ebisoap.rb 19 Sep 2006 05:41:45 -0000 1.1 --- ebisoap.rb 28 Mar 2007 09:11:02 -0000 1.2 *************** *** 18,21 **** --- 18,24 ---- BASE_URI = "http://www.ebi.ac.uk/Tools/webservices/wsdl/" + # set default to Dbfetch + SERVER_URI = BASE_URI + "WSDbfetch.wsdl" + def initialize(wsdl = nil) super(wsdl || self.class::SERVER_URI) From k at dev.open-bio.org Wed Mar 28 05:21:47 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 28 Mar 2007 09:21:47 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates bioruby_controller.rb, 1.3, 1.4 bioruby.css, 1.3, 1.4 index.rhtml, 1.2, 1.3 Message-ID: <200703280921.l2S9LljA006037@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-serv6033 Modified Files: bioruby_controller.rb bioruby.css index.rhtml Log Message: * restrict evaluation access only from localhost for security purpose Index: index.rhtml =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/index.rhtml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** index.rhtml 16 Jan 2007 05:47:05 -0000 1.2 --- index.rhtml 28 Mar 2007 09:21:45 -0000 1.3 *************** *** 1,3 **** --- 1,6 ----
+ <%- if flash[:notice] -%> +

<%= flash[:notice] %>


+ <%- end -%> <%= form_remote_tag(:url => {:action => "evaluate"}, :position => "top") %> BioRuby script 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.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** bioruby_controller.rb 14 Mar 2007 19:50:14 -0000 1.3 --- bioruby_controller.rb 28 Mar 2007 09:21:45 -0000 1.4 *************** *** 20,37 **** ] def evaluate ! begin ! @script = params[:script].strip ! # write out to history ! Bio::Shell.store_history(@script) ! # evaluate ruby script ! @result = eval(@script, Bio::Shell.cache[:binding]) ! # *TODO* need to handle with output of print/puts/p/pp etc. here ! @output = nil ! rescue ! @result = $! @output = nil end --- 20,50 ---- ] + SECURITY_NOTICE = "For security purposes, this functionality is only available to local requests." + + def index + unless local_request? + flash[:notice] = SECURITY_NOTICE + end + end + def evaluate ! if local_request? ! begin ! @script = params[:script].strip ! # write out to history ! Bio::Shell.store_history(@script) ! # evaluate ruby script ! @result = eval(@script, Bio::Shell.cache[:binding]) ! # *TODO* need to handle with output of print/puts/p/pp etc. here ! @output = nil ! rescue ! @result = $! ! @output = nil ! end ! else ! @result = SECURITY_NOTICE @output = nil end Index: bioruby.css =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/bioruby.css,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** bioruby.css 8 Mar 2007 00:03:58 -0000 1.3 --- bioruby.css 28 Mar 2007 09:21:45 -0000 1.4 *************** *** 16,19 **** --- 16,28 ---- } + div#notice { + background-color: #fcc; + border: 1px solid #f00; + } + div#notice p { + margin: 0; + padding: 10px; + } + pre { color: #6e8377; *************** *** 194,199 **** --- 203,214 ---- /* table */ + table { + border: 1px solid #cccccc; + border-collapse: collapse; + } + table#list_methods { width: 680px; + border: none; } *************** *** 208,211 **** --- 223,227 ---- } + /* textarea */ *************** *** 214,219 **** --- 230,237 ---- font-size: 100%; overflow: auto; + width: 80%; } + /* blockquote */ From ngoto at dev.open-bio.org Wed Mar 28 06:25:19 2007 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Wed, 28 Mar 2007 10:25:19 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db/pdb pdb.rb,1.18,1.19 Message-ID: <200703281025.l2SAPJCx006357@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db/pdb In directory dev.open-bio.org:/tmp/cvs-serv6337/lib/bio/db/pdb Modified Files: pdb.rb Log Message: In justify_atomname, changed to determine HETATM, and P is added to the 1-letter atoms when ATOM. Index: pdb.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb/pdb.rb,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** pdb.rb 27 Mar 2007 16:37:33 -0000 1.18 --- pdb.rb 28 Mar 2007 10:25:17 -0000 1.19 *************** *** 1039,1043 **** end end ! if self.class == HETATM then if /\A(B[^AEHIKR]|C[^ADEFLMORSU]|F[^EMR]|H[^EFGOS]|I[^NR]|K[^R]|N[^ABDEIOP]|O[^S]|P[^ABDMORTU]|S[^BCEGIMNR]|V|W|Y[^B])/ =~ atomname then --- 1039,1043 ---- end end ! if self.kind_of?(HETATM) then if /\A(B[^AEHIKR]|C[^ADEFLMORSU]|F[^EMR]|H[^EFGOS]|I[^NR]|K[^R]|N[^ABDEIOP]|O[^S]|P[^ABDMORTU]|S[^BCEGIMNR]|V|W|Y[^B])/ =~ atomname then *************** *** 1047,1051 **** end else # ATOM ! if /\A[CHONS]/ =~ atomname then return sprintf(' %-3s', atomname) else --- 1047,1051 ---- end else # ATOM ! if /\A[CHONSP]/ =~ atomname then return sprintf(' %-3s', atomname) else From k at dev.open-bio.org Wed Mar 28 06:31:50 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 28 Mar 2007 10:31:50 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io ensembl.rb,1.3,1.4 Message-ID: <200703281031.l2SAVoLC006384@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv6378/lib/bio/io Modified Files: ensembl.rb Log Message: * modified to use Bio::Command.post_form * newly introduced Bio::Ensembl.new accepts organism and server url as its argument, so that user does not need to create subclass. * several bug fixed Index: ensembl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/ensembl.rb,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ensembl.rb 14 Jul 2006 14:28:44 -0000 1.3 --- ensembl.rb 28 Mar 2007 10:31:48 -0000 1.4 *************** *** 39,53 **** # == Examples # ! # seq = Bio::Ensembl::Human.exportview(1, 1000, 100000) ! # gff = Bio::Ensembl::Human.exportview(1, 1000, 100000, ['gene']) # ! # seq = Bio::Ensembl::Mouse.exportview(1, 1000, 100000) ! # gff = Bio::Ensembl::Mouse.exportview(1, 1000, 100000, ['gene', 'variation', 'genscan']) # ! # Bio::Enesmbl.server_uri("http://www.gramene.org") ! # class Rice < Base ! # Organism = 'Oryza_sativa' ! # end ! # seq = Bio::Ensembl::Rice.exportview(1, 1000, 100000) # # == References --- 39,52 ---- # == Examples # ! # human = Bio::Ensembl.new('Homo_sapiens') ! # seq = human.exportview(1, 1000, 100000) ! # gff = human.exportview(1, 1000, 100000, ['gene']) # ! # mouse = Bio::Ensembl.new('Mus_musculus') ! # seq = mouse.exportview(1, 1000, 100000) ! # gff = mouse.exportview(1, 1000, 100000, ['gene', 'variation', 'genscan']) # ! # rice = Bio::Enesmbl.new('Oryza_sativa', 'http://www.gramene.org') ! # seq = rice.exportview(1, 1000, 100000) # # == References *************** *** 61,258 **** class Ensembl ! # Hostname of the Ensembl Genome Browser. ! EBIServerURI = 'http://www.ensembl.org' ! # An Alternative Hostname for Ensembl Genome Browser. ! @@server_uri = nil ! # Sets and uses an alternative hostname for ensembl genome browser. ! # ! # == Example ! # ! # require 'bio' ! # p Bio::Enesmbl.server_uri #=> 'http://www.ensembl.org' ! # Bio::Enesmbl.server_uri("http://www.gramene.org") ! # p Bio::Enesmbl.server_uri #=> "http://www.gramene.org" ! # ! def self.server_uri(uri = nil) ! if uri ! @@server_uri = uri ! else ! @@server_uri || EBIServerURI ! end end ! # Ensembl Genome Browser Client Super Class # # == Examples - # - # module Bio - # class Ensembl::Kumamushi < Base - # Organism = 'Milnesium_tardigradum' - # end - # end - # fna = Bio::Ensembl::Kumamushi.exportview(1, 1000, 20000) # ! class Base ! ! # Ensembl ExportView Client. ! # ! # Retrieve genomic sequence/features from Ensembl ExportView in plain text. ! # Ensembl ExportView exports genomic data (sequence and features) in ! # several file formats including fasta, GFF and tab. ! # ! # * ExportViwe (http://www.ensembl.org/Homo_sapiens/exportview). ! # ! # == Examples ! # ! # # Genomic sequence in Fasta format ! # Bio::Ensembl::Human.exportview(:seq_region_name => 1, ! # :anchor1 => 1149206, :anchor2 => 1149229) ! # Bio::Ensembl::Human.exportview(1, 1149206, 1149229) ! # ! # # Feature in GFF ! # Bio::Ensembl::Human.exportview(:seq_region_name => 1, ! # :anchor1 => 1149206, :anchor2 => 1150000, ! # :options => ['similarity', 'repeat', ! # 'genscan', 'variation', ! # 'gene']) ! # Bio::Ensembl::Human.exportview(1, 1149206, 1150000, ! # ['variation', 'gene']) ! # ! # == Arguments ! # ! # Bio::Ensembl::Base#exportview method allow both orderd arguments and ! # named arguments. ! # Note: mandatory arguments marked '*'. ! # ! # === Orderd Arguments ! # ! # 1. seq_region_name - Chromosome number (*) ! # 2. anchor1 - From coordination (*) ! # 3. anchor2 - To coordination (*) ! # 4. options - Features to export (in :format => 'gff' or 'tab') ! # ['similarity', 'repeat', 'genscan', 'variation', ! # 'gene'] ! # ! # === Named Arguments ! # ! # * :seq_region_name - Chromosome number (*) ! # * :anchor1 - From coordination (*) ! # * :anchor2 - To coordination (*) ! # * :type1 - From coordination type ['bp', ] ! # * :type2 - To coordination type ['bp', ] ! # * :upstream - Bp upstream ! # * :downstream - Bp downstream ! # * :format - File format ['fasta', 'gff', 'tab'] ! # * :options - Features to export (for :format => 'gff' or 'tab') ! # ['similarity', 'repeat', 'genscan', 'variation', ! # 'gene'] ! # ! def self.exportview(*args) ! if args.first.class == Hash then opts = args.first ! else ! options = {:seq_region_name => args[0], ! :anchor1 => args[1], ! :anchor2 => args[2]} ! case args.size ! when 3 then ! options.update({:format => 'fasta'}) ! when 4 then ! options.update({:format => 'gff', :options => args[3]}) ! end end - - @data = {:type1 => 'bp', - :type2 => 'bp', - :downstream => '', - :upstream => '', - :format => 'fasta', - :options => [], - :action => 'export', - :_format => 'Text', - :output => 'txt', - :submit => 'Continue >>'} - - cgi = Client.new('exportview', self::Organism) - cgi.exec(@data.update(options)) end ! ! # An Ensembl CGI client class ! # ! # Enable the use of HTTP access via a proxy by setting the proxy address up ! # as the 'http_proxy' enviroment variable. ! # ! # === Examples ! # ! # cgi = Client.new('martview', 'Homo_sapiens') ! # result_body = cgi.exec(hash_data) ! # ! class Client ! ! # Sets cgi_name and genome_name. ! # ! # === Example ! # ! # cgi = Client.new('martview', 'Homo_sapiens') ! # ! def initialize(cgi_name, genome_name) ! @uri = URI.parse(Ensembl.server_uri) ! @path = ['', genome_name, cgi_name].join('/') ! end ! ! # Executes query with data. ! # ! # === Example ! # ! # result_body = cgi.exec(hash_data) ! # ! def exec(data_hash) ! data = make_args(data_hash) ! ! result = nil ! Bio::Command.start_http(@uri.host, @uri.port) {|http| ! result, = http.post(@path, data) ! } ! result.body ! end ! ! private ! ! def make_args(hash) ! tmp = [] ! hash.each do |key, value| ! if value.class == Array then ! value.each { |val| tmp << [key, val] } ! else ! tmp << [key, value] ! end ! end ! tmp.map {|e| e.map {|x| CGI.escape(x.to_s) }.join("=") }.join('&') ! end ! ! end # class Client ! ! end # class Base ! ! ! # Ensembl Human Genome ! # ! # See Bio::Ensembl::Base class. ! # ! class Human < Base ! Organism = 'Homo_sapiens' ! end # class Human ! ! # Ensembl Mouse Genome ! # ! # See Bio::Ensembl::Base class. ! # ! class Mouse < Base ! Organism = 'Mus_musculus' ! end # class Mouse end # class Ensembl --- 60,167 ---- class Ensembl ! ENSEMBL_URL = 'http://www.ensembl.org' ! def initialize(organism, server = nil) ! @server = server || ENSEMBL_URL ! @organism = organism ! @uri = [ server.chomp('/'), @organism ].join('/') ! end ! def self.human ! self.new("Homo_sapiens") end + def self.mouse + self.new("Mus_musculus") + end ! # Ensembl ExportView Client. ! # ! # Retrieve genomic sequence/features from Ensembl ExportView in plain text. ! # Ensembl ExportView exports genomic data (sequence and features) in ! # several file formats including fasta, GFF and tab. ! # ! # * ExportViwe (http://www.ensembl.org/Homo_sapiens/exportview). # # == Examples # ! # human = Bio::Ensembl.new('Homo_sapiens') ! # or ! # human = Bio::Ensembl.human ! # ! # # Genomic sequence in Fasta format ! # human.exportview(:seq_region_name => 1, ! # :anchor1 => 1149206, :anchor2 => 1149229) ! # human.exportview(1, 1149206, 1149229) ! # ! # # Feature in GFF ! # human.exportview(:seq_region_name => 1, ! # :anchor1 => 1149206, :anchor2 => 1150000, ! # :options => ['similarity', 'repeat', ! # 'genscan', 'variation', 'gene']) ! # human.exportview(1, 1149206, 1150000, ['variation', 'gene']) ! # ! # == Arguments ! # ! # Bio::Ensembl#exportview method allow both orderd arguments and ! # named arguments. (Note: mandatory arguments are marked by '*'). ! # ! # === Orderd Arguments ! # ! # 1. seq_region_name - Chromosome number (*) ! # 2. anchor1 - From coordination (*) ! # 3. anchor2 - To coordination (*) ! # 4. options - Features to export (in :format => 'gff' or 'tab') ! # ['similarity', 'repeat', 'genscan', 'variation', ! # 'gene'] ! # ! # === Named Arguments ! # ! # * :seq_region_name - Chromosome number (*) ! # * :anchor1 - From coordination (*) ! # * :anchor2 - To coordination (*) ! # * :type1 - From coordination type ['bp', ] ! # * :type2 - To coordination type ['bp', ] ! # * :upstream - Bp upstream ! # * :downstream - Bp downstream ! # * :format - File format ['fasta', 'gff', 'tab'] ! # * :options - Features to export (for :format => 'gff' or 'tab') ! # ['similarity', 'repeat', 'genscan', 'variation', ! # 'gene'] ! # ! def exportview(*args) ! if args.first.class == Hash ! options = args.first ! else ! options = { ! :seq_region_name => args[0], ! :anchor1 => args[1], ! :anchor2 => args[2], ! } ! case args.size ! when 3 then ! options.update({:format => 'fasta'}) ! when 4 then ! options.update({:format => 'gff', :options => args[3]}) end end + + defaults = { + :type1 => 'bp', + :type2 => 'bp', + :downstream => '', + :upstream => '', + :format => 'fasta', + :options => [], + :action => 'export', + :_format => 'Text', + :output => 'txt', + :submit => 'Continue >>' + } + params = defaults.update(options) ! Bio::Command.post_form("#{@uri}/exportview", params) ! end end # class Ensembl From nakao at dev.open-bio.org Wed Mar 28 07:21:22 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Wed, 28 Mar 2007 11:21:22 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio/io test_ddbjxml.rb,1.2,1.3 Message-ID: <200703281121.l2SBLMSC006618@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio/io In directory dev.open-bio.org:/tmp/cvs-serv6598/test/unit/bio/io Modified Files: test_ddbjxml.rb Log Message: * Fixed test_constants. Index: test_ddbjxml.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/unit/bio/io/test_ddbjxml.rb,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_ddbjxml.rb 24 Dec 2006 17:19:05 -0000 1.2 --- test_ddbjxml.rb 28 Mar 2007 11:21:20 -0000 1.3 *************** *** 21,25 **** def test_constants ! constants = ["DDBJ", "TxSearch", "ClustalW", "PML", "Gib", "Fasta", "BASE_URI", "SRS", "Gtop", "GetEntry", "Blast"].sort assert_equal(constants, Bio::DDBJ::XML.constants.sort) end --- 21,26 ---- def test_constants ! constants = ["DDBJ", "TxSearch", "ClustalW", "PML", "Gib", "Fasta", ! "BASE_URI", "SRS", "SERVER_URI", "Gtop", "GetEntry", "Blast"].sort assert_equal(constants, Bio::DDBJ::XML.constants.sort) end From nakao at dev.open-bio.org Wed Mar 28 08:01:02 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Wed, 28 Mar 2007 12:01:02 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio/io test_ensembl.rb,1.2,1.3 Message-ID: <200703281201.l2SC12lE006750@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio/io In directory dev.open-bio.org:/tmp/cvs-serv6728/test/unit/bio/io Modified Files: test_ensembl.rb Log Message: * Added TestEnsembl_v14 class. Index: test_ensembl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/unit/bio/io/test_ensembl.rb,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_ensembl.rb 27 Apr 2006 05:38:50 -0000 1.2 --- test_ensembl.rb 28 Mar 2007 12:01:00 -0000 1.3 *************** *** 2,6 **** # = test/unit/bio/io/test_ensembl.rb - Unit test for Bio::Ensembl. # ! # Copyright:: Copyright (C) 2006 # Mitsuteru C. Nakao # License:: Ruby's --- 2,6 ---- # = test/unit/bio/io/test_ensembl.rb - Unit test for Bio::Ensembl. # ! # Copyright:: Copyright (C) 2006, 2007 # Mitsuteru C. Nakao # License:: Ruby's *************** *** 16,19 **** --- 16,49 ---- require 'bio/io/ensembl' + # tests for ensembl.rb,v 1.4 + class TestEnsembl_v14 < Test::Unit::TestCase + def test_ensembl_url + assert_equal('http://www.ensembl.org', Bio::Ensembl::ENSEMBL_URL) + end + + def test_server + obj = Bio::Ensembl.new('Homo_sapiens') + assert_equal('http://www.ensembl.org', obj.server) + end + + def test_organism + organism = 'Homo_sapiens' + obj = Bio::Ensembl.new(organism) + assert_equal(organism, obj.organism) + end + + def test_self_human + organism = 'Homo_sapiens' + obj = Bio::Ensembl.human + assert_equal(organism, obj.organism) + end + + def test_self_mouse + organism = 'Mus_musculus' + obj = Bio::Ensembl.mouse + assert_equal(organism, obj.organism) + end + end + class TestEnsembl < Test::Unit::TestCase *************** *** 33,36 **** --- 63,67 ---- end + class TestEnsemblBase < Test::Unit::TestCase def test_exportview From nakao at dev.open-bio.org Wed Mar 28 08:01:50 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Wed, 28 Mar 2007 12:01:50 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io ensembl.rb,1.4,1.5 Message-ID: <200703281201.l2SC1oSe006778@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv6758/lib/bio/io Modified Files: ensembl.rb Log Message: * Fixed a bug (server.chomp('/') -> @server.chump('/')). Index: ensembl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/ensembl.rb,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ensembl.rb 28 Mar 2007 10:31:48 -0000 1.4 --- ensembl.rb 28 Mar 2007 12:01:48 -0000 1.5 *************** *** 14,22 **** # == Examples # ! # seq = Bio::Ensembl::Human.exportview(1, 1000, 100000) ! # gff = Bio::Ensembl::Human.exportview(1, 1000, 100000, ['gene']) # ! # seq = Bio::Ensembl::Mouse.exportview(1, 1000, 100000) ! # gff = Bio::Ensembl::Mouse.exportview(1, 1000, 100000, ['gene', 'variation', 'genscan']) # # --- 14,22 ---- # == Examples # ! # seq = Bio::Ensembl.human.exportview(1, 1000, 100000) ! # gff = Bio::Ensembl.human.exportview(1, 1000, 100000, ['gene']) # ! # seq = Bio::Ensembl.mouse.exportview(1, 1000, 100000) ! # gff = Bio::Ensembl.mouse.exportview(1, 1000, 100000, ['gene', 'variation', 'genscan']) # # *************** *** 59,69 **** # class Ensembl ! ENSEMBL_URL = 'http://www.ensembl.org' def initialize(organism, server = nil) @server = server || ENSEMBL_URL @organism = organism ! @uri = [ server.chomp('/'), @organism ].join('/') end --- 59,73 ---- # class Ensembl ! ENSEMBL_URL = 'http://www.ensembl.org' + attr_reader :server + + attr_reader :organism + def initialize(organism, server = nil) @server = server || ENSEMBL_URL @organism = organism ! @uri = [ @server.chomp('/'), @organism ].join('/') end From nakao at dev.open-bio.org Wed Mar 28 08:24:32 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Wed, 28 Mar 2007 12:24:32 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio/io test_ensembl.rb,1.3,1.4 Message-ID: <200703281224.l2SCOWRQ006910@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio/io In directory dev.open-bio.org:/tmp/cvs-serv6890/test/unit/bio/io Modified Files: test_ensembl.rb Log Message: Index: test_ensembl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/unit/bio/io/test_ensembl.rb,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_ensembl.rb 28 Mar 2007 12:01:00 -0000 1.3 --- test_ensembl.rb 28 Mar 2007 12:24:30 -0000 1.4 *************** *** 44,47 **** --- 44,55 ---- assert_equal(organism, obj.organism) end + + def test_new_with_2_args + organism = 'Oryza_sativa' + server_url = 'http://www.gramene.org' + obj = Bio::Ensembl.new(organism, server_url) + assert_equal(organism, obj.organism) + assert_equal(server_url, obj.server) + end end From k at dev.open-bio.org Wed Mar 28 08:31:05 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 28 Mar 2007 12:31:05 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio command.rb,1.13,1.14 Message-ID: <200703281231.l2SCV5eq006956@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio In directory dev.open-bio.org:/tmp/cvs-serv6952 Modified Files: command.rb Log Message: * keys and parameters of params are forced to to_s * post_form is modified to accept url in string Index: command.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/command.rb,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** command.rb 26 Mar 2007 17:09:45 -0000 1.13 --- command.rb 28 Mar 2007 12:31:03 -0000 1.14 *************** *** 273,278 **** # def post_form(uri, params, header = {}) data = params.map do |key, val| ! "#{URI.escape(key)}=#{URI.escape(val)}" end.join('&') h = { --- 273,281 ---- # def post_form(uri, params, header = {}) + unless uri.is_a?(URI) + uri = URI.parse(uri) + end data = params.map do |key, val| ! "#{URI.escape(key.to_s)}=#{URI.escape(val.to_s)}" end.join('&') h = { From k at dev.open-bio.org Wed Mar 28 08:31:50 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 28 Mar 2007 12:31:50 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io ensembl.rb,1.5,1.6 Message-ID: <200703281231.l2SCVoVZ006983@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv6977/io Modified Files: ensembl.rb Log Message: * exportview is fixed to extract body from Net::HTTP response Index: ensembl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/ensembl.rb,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ensembl.rb 28 Mar 2007 12:01:48 -0000 1.5 --- ensembl.rb 28 Mar 2007 12:31:48 -0000 1.6 *************** *** 14,22 **** # == Examples # ! # seq = Bio::Ensembl.human.exportview(1, 1000, 100000) ! # gff = Bio::Ensembl.human.exportview(1, 1000, 100000, ['gene']) # ! # seq = Bio::Ensembl.mouse.exportview(1, 1000, 100000) ! # gff = Bio::Ensembl.mouse.exportview(1, 1000, 100000, ['gene', 'variation', 'genscan']) # # --- 14,27 ---- # == Examples # ! # human = Bio::Ensembl.new('Homo_sapiens') ! # seq = human.exportview(1, 1000, 100000) ! # gff = human.exportview(1, 1000, 100000, ['gene', 'variation', 'genscan']) # ! # human = Bio::Ensembl.human ! # seq = human.exportview(1, 1000, 100000) ! # gff = human.exportview(1, 1000, 100000, ['gene']) ! # ! # seq = Bio::Ensembl.human.exportview(1, 1000, 100000) ! # gff = Bio::Ensembl.human.exportview(1, 1000, 100000, ['gene', 'variation', 'genscan']) # # *************** *** 28,33 **** require 'bio/command' - require 'uri' - require 'cgi' module Bio --- 33,36 ---- *************** *** 166,170 **** params = defaults.update(options) ! Bio::Command.post_form("#{@uri}/exportview", params) end --- 169,175 ---- params = defaults.update(options) ! result, = Bio::Command.post_form("#{@uri}/exportview", params) ! ! return result.body end From k at dev.open-bio.org Wed Mar 28 12:51:39 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 28 Mar 2007 16:51:39 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io das.rb,1.13,1.14 Message-ID: <200703281651.l2SGpdcT007692@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv7688/io Modified Files: das.rb Log Message: * modified to use Bio::Command Index: das.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/das.rb,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** das.rb 25 Jul 2006 19:46:43 -0000 1.13 --- das.rb 28 Mar 2007 16:51:37 -0000 1.14 *************** *** 2,6 **** # = bio/io/das.rb - BioDAS access module # ! # Copyright:: Copyright (C) 2003, 2004 # Shuichi Kawashima , # Toshiaki Katayama --- 2,6 ---- # = bio/io/das.rb - BioDAS access module # ! # Copyright:: Copyright (C) 2003, 2004, 2007 # Shuichi Kawashima , # Toshiaki Katayama *************** *** 21,26 **** rescue LoadError end ! require 'uri' ! require 'net/http' require 'bio/sequence' --- 21,25 ---- rescue LoadError end ! require 'bio/command' require 'bio/sequence' *************** *** 32,38 **** # Specify DAS server to connect def initialize(url = 'http://www.wormbase.org:80/db/') ! schema, user, host, port, reg, path, = URI.split(url) ! @server = Net::HTTP.new(host, port) ! @prefix = path ? path.chomp('/') : '' end --- 31,35 ---- # Specify DAS server to connect def initialize(url = 'http://www.wormbase.org:80/db/') ! @server = url.chomp('/') end *************** *** 40,44 **** def get_dsn ary = [] ! result, = @server.get(@prefix + '/das/dsn') doc = REXML::Document.new(result.body) doc.elements.each('/descendant::DSN') do |e| --- 37,41 ---- def get_dsn ary = [] ! result, = Bio::Command.post_form("#{@server}/das/dsn") doc = REXML::Document.new(result.body) doc.elements.each('/descendant::DSN') do |e| *************** *** 71,75 **** src = dsn end ! result, = @server.get(@prefix + '/das/' + src + '/entry_points') doc = REXML::Document.new(result.body) doc.elements.each('/descendant::ENTRY_POINTS') do |e| --- 68,72 ---- src = dsn end ! result, = Bio::Command.post_form("#{@server}/das/#{src}/entry_points") doc = REXML::Document.new(result.body) doc.elements.each('/descendant::ENTRY_POINTS') do |e| *************** *** 80,84 **** segment.entry_id = e.attributes['id'] segment.start = e.attributes['start'] ! segment.stop = e.attributes['stop'] segment.orientation = e.attributes['orientation'] segment.subparts = e.attributes['subparts'] --- 77,81 ---- segment.entry_id = e.attributes['id'] segment.start = e.attributes['start'] ! segment.stop = e.attributes['stop'] || e.attributes['size'] segment.orientation = e.attributes['orientation'] segment.subparts = e.attributes['subparts'] *************** *** 104,110 **** opts << "segment=#{s.entry_id}:#{s.start},#{s.stop}" end - query = opts.join(';') ! result, = @server.get(@prefix + '/das/' + dsn + '/dna?' + query) doc = REXML::Document.new(result.body) doc.elements.each('/descendant::SEQUENCE') do |e| --- 101,106 ---- opts << "segment=#{s.entry_id}:#{s.start},#{s.stop}" end ! result, = Bio::Command.post_form("#{@server}/das/#{dsn}/dna", opts) doc = REXML::Document.new(result.body) doc.elements.each('/descendant::SEQUENCE') do |e| *************** *** 137,143 **** opts << "segment=#{s.entry_id}:#{s.start},#{s.stop}" end - query = opts.join(';') ! result, = @server.get(@prefix + '/das/' + dsn + '/sequence?' + query) doc = REXML::Document.new(result.body) doc.elements.each('/descendant::SEQUENCE') do |e| --- 133,138 ---- opts << "segment=#{s.entry_id}:#{s.start},#{s.stop}" end ! result, = Bio::Command.post_form("#{@server}/das/#{dsn}/sequence", opts) doc = REXML::Document.new(result.body) doc.elements.each('/descendant::SEQUENCE') do |e| *************** *** 175,181 **** opts << "segment=#{s.entry_id}:#{s.start},#{s.stop}" end - query = opts.join(';') ! result, = @server.get(@prefix + '/das/' + dsn + '/types?' + query) doc = REXML::Document.new(result.body) doc.elements.each('/descendant::GFF') do |e| --- 170,175 ---- opts << "segment=#{s.entry_id}:#{s.start},#{s.stop}" end ! result, = Bio::Command.post_form("#{@server}/das/#{dsn}/types", opts) doc = REXML::Document.new(result.body) doc.elements.each('/descendant::GFF') do |e| *************** *** 227,233 **** opts << "group_id=#{gid}" end - query = opts.join(';') ! result, = @server.get(@prefix + '/das/' + dsn + '/features?' + query) doc = REXML::Document.new(result.body) doc.elements.each('/descendant::GFF') do |e| --- 221,226 ---- opts << "group_id=#{gid}" end ! result, = Bio::Command.post_form("#{@server}/das/#{dsn}/features", opts) doc = REXML::Document.new(result.body) doc.elements.each('/descendant::GFF') do |e| *************** *** 446,450 **** org_list.each do |org| print "#{org} : " ! list = kegg_das.get_entry_point(org) list.segments.each do |seg| print " #{seg.entry_id}" --- 439,443 ---- org_list.each do |org| print "#{org} : " ! list = kegg_das.get_entry_points(org) list.segments.each do |seg| print " #{seg.entry_id}" From k at dev.open-bio.org Wed Mar 28 12:52:22 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 28 Mar 2007 16:52:22 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/shell/plugin das.rb,NONE,1.1 Message-ID: <200703281652.l2SGqMqW007735@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/shell/plugin In directory dev.open-bio.org:/tmp/cvs-serv7731/shell/plugin Added Files: das.rb Log Message: * newly added BioDAS client plugin --- NEW FILE: das.rb --- # # = bio/shell/plugin/keggdas.rb - plugin for KEGG DAS # # Copyright:: Copyright (C) 2006 # Toshiaki Katayama # License:: Ruby's # # $Id: das.rb,v 1.1 2007/03/28 16:52:20 k Exp $ # module Bio class DAS def list(serv = nil) result = "" self.get_dsn.each do |dsn| src = dsn.source_id self.get_entry_points(src).each do |ep| data = [src, ep.entry_id, ep.start.to_i, ep.stop.to_i, "# #{ep.description}"].join("\t") + "\n" puts data result += data end end return result end def dna(dsn, entry_point, start, stop) seg = Bio::DAS::SEGMENT.region(entry_point, start, stop) self.get_dna(dsn, seg).first.sequence end def features(dsn, entry_point, start, stop) seg = Bio::DAS::SEGMENT.region(entry_point, start, stop) self.get_features(dsn, seg) end end end module Bio::Shell private # http://www.biodas.org/ # http://www.dasregistry.org/ def das(url = nil) if url @das = Bio::DAS.new(url) else @das ||= keggdas end end def keggdas(url = "http://das.hgc.jp/cgi-bin/") das(url) end def ensembl(url = "http://das.ensembl.org/") das(url) end def wormbase(url = "http://www.wormbase.org/db/") das(url) end end From k at dev.open-bio.org Wed Mar 28 12:54:13 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 28 Mar 2007 16:54:13 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio command.rb,1.14,1.15 Message-ID: <200703281654.l2SGsDIj007778@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio In directory dev.open-bio.org:/tmp/cvs-serv7774 Modified Files: command.rb Log Message: * post_form method is extended to accept params as array of string, array of hash, array of array, or string in addition to hash. * params option can be ommited if not needed (defaults to nil) Index: command.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/command.rb,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** command.rb 28 Mar 2007 12:31:03 -0000 1.14 --- command.rb 28 Mar 2007 16:54:11 -0000 1.15 *************** *** 272,289 **** # +header+ must be a hash. # ! def post_form(uri, params, header = {}) unless uri.is_a?(URI) uri = URI.parse(uri) end ! data = params.map do |key, val| ! "#{URI.escape(key.to_s)}=#{URI.escape(val.to_s)}" ! end.join('&') ! h = { 'Content-Type' => 'application/x-www-form-urlencoded', 'Content-Length' => data.length.to_s } ! h.update(header) start_http(uri.host, uri.port) do |http| ! http.post(uri.path, data, h) end end --- 272,310 ---- # +header+ must be a hash. # ! def post_form(uri, params = nil, header = {}) unless uri.is_a?(URI) uri = URI.parse(uri) end ! ! data = "" ! ! case params ! when Hash ! data = params.map do |key, val| ! "#{URI.escape(key.to_s)}=#{URI.escape(val.to_s)}" ! end.join('&') ! when Array ! case params.first ! when Hash, Array ! data = params.map do |key, val| ! "#{URI.escape(key.to_s)}=#{URI.escape(val.to_s)}" ! end.join('&') ! when String ! data = params.map do |str| ! URI.escape(str.strip) ! end.join('&') ! end ! when String ! data = URI.escape(params.strip) ! end ! ! hash = { 'Content-Type' => 'application/x-www-form-urlencoded', 'Content-Length' => data.length.to_s } ! hash.update(header) ! start_http(uri.host, uri.port) do |http| ! http.post(uri.path, data, hash) end end From trevor at dev.open-bio.org Wed Mar 28 15:45:29 2007 From: trevor at dev.open-bio.org (Trevor Wennblom) Date: Wed, 28 Mar 2007 19:45:29 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio/util/restriction_enzyme test_analysis.rb, 1.8, 1.9 Message-ID: <200703281945.l2SJjTko008166@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio/util/restriction_enzyme In directory dev.open-bio.org:/tmp/cvs-serv8138/test/unit/bio/util/restriction_enzyme Modified Files: test_analysis.rb Log Message: Bugfix Index: test_analysis.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/unit/bio/util/restriction_enzyme/test_analysis.rb,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** test_analysis.rb 5 Jan 2007 06:11:39 -0000 1.8 --- test_analysis.rb 28 Mar 2007 19:45:27 -0000 1.9 *************** *** 137,145 **** assert_equal(["ag", "cag"], Bio::Sequence::NA.new('cagagag').cut_with_enzymes('ag^ag', 'EcoRII').primary ) ! # NOTE: investigate where the '' is coming from ! assert_equal(["", "ag", "ag", "cag", "ccagg"], Bio::Sequence::NA.new('cagagagccagg').cut_with_enzymes('ag^ag', 'EcoRII').primary ) end end ! end --- 137,172 ---- assert_equal(["ag", "cag"], Bio::Sequence::NA.new('cagagag').cut_with_enzymes('ag^ag', 'EcoRII').primary ) ! # Note how EcoRII needs extra padding on the beginning and ending of the ! # sequence 'ccagg' to make the match since the cut must occur between ! # two nucleotides and can not occur on the very end of the sequence. ! # ! # EcoRII: ! # :blunt: "0" ! # :c2: "5" ! # :c4: "0" ! # :c1: "-1" ! # :pattern: CCWGG ! # :len: "5" ! # :name: EcoRII ! # :c3: "0" ! # :ncuts: "2" ! # ! # -1 1 2 3 4 5 ! # 5' - n^c c w g g n - 3' ! # 3' - n g g w c c^n - 5' ! # ! # (w == [at]) ! ! assert_equal(["ag", "agccagg", "cag"], Bio::Sequence::NA.new('cagagagccagg').cut_with_enzymes('ag^ag', 'EcoRII').primary ) ! assert_equal(["ag", "agccagg", "cag"], Bio::Sequence::NA.new('cagagagccagg').cut_with_enzymes('ag^ag').primary ) ! assert_equal([], Bio::Sequence::NA.new('cagagagccagg').cut_with_enzymes('EcoRII').primary ) ! ! assert_equal(["ag", "ag", "cag", "ccaggt"], Bio::Sequence::NA.new('cagagagccaggt').cut_with_enzymes('ag^ag', 'EcoRII').primary ) ! assert_equal(["ag", "agccaggt", "cag"], Bio::Sequence::NA.new('cagagagccaggt').cut_with_enzymes('ag^ag').primary ) ! assert_equal(["cagagag", "ccaggt"], Bio::Sequence::NA.new('cagagagccaggt').cut_with_enzymes('EcoRII').primary ) ! assert_equal(["a", "gtctctcggtcc"], Bio::Sequence::NA.new('cagagagccaggt').cut_with_enzymes('EcoRII').complement ) end end ! end \ No newline at end of file From trevor at dev.open-bio.org Wed Mar 28 15:45:29 2007 From: trevor at dev.open-bio.org (Trevor Wennblom) Date: Wed, 28 Mar 2007 19:45:29 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/util/restriction_enzyme analysis_basic.rb, 1.8, 1.9 double_stranded.rb, 1.7, 1.8 Message-ID: <200703281945.l2SJjTB4008160@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme In directory dev.open-bio.org:/tmp/cvs-serv8138/lib/bio/util/restriction_enzyme Modified Files: analysis_basic.rb double_stranded.rb Log Message: Bugfix Index: analysis_basic.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/analysis_basic.rb,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** analysis_basic.rb 5 Jan 2007 06:33:01 -0000 1.8 --- analysis_basic.rb 28 Mar 2007 19:45:27 -0000 1.9 *************** *** 151,155 **** enzyme = Bio::RestrictionEnzyme.new(enzyme) unless enzyme.class == Bio::RestrictionEnzyme::DoubleStranded ! find_match_locations( sequence, enzyme.primary.to_re ).each do |offset| all_enzyme_actions << enzyme.create_action_at( offset ) end --- 151,164 ---- enzyme = Bio::RestrictionEnzyme.new(enzyme) unless enzyme.class == Bio::RestrictionEnzyme::DoubleStranded ! # make sure pattern is the proper size ! # for more info see the internal documentation of ! # Bio::RestrictionEnzyme::DoubleStranded.create_action_at ! pattern = Bio::Sequence::NA.new( ! Bio::RestrictionEnzyme::DoubleStranded::AlignedStrands.align( ! enzyme.primary, enzyme.complement ! ).primary ! ).to_re ! ! find_match_locations( sequence, pattern ).each do |offset| all_enzyme_actions << enzyme.create_action_at( offset ) end *************** *** 185,193 **** all_enzyme_actions[0..-2].each_with_index do |current_enzyme_action, i| next if competition_indexes.include? i all_enzyme_actions[i+1..-1].each_with_index do |comparison_enzyme_action, j| j += (i + 1) next if competition_indexes.include? j ! if (current_enzyme_action.right <= comparison_enzyme_action.cut_ranges.min_vertical) or (current_enzyme_action.left > comparison_enzyme_action.cut_ranges.max_vertical) --- 194,204 ---- all_enzyme_actions[0..-2].each_with_index do |current_enzyme_action, i| next if competition_indexes.include? i + next if current_enzyme_action.cut_ranges.empty? # no cuts, some enzymes are like this (ex. CjuI) all_enzyme_actions[i+1..-1].each_with_index do |comparison_enzyme_action, j| j += (i + 1) next if competition_indexes.include? j ! next if comparison_enzyme_action.cut_ranges.empty? # no cuts ! if (current_enzyme_action.right <= comparison_enzyme_action.cut_ranges.min_vertical) or (current_enzyme_action.left > comparison_enzyme_action.cut_ranges.max_vertical) Index: double_stranded.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/double_stranded.rb,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** double_stranded.rb 5 Jan 2007 06:33:01 -0000 1.7 --- double_stranded.rb 28 Mar 2007 19:45:27 -0000 1.8 *************** *** 171,179 **** # +offset+:: Numerical offset of where the enzyme action occurs on the seqeunce def create_action_at( offset ) ! #def enzyme_to_enzyme_action( restriction_enzyme, offset ) ! enzyme_action = EnzymeAction.new( offset, ! offset + @primary.size-1, ! offset, ! offset + @complement.size-1) @cut_locations.each do |cut_location_pair| --- 171,205 ---- # +offset+:: Numerical offset of where the enzyme action occurs on the seqeunce def create_action_at( offset ) ! # x is the size of the fully aligned sequence with maximum padding needed ! # to make a match on the primary and complement strand. ! # ! # For example - ! # Note how EcoRII needs extra padding on the beginning and ending of the ! # sequence 'ccagg' to make the match since the cut must occur between ! # two nucleotides and can not occur on the very end of the sequence. ! # ! # EcoRII: ! # :blunt: "0" ! # :c2: "5" ! # :c4: "0" ! # :c1: "-1" ! # :pattern: CCWGG ! # :len: "5" ! # :name: EcoRII ! # :c3: "0" ! # :ncuts: "2" ! # ! # -1 1 2 3 4 5 ! # 5' - n^c c w g g n - 3' ! # 3' - n g g w c c^n - 5' ! # ! # (w == [at]) ! ! x = aligned_strands.primary.size ! ! enzyme_action = EnzymeAction.new( offset, ! offset + x-1, ! offset, ! offset + x-1) @cut_locations.each do |cut_location_pair| From k at dev.open-bio.org Wed Mar 28 15:50:30 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 28 Mar 2007 19:50:30 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/shell/plugin das.rb,1.1,1.2 Message-ID: <200703281950.l2SJoUKm008245@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/shell/plugin In directory dev.open-bio.org:/tmp/cvs-serv8241/shell/plugin Modified Files: das.rb Log Message: * das.list method is renamed to das.list_sequences in plugin/das.rb * dna and features methods are moved to Bio::DAS module in io/das.rb from plugin/das.rb Index: das.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/plugin/das.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** das.rb 28 Mar 2007 16:52:20 -0000 1.1 --- das.rb 28 Mar 2007 19:50:28 -0000 1.2 *************** *** 12,16 **** class DAS ! def list(serv = nil) result = "" self.get_dsn.each do |dsn| --- 12,16 ---- class DAS ! def list_sequences result = "" self.get_dsn.each do |dsn| *************** *** 24,37 **** return result end - - def dna(dsn, entry_point, start, stop) - seg = Bio::DAS::SEGMENT.region(entry_point, start, stop) - self.get_dna(dsn, seg).first.sequence - end - - def features(dsn, entry_point, start, stop) - seg = Bio::DAS::SEGMENT.region(entry_point, start, stop) - self.get_features(dsn, seg) - end end --- 24,27 ---- From k at dev.open-bio.org Wed Mar 28 15:51:26 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 28 Mar 2007 19:51:26 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io das.rb,1.14,1.15 Message-ID: <200703281951.l2SJpQ8Z008288@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv8284/io Modified Files: das.rb Log Message: * dna, features methods are added for the convenience Index: das.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/das.rb,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** das.rb 28 Mar 2007 16:51:37 -0000 1.14 --- das.rb 28 Mar 2007 19:51:24 -0000 1.15 *************** *** 34,37 **** --- 34,48 ---- end + def dna(dsn, entry_point, start, stop) + seg = Bio::DAS::SEGMENT.region(entry_point, start, stop) + self.get_dna(dsn, seg).first.sequence + end + + def features(dsn, entry_point, start, stop) + seg = Bio::DAS::SEGMENT.region(entry_point, start, stop) + self.get_features(dsn, seg) + end + + # Returns an Array of Bio::DAS::DSN def get_dsn From k at dev.open-bio.org Wed Mar 28 16:14:16 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 28 Mar 2007 20:14:16 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/shell core.rb,1.22,1.23 Message-ID: <200703282014.l2SKEGBP008447@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/shell In directory dev.open-bio.org:/tmp/cvs-serv8443/shell Modified Files: core.rb Log Message: * changed to print messages to STDERR Index: core.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/core.rb,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** core.rb 24 Dec 2006 08:36:00 -0000 1.22 --- core.rb 28 Mar 2007 20:14:14 -0000 1.23 *************** *** 58,62 **** def ask_yes_or_no(message) loop do ! print "#{message}" answer = gets if answer.nil? --- 58,62 ---- def ask_yes_or_no(message) loop do ! STDERR.print "#{message}" answer = gets if answer.nil? *************** *** 98,109 **** def load_session load_object ! load_history ! opening_splash ! open_history end def save_session ! close_history ! closing_splash if create_save_dir_ask #save_history # changed to use our own... --- 98,113 ---- def load_session load_object ! unless @cache[:mode] == :script ! load_history ! opening_splash ! open_history ! end end def save_session ! unless @cache[:mode] == :script ! close_history ! closing_splash ! end if create_save_dir_ask #save_history # changed to use our own... *************** *** 111,116 **** save_config end ! puts "Leaving directory '#{@cache[:workdir]}'" ! puts "History is saved in '#{@cache[:workdir]}/#{SAVEDIR + HISTORY}'" end --- 115,120 ---- save_config end ! STDERR.puts "Leaving directory '#{@cache[:workdir]}'" ! STDERR.puts "History is saved in '#{@cache[:workdir]}/#{SAVEDIR + HISTORY}'" end *************** *** 144,150 **** unless File.directory?(dir) begin ! print "Creating directory (#{dir}) ... " FileUtils.mkdir_p(dir) ! puts "done" rescue warn "Error: Failed to create directory (#{dir}) : #{$!}" --- 148,154 ---- unless File.directory?(dir) begin ! STDERR.print "Creating directory (#{dir}) ... " FileUtils.mkdir_p(dir) ! STDERR.puts "done" rescue warn "Error: Failed to create directory (#{dir}) : #{$!}" *************** *** 180,188 **** def load_config_file(file) if File.exists?(file) ! print "Loading config (#{file}) ... " if hash = YAML.load(File.read(file)) @config.update(hash) end ! puts "done" end end --- 184,192 ---- def load_config_file(file) if File.exists?(file) ! STDERR.print "Loading config (#{file}) ... " if hash = YAML.load(File.read(file)) @config.update(hash) end ! STDERR.puts "done" end end *************** *** 194,202 **** def save_config_file(file) begin ! print "Saving config (#{file}) ... " File.open(file, "w") do |f| f.puts @config.to_yaml end ! puts "done" rescue warn "Error: Failed to save (#{file}) : #{$!}" --- 198,206 ---- def save_config_file(file) begin ! STDERR.print "Saving config (#{file}) ... " File.open(file, "w") do |f| f.puts @config.to_yaml end ! STDERR.puts "done" rescue warn "Error: Failed to save (#{file}) : #{$!}" *************** *** 206,210 **** def config_show @config.each do |k, v| ! puts "#{k}\t= #{v.inspect}" end end --- 210,214 ---- def config_show @config.each do |k, v| ! STDERR.puts "#{k}\t= #{v.inspect}" end end *************** *** 215,219 **** @config[:echo] = IRB.conf[:ECHO] = flag eval("conf.echo = #{flag}", bind) ! puts "Echo #{flag ? 'on' : 'off'}" end --- 219,223 ---- @config[:echo] = IRB.conf[:ECHO] = flag eval("conf.echo = #{flag}", bind) ! STDERR.puts "Echo #{flag ? 'on' : 'off'}" end *************** *** 238,242 **** flag = ! @config[:splash] @config[:splash] = flag ! puts "Splash #{flag ? 'on' : 'off'}" opening_splash end --- 242,246 ---- flag = ! @config[:splash] @config[:splash] = flag ! STDERR.puts "Splash #{flag ? 'on' : 'off'}" opening_splash end *************** *** 257,263 **** if File.directory?(dir) Dir.glob("#{dir}/*.rb").sort.each do |file| ! print "Loading plugin (#{file}) ... " load file ! puts "done" end end --- 261,267 ---- if File.directory?(dir) Dir.glob("#{dir}/*.rb").sort.each do |file| ! STDERR.print "Loading plugin (#{file}) ... " load file ! STDERR.puts "done" end end *************** *** 283,287 **** def load_object_file(file) if File.exists?(file) ! print "Loading object (#{file}) ... " begin bind = Bio::Shell.cache[:binding] --- 287,291 ---- def load_object_file(file) if File.exists?(file) ! STDERR.print "Loading object (#{file}) ... " begin bind = Bio::Shell.cache[:binding] *************** *** 292,296 **** eval("#{k} = Thread.current[:restore_value]", bind) rescue ! puts "Warning: object '#{k}' couldn't be loaded : #{$!}" end end --- 296,300 ---- eval("#{k} = Thread.current[:restore_value]", bind) rescue ! STDERR.puts "Warning: object '#{k}' couldn't be loaded : #{$!}" end end *************** *** 298,302 **** warn "Error: Failed to load (#{file}) : #{$!}" end ! puts "done" end end --- 302,306 ---- warn "Error: Failed to load (#{file}) : #{$!}" end ! STDERR.puts "done" end end *************** *** 308,312 **** def save_object_file(file) begin ! print "Saving object (#{file}) ... " File.rename(file, "#{file}.old") if File.exist?(file) File.open(file, "w") do |f| --- 312,316 ---- def save_object_file(file) begin ! STDERR.print "Saving object (#{file}) ... " File.rename(file, "#{file}.old") if File.exist?(file) File.open(file, "w") do |f| *************** *** 329,333 **** @config[:marshal] = MARSHAL end ! puts "done" rescue File.rename("#{file}.old", file) if File.exist?("#{file}.old") --- 333,337 ---- @config[:marshal] = MARSHAL end ! STDERR.puts "done" rescue File.rename("#{file}.old", file) if File.exist?("#{file}.old") *************** *** 360,364 **** def load_history_file(file) if File.exists?(file) ! print "Loading history (#{file}) ... " File.open(file).each do |line| unless line[/^# /] --- 364,368 ---- def load_history_file(file) if File.exists?(file) ! STDERR.print "Loading history (#{file}) ... " File.open(file).each do |line| unless line[/^# /] *************** *** 366,370 **** end end ! puts "done" end end --- 370,374 ---- end end ! STDERR.puts "done" end end *************** *** 379,387 **** def save_history_file(file) begin ! print "Saving history (#{file}) ... " File.open(file, "w") do |f| f.puts Readline::HISTORY.to_a end ! puts "done" rescue warn "Error: Failed to save (#{file}) : #{$!}" --- 383,391 ---- def save_history_file(file) begin ! STDERR.print "Saving history (#{file}) ... " File.open(file, "w") do |f| f.puts Readline::HISTORY.to_a end ! STDERR.puts "done" rescue warn "Error: Failed to save (#{file}) : #{$!}" *************** *** 413,422 **** def script_begin ! puts "-- 8< -- 8< -- 8< -- Script -- 8< -- 8< -- 8< --" @script_begin = Readline::HISTORY.size end def script_end ! puts "-- >8 -- >8 -- >8 -- Script -- >8 -- >8 -- >8 --" @script_end = Readline::HISTORY.size - 2 end --- 417,426 ---- def script_begin ! STDERR.puts "-- 8< -- 8< -- 8< -- Script -- 8< -- 8< -- 8< --" @script_begin = Readline::HISTORY.size end def script_end ! STDERR.puts "-- >8 -- >8 -- >8 -- Script -- >8 -- >8 -- >8 --" @script_end = Readline::HISTORY.size - 2 end *************** *** 432,441 **** save_script_file(SCRIPT) else ! puts " ... save aborted." end elsif @script_begin and @script_end and @script_begin - @script_end == 1 ! puts " ... script aborted." else ! puts "Error: Script range #{@script_begin}..#{@script_end} is invalid" end end --- 436,445 ---- save_script_file(SCRIPT) else ! STDERR.puts " ... save aborted." end elsif @script_begin and @script_end and @script_begin - @script_end == 1 ! STDERR.puts " ... script aborted." else ! STDERR.puts "Error: Script range #{@script_begin}..#{@script_end} is invalid" end end *************** *** 443,447 **** def save_script_file(file) begin ! print "Saving script (#{file}) ... " File.open(file, "w") do |f| f.puts "#!/usr/bin/env bioruby" --- 447,451 ---- def save_script_file(file) begin ! STDERR.print "Saving script (#{file}) ... " File.open(file, "w") do |f| f.puts "#!/usr/bin/env bioruby" *************** *** 450,454 **** f.puts end ! puts "done" rescue @script_begin = nil --- 454,458 ---- f.puts end ! STDERR.puts "done" rescue @script_begin = nil *************** *** 507,511 **** def opening_splash ! puts if @config[:splash] if @config[:color] --- 511,515 ---- def opening_splash ! STDERR.puts if @config[:splash] if @config[:color] *************** *** 516,541 **** end if @config[:color] ! print splash_message_color else ! print splash_message end ! puts ! puts ! print " Version : BioRuby #{Bio::BIORUBY_VERSION.join(".")}" ! print " / Ruby #{RUBY_VERSION}" ! puts ! puts end def closing_splash ! puts ! puts if @config[:color] ! print splash_message_color else ! print splash_message end ! puts ! puts end --- 520,545 ---- end if @config[:color] ! STDERR.print splash_message_color else ! STDERR.print splash_message end ! STDERR.puts ! STDERR.puts ! STDERR.print " Version : BioRuby #{Bio::BIORUBY_VERSION.join(".")}" ! STDERR.print " / Ruby #{RUBY_VERSION}" ! STDERR.puts ! STDERR.puts end def closing_splash ! STDERR.puts ! STDERR.puts if @config[:color] ! STDERR.print splash_message_color else ! STDERR.print splash_message end ! STDERR.puts ! STDERR.puts end From k at dev.open-bio.org Wed Mar 28 16:21:28 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 28 Mar 2007 20:21:28 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/shell setup.rb, 1.1, 1.2 script.rb, 1.1, 1.2 Message-ID: <200703282021.l2SKLSkM008526@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/shell In directory dev.open-bio.org:/tmp/cvs-serv8522/shell Modified Files: setup.rb script.rb Log Message: * enhanced to store :mode in Bio::Shell.cache * changed to execute bioruby script directly (instead of chdir to workdir etc.) and core.rb is modified to print messages to STDERR, user can capture result of the BioRuby script (STDOUT only) by % bioruby foo/bar/script.rb > result.txt however, this change also introduces possible problem that if the script depends on the serialized objects stored in shell/session/object file, user must chdir by him/her-self to the bioruby project directory so that bioruby shell can find shell/ directory in it. Index: setup.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/setup.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** setup.rb 24 Dec 2006 08:32:08 -0000 1.1 --- setup.rb 28 Mar 2007 20:21:26 -0000 1.2 *************** *** 23,34 **** # load configuration and plugins ! Dir.chdir(@workdir) Bio::Shell.configure Bio::Shell.cache[:workdir] = @workdir # set default to irb mode ! @mode ||= :irb ! case @mode when :web # setup rails server --- 23,34 ---- # load configuration and plugins ! Dir.chdir(@workdir) if @workdir Bio::Shell.configure Bio::Shell.cache[:workdir] = @workdir # set default to irb mode ! Bio::Shell.cache[:mode] = @mode || :irb ! case Bio::Shell.cache[:mode] when :web # setup rails server *************** *** 87,92 **** elsif File.file?(arg) # run file as a bioruby shell script ! @workdir = File.join(File.dirname(arg), "..") ! @script = File.basename(arg) @mode = :script else --- 87,92 ---- elsif File.file?(arg) # run file as a bioruby shell script ! @workdir = nil ! @script = arg @mode = :script else Index: script.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/script.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** script.rb 24 Dec 2006 08:32:08 -0000 1.1 --- script.rb 28 Mar 2007 20:21:26 -0000 1.2 *************** *** 16,20 **** Bio::Shell.cache[:binding] = TOPLEVEL_BINDING Bio::Shell.load_session ! eval(File.read(File.join(Bio::Shell.script_dir, script)), TOPLEVEL_BINDING) exit end --- 16,20 ---- Bio::Shell.cache[:binding] = TOPLEVEL_BINDING Bio::Shell.load_session ! eval(File.read(script), TOPLEVEL_BINDING) exit end From k at dev.open-bio.org Wed Mar 28 16:23:41 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 28 Mar 2007 20:23:41 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio shell.rb,1.17,1.18 Message-ID: <200703282023.l2SKNfM0008588@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio In directory dev.open-bio.org:/tmp/cvs-serv8584 Modified Files: shell.rb Log Message: * added das plugin Index: shell.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell.rb,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** shell.rb 24 Dec 2006 08:32:08 -0000 1.17 --- shell.rb 28 Mar 2007 20:23:39 -0000 1.18 *************** *** 31,34 **** --- 31,35 ---- require 'bio/shell/plugin/flatfile' require 'bio/shell/plugin/obda' + require 'bio/shell/plugin/das' require 'bio/shell/plugin/keggapi' require 'bio/shell/plugin/emboss' From nakao at dev.open-bio.org Wed Mar 28 16:48:13 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Wed, 28 Mar 2007 20:48:13 +0000 Subject: [BioRuby-cvs] bioruby/test/functional/bio/io test_soapwsdl.rb, 1.2, 1.3 Message-ID: <200703282048.l2SKmDMf008660@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/functional/bio/io In directory dev.open-bio.org:/tmp/cvs-serv8640/test/functional/bio/io Modified Files: test_soapwsdl.rb Log Message: * Changed licence (GPL2 -> Ruby's) Index: test_soapwsdl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/functional/bio/io/test_soapwsdl.rb,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_soapwsdl.rb 20 Jan 2006 12:04:03 -0000 1.2 --- test_soapwsdl.rb 28 Mar 2007 20:48:11 -0000 1.3 *************** *** 1,20 **** # ! # test/functional/bio/io/test_soapwsdl.rb - Unit test for SOAP/WSDL ! # ! # Copyright (C) 2005 Mitsuteru Nakao ! # ! # This library is free software; you can redistribute it and/or ! # modify it under the terms of the GNU Lesser General Public ! # License as published by the Free Software Foundation; either ! # version 2 of the License, or (at your option) any later version. ! # ! # This library is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! # Lesser General Public License for more details. # ! # You should have received a copy of the GNU Lesser General Public ! # License along with this library; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # $Id$ --- 1,8 ---- # ! # test/functional/bio/io/test_soapwsdl.rb - Functional test for SOAP/WSDL # ! # Copyright:: Copyright (C) 2005,2007 ! # Mitsuteru C. Nakao ! # License:: Ruby's # # $Id$ From aerts at dev.open-bio.org Wed Mar 28 17:25:04 2007 From: aerts at dev.open-bio.org (Jan Aerts) Date: Wed, 28 Mar 2007 21:25:04 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio test_map.rb,1.3,1.4 Message-ID: <200703282125.l2SLP4VG008858@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio In directory dev.open-bio.org:/tmp/cvs-serv8838 Modified Files: test_map.rb Log Message: Trivial. Index: test_map.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/unit/bio/test_map.rb,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_map.rb 27 Jun 2006 12:37:42 -0000 1.3 --- test_map.rb 28 Mar 2007 21:25:02 -0000 1.4 *************** *** 112,116 **** end ! class CloneActsLikeMap include Bio::Map::ActsLikeMap def initialize --- 112,116 ---- end ! class CloneToActLikeMap include Bio::Map::ActsLikeMap def initialize *************** *** 122,129 **** class TestActsLikeMap < Test::Unit::TestCase def setup ! @clone = CloneActsLikeMap.new end def test_mixin ! assert_instance_of(CloneActsLikeMap, @clone) assert_respond_to(@clone, 'contains_marker?') assert_respond_to(@clone, 'add_mapping_as_map') --- 122,129 ---- class TestActsLikeMap < Test::Unit::TestCase def setup ! @clone = CloneToActLikeMap.new end def test_mixin ! assert_instance_of(CloneToActLikeMap, @clone) assert_respond_to(@clone, 'contains_marker?') assert_respond_to(@clone, 'add_mapping_as_map') *************** *** 132,136 **** end ! class CloneActsLikeMarker include Bio::Map::ActsLikeMarker def initialize --- 132,136 ---- end ! class CloneToActLikeMarker include Bio::Map::ActsLikeMarker def initialize *************** *** 142,150 **** class TestActsLikeMarker < Test::Unit::TestCase def setup ! @clone = CloneActsLikeMarker.new end def test_mixin ! assert_instance_of(CloneActsLikeMarker, @clone) assert_respond_to(@clone, 'mapped_to?') assert_respond_to(@clone, 'add_mapping_as_marker') --- 142,150 ---- class TestActsLikeMarker < Test::Unit::TestCase def setup ! @clone = CloneToActLikeMarker.new end def test_mixin ! assert_instance_of(CloneToActLikeMarker, @clone) assert_respond_to(@clone, 'mapped_to?') assert_respond_to(@clone, 'add_mapping_as_marker') *************** *** 152,156 **** end ! class CloneActsLikeMapAndMarker include Bio::Map::ActsLikeMap include Bio::Map::ActsLikeMarker --- 152,156 ---- end ! class CloneToActLikeMapAndMarker include Bio::Map::ActsLikeMap include Bio::Map::ActsLikeMarker *************** *** 164,174 **** class TestActsLikeMapAndMarker < Test::Unit::TestCase def setup ! @clone_a = CloneActsLikeMapAndMarker.new ! @clone_b = CloneActsLikeMapAndMarker.new @clone_a.add_mapping_as_map(@clone_b, nil) end def test_mixin ! assert_instance_of(CloneActsLikeMapAndMarker, @clone_a) assert_respond_to(@clone_a, 'contains_marker?') assert_respond_to(@clone_a, 'add_mapping_as_map') --- 164,174 ---- class TestActsLikeMapAndMarker < Test::Unit::TestCase def setup ! @clone_a = CloneToActLikeMapAndMarker.new ! @clone_b = CloneToActLikeMapAndMarker.new @clone_a.add_mapping_as_map(@clone_b, nil) end def test_mixin ! assert_instance_of(CloneToActLikeMapAndMarker, @clone_a) assert_respond_to(@clone_a, 'contains_marker?') assert_respond_to(@clone_a, 'add_mapping_as_map') *************** *** 182,197 **** end end - - class Clone - include Bio::Map::ActsLikeMap - include Bio::Map::ActsLikeMarker - - def initialize(name) - @name = name - @mappings_as_map = Array.new - @mappings_as_marker = Array.new - end - attr_accessor :name, :mappings_as_map, :mappings_as_marker - end - end --- 182,184 ---- From trevor at dev.open-bio.org Wed Mar 28 22:48:17 2007 From: trevor at dev.open-bio.org (Trevor Wennblom) Date: Thu, 29 Mar 2007 02:48:17 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/util/restriction_enzyme/double_stranded cut_location_pair.rb, 1.4, 1.5 Message-ID: <200703290248.l2T2mHks009375@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-serv9353/bio/util/restriction_enzyme/double_stranded Modified Files: cut_location_pair.rb Log Message: Patch for Range weirdness. 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.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** cut_location_pair.rb 2 Jan 2007 06:18:38 -0000 1.4 --- cut_location_pair.rb 29 Mar 2007 02:48:15 -0000 1.5 *************** *** 63,67 **** a,b = init_with_array( pair[0] ) ! elsif pair[0].kind_of? Range # FIXME This seems to be broken? Check tests a,b = init_with_array( [pair[0].first, pair[0].last] ) --- 63,70 ---- a,b = init_with_array( pair[0] ) ! # no idea why this barfs without the second half during test/runner.rb ! # are there two Range objects running around? ! elsif pair[0].kind_of? Range or (pair[0].class.to_s == 'Range') ! #elsif pair[0].kind_of? Range a,b = init_with_array( [pair[0].first, pair[0].last] ) *************** *** 108,110 **** end # CutLocationPair end # DoubleStranded ! end # Bio::RestrictionEnzyme \ No newline at end of file --- 111,113 ---- end # CutLocationPair end # DoubleStranded ! end # Bio::RestrictionEnzyme From trevor at dev.open-bio.org Wed Mar 28 22:48:17 2007 From: trevor at dev.open-bio.org (Trevor Wennblom) Date: Thu, 29 Mar 2007 02:48:17 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/util/restriction_enzyme/range/sequence_range calculated_cuts.rb, 1.3, 1.4 Message-ID: <200703290248.l2T2mHPu009378@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-serv9353/bio/util/restriction_enzyme/range/sequence_range Modified Files: calculated_cuts.rb Log Message: Patch for Range weirdness. 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.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** calculated_cuts.rb 6 Jan 2007 05:35:05 -0000 1.3 --- calculated_cuts.rb 29 Mar 2007 02:48:15 -0000 1.4 *************** *** 13,16 **** --- 13,17 ---- $:.unshift(libpath) unless $:.include?(libpath) + 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' *************** *** 251,253 **** end # SequenceRange end # Range ! end # Bio::RestrictionEnzyme \ No newline at end of file --- 252,254 ---- end # SequenceRange end # Range ! end # Bio::RestrictionEnzyme From trevor at dev.open-bio.org Wed Mar 28 23:18:28 2007 From: trevor at dev.open-bio.org (Trevor Wennblom) Date: Thu, 29 Mar 2007 03:18:28 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio/db test_soft.rb,1.1,1.2 Message-ID: <200703290318.l2T3ISl8009477@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio/db In directory dev.open-bio.org:/tmp/cvs-serv9457/test/unit/bio/db Modified Files: test_soft.rb Log Message: Fix path resolution for SOFT tests. Index: test_soft.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/unit/bio/db/test_soft.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_soft.rb 2 Feb 2007 06:13:10 -0000 1.1 --- test_soft.rb 29 Mar 2007 03:18:26 -0000 1.2 *************** *** 20,25 **** def setup ! @obj_series = Bio::SOFT.new( IO.readlines('../../../data/soft/GSE3457_family_partial.soft')) ! @obj_dataset = Bio::SOFT.new( IO.readlines('../../../data/soft/GDS100_partial.soft')) end --- 20,30 ---- def setup ! bioruby_root = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4)).cleanpath.to_s ! test_data_path = Pathname.new(File.join(bioruby_root, 'test', 'data', 'soft')).cleanpath.to_s ! series_filename = File.join(test_data_path, 'GSE3457_family_partial.soft') ! dataset_filename = File.join(test_data_path, 'GDS100_partial.soft') ! ! @obj_series = Bio::SOFT.new( IO.readlines(series_filename)) ! @obj_dataset = Bio::SOFT.new( IO.readlines(dataset_filename)) end *************** *** 131,133 **** end ! end \ No newline at end of file --- 136,138 ---- end ! end From nakao at dev.open-bio.org Thu Mar 29 01:24:30 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Thu, 29 Mar 2007 05:24:30 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io ensembl.rb,1.6,1.7 Message-ID: <200703290524.l2T5OUVK009721@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv9701/lib/bio/io Modified Files: ensembl.rb Log Message: * Fixed a bug in exportview argument parsing. Index: ensembl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/ensembl.rb,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ensembl.rb 28 Mar 2007 12:31:48 -0000 1.6 --- ensembl.rb 29 Mar 2007 05:24:27 -0000 1.7 *************** *** 65,70 **** --- 65,72 ---- ENSEMBL_URL = 'http://www.ensembl.org' + # Server URL (ex. 'http://www.ensembl.org') attr_reader :server + # Organism name. (ex. 'Homo_sapiens'). attr_reader :organism *************** *** 138,157 **** # def exportview(*args) - if args.first.class == Hash - options = args.first - else - options = { - :seq_region_name => args[0], - :anchor1 => args[1], - :anchor2 => args[2], - } - case args.size - when 3 then - options.update({:format => 'fasta'}) - when 4 then - options.update({:format => 'gff', :options => args[3]}) - end - end - defaults = { :type1 => 'bp', --- 140,143 ---- *************** *** 167,170 **** --- 153,170 ---- } + if args.first.class == Hash + options = args.first + options.update({:format => 'gff'}) if options[:options] and options[:format] != 'fasta' + else + options = { + :seq_region_name => args[0], + :anchor1 => args[1], + :anchor2 => args[2], + } + if args.size >= 4 + options.update({:format => 'gff', :options => args[3]}) + end + end + params = defaults.update(options) From nakao at dev.open-bio.org Thu Mar 29 01:25:02 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Thu, 29 Mar 2007 05:25:02 +0000 Subject: [BioRuby-cvs] bioruby/test/functional/bio/io test_ensembl.rb, NONE, 1.1 Message-ID: <200703290525.l2T5P2X0009749@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/functional/bio/io In directory dev.open-bio.org:/tmp/cvs-serv9729/test/functional/bio/io Added Files: test_ensembl.rb Log Message: * Added functional test for Bio::Ensembl. --- NEW FILE: test_ensembl.rb --- # # test/functional/bio/io/test_ensembl.rb - Functional test for Bio::Ensembl # # Copyright:: Copyright (C) 2007 # Mitsuteru C. Nakao # License:: Ruby's # # $Id: test_ensembl.rb,v 1.1 2007/03/29 05:24:59 nakao Exp $ # require 'pathname' libpath = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4, 'lib')).cleanpath.to_s $:.unshift(libpath) unless $:.include?(libpath) require 'test/unit' require 'bio/io/ensembl' module Bio class FuncTestEnsembl < Test::Unit::TestCase def setup @serv = Bio::Ensembl.new('Homo_sapiens') end def test_class assert_equal(Bio::Ensembl, @serv.class) end end class FuncTestEnsemblHuman < Test::Unit::TestCase def setup @serv = Bio::Ensembl.human end def test_organism assert_equal("Homo_sapiens", @serv.organism) end def test_server assert_equal("http://www.ensembl.org", @serv.server) end def test_fna_exportview seq = ">4 dna:chromosome chromosome:NCBI36:4:1149206:1149209:1\nGAGA\n" fna = @serv.exportview(4, 1149206, 1149209) assert_equal(seq, fna) end def test_fna_exportview_with_named_args seq = ">4 dna:chromosome chromosome:NCBI36:4:1149206:1149209:1\nGAGA\n" fna = @serv.exportview(:seq_region_name => 4, :anchor1 => 1149206, :anchor2 => 1149209) assert_equal(seq, fna) end def test_gff_exportview line = "chromosome:NCBI36:4:1149206:1149209:1\tEnsembl\tGene\t-839\t2747\t.\t+\t.\tgene_id=ENSG00000206158; transcript_id=ENST00000382964; exon_id=ENSE00001494097; gene_type=KNOWN_protein_coding\n" gff = @serv.exportview(4, 1149206, 1149209, ['gene']) assert_equal(line, gff) end def test_gff_exportview_with_named_args line = "chromosome:NCBI36:4:1149206:1149209:1\tEnsembl\tGene\t-839\t2747\t.\t+\t.\tgene_id=ENSG00000206158; transcript_id=ENST00000382964; exon_id=ENSE00001494097; gene_type=KNOWN_protein_coding\n" gff = @serv.exportview(:seq_region_name => 4, :anchor1 => 1149206, :anchor2 => 1149209, :options => ['gene']) assert_equal(line, gff) end end end # module Bio From nakao at dev.open-bio.org Thu Mar 29 01:50:45 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Thu, 29 Mar 2007 05:50:45 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io ensembl.rb,1.7,1.8 Message-ID: <200703290550.l2T5oj1e009846@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv9824/lib/bio/io Modified Files: ensembl.rb Log Message: * Fixed bugs in exportview argument parsing. Index: ensembl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/ensembl.rb,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ensembl.rb 29 Mar 2007 05:24:27 -0000 1.7 --- ensembl.rb 29 Mar 2007 05:50:43 -0000 1.8 *************** *** 155,159 **** if args.first.class == Hash options = args.first ! options.update({:format => 'gff'}) if options[:options] and options[:format] != 'fasta' else options = { --- 155,161 ---- if args.first.class == Hash options = args.first ! if options[:options] and options[:format] != 'fasta' and options[:format] != 'tab' ! options.update({:format => 'gff'}) ! end else options = { From nakao at dev.open-bio.org Thu Mar 29 01:50:45 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Thu, 29 Mar 2007 05:50:45 +0000 Subject: [BioRuby-cvs] bioruby/test/functional/bio/io test_ensembl.rb, 1.1, 1.2 Message-ID: <200703290550.l2T5ojwk009851@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/functional/bio/io In directory dev.open-bio.org:/tmp/cvs-serv9824/test/functional/bio/io Modified Files: test_ensembl.rb Log Message: * Fixed bugs in exportview argument parsing. Index: test_ensembl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/functional/bio/io/test_ensembl.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_ensembl.rb 29 Mar 2007 05:24:59 -0000 1.1 --- test_ensembl.rb 29 Mar 2007 05:50:43 -0000 1.2 *************** *** 71,74 **** --- 71,84 ---- end + def test_tab_exportview_with_named_args + line = "seqname\tsource\tfeature\tstart\tend\tscore\tstrand\tframe\tgene_id\ttranscript_id\texon_id\tgene_type\nchromosome:NCBI36:4:1149206:1149209:1\tEnsembl\tGene\t-839\t2747\t.\t+\t.\tENSG00000206158\tENST00000382964\tENSE00001494097\tKNOWN_protein_coding\n" + gff = @serv.exportview(:seq_region_name => 4, + :anchor1 => 1149206, + :anchor2 => 1149209, + :options => ['gene'], + :format => 'tab') + assert_equal(line, gff) + end + end From nakao at dev.open-bio.org Thu Mar 29 04:00:06 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Thu, 29 Mar 2007 08:00:06 +0000 Subject: [BioRuby-cvs] bioruby/test/functional/bio/io test_ensembl.rb, 1.2, 1.3 Message-ID: <200703290800.l2T806XF010039@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/functional/bio/io In directory dev.open-bio.org:/tmp/cvs-serv10014/test/functional/bio/io Modified Files: test_ensembl.rb Log Message: * Added tests. Index: test_ensembl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/functional/bio/io/test_ensembl.rb,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_ensembl.rb 29 Mar 2007 05:50:43 -0000 1.2 --- test_ensembl.rb 29 Mar 2007 08:00:04 -0000 1.3 *************** *** 48,51 **** --- 48,57 ---- end + def test_fasta_exportview_with_hash_4th_params + fna = @serv.exportview(4, 1149206, 1149209, :upstream => 10) + fna10 = @serv.exportview(4, 1149196, 1149209) + assert_equal(fna10, fna) + end + def test_fna_exportview_with_named_args seq = ">4 dna:chromosome chromosome:NCBI36:4:1149206:1149209:1\nGAGA\n" *************** *** 56,59 **** --- 62,76 ---- end + def test_fasta_exportview_with_named_args_and_hash_4th_params + fna = @serv.exportview(:seq_region_name => 4, + :anchor1 => 1149206, + :anchor2 => 1149209, + :upstream => 10) + fna10 = @serv.exportview(:seq_region_name => 4, + :anchor1 => 1149196, + :anchor2 => 1149209) + assert_equal(fna10, fna) + end + def test_gff_exportview line = "chromosome:NCBI36:4:1149206:1149209:1\tEnsembl\tGene\t-839\t2747\t.\t+\t.\tgene_id=ENSG00000206158; transcript_id=ENST00000382964; exon_id=ENSE00001494097; gene_type=KNOWN_protein_coding\n" *************** *** 81,84 **** --- 98,102 ---- end + end From nakao at dev.open-bio.org Thu Mar 29 04:00:06 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Thu, 29 Mar 2007 08:00:06 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io ensembl.rb,1.8,1.9 Message-ID: <200703290800.l2T806Dq010036@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv10014/lib/bio/io Modified Files: ensembl.rb Log Message: * Added tests. Index: ensembl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/ensembl.rb,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ensembl.rb 29 Mar 2007 05:50:43 -0000 1.8 --- ensembl.rb 29 Mar 2007 08:00:04 -0000 1.9 *************** *** 110,113 **** --- 110,120 ---- # 'genscan', 'variation', 'gene']) # human.exportview(1, 1149206, 1150000, ['variation', 'gene']) + # + # Feature in TAB + # human.exportview(:seq_region_name => 1, + # :anchor1 => 1149206, :anchor2 => 1150000, + # :options => ['similarity', 'repeat', + # 'genscan', 'variation', 'gene'], + # :format => 'tab') # # == Arguments *************** *** 164,169 **** :anchor2 => args[2], } ! if args.size >= 4 options.update({:format => 'gff', :options => args[3]}) end end --- 171,184 ---- :anchor2 => args[2], } ! ! case args[3] ! when Array options.update({:format => 'gff', :options => args[3]}) + when Hash + options.update(args[3]) + end + + if aqrgs[4].class == Hash + options.update(args[4]) end end From nakao at dev.open-bio.org Thu Mar 29 05:02:47 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Thu, 29 Mar 2007 09:02:47 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/appl/iprscan report.rb,1.4,1.5 Message-ID: <200703290902.l2T92lZv010653@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/appl/iprscan In directory dev.open-bio.org:/tmp/cvs-serv10633/lib/bio/appl/iprscan Modified Files: report.rb Log Message: * Fixed a bug to parse merged.txt reports. Index: report.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/iprscan/report.rb,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** report.rb 22 Feb 2007 10:15:01 -0000 1.4 --- report.rb 29 Mar 2007 09:02:44 -0000 1.5 *************** *** 193,197 **** # end def self.reports_in_ptxt(io) ! io.each(/\n\/\/\n/m) do |entry| yield self.parse_in_ptxt(entry) end --- 193,197 ---- # end def self.reports_in_ptxt(io) ! io.each("\n\/\/\n") do |entry| yield self.parse_in_ptxt(entry) end From k at dev.open-bio.org Thu Mar 29 08:14:48 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 29 Mar 2007 12:14:48 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio command.rb,1.15,1.16 Message-ID: <200703291214.l2TCEmBq010969@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio In directory dev.open-bio.org:/tmp/cvs-serv10963/lib/bio Modified Files: command.rb Log Message: * routine for generating CGI arguments is separated from post_form to make_cgi_params Index: command.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/command.rb,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** command.rb 28 Mar 2007 16:54:11 -0000 1.15 --- command.rb 29 Mar 2007 12:14:46 -0000 1.16 *************** *** 277,292 **** end ! data = "" case params when Hash data = params.map do |key, val| ! "#{URI.escape(key.to_s)}=#{URI.escape(val.to_s)}" end.join('&') when Array case params.first ! when Hash, Array data = params.map do |key, val| ! "#{URI.escape(key.to_s)}=#{URI.escape(val.to_s)}" end.join('&') when String --- 277,311 ---- end ! data = make_cgi_params(params) ! ! hash = { ! 'Content-Type' => 'application/x-www-form-urlencoded', ! 'Content-Length' => data.length.to_s ! } ! hash.update(header) ! ! start_http(uri.host, uri.port) do |http| ! http.post(uri.path, data, hash) ! end ! end + def make_cgi_params(params) + data = "" case params when Hash data = params.map do |key, val| ! make_cgi_params_key_value(key, val) end.join('&') when Array case params.first ! when Hash ! data = params.map do |hash| ! hash.map do |key, val| ! make_cgi_params_key_value(key, val) ! end ! end.join('&') ! when Array data = params.map do |key, val| ! make_cgi_params_key_value(key, val) end.join('&') when String *************** *** 298,311 **** data = URI.escape(params.strip) end ! hash = { ! 'Content-Type' => 'application/x-www-form-urlencoded', ! 'Content-Length' => data.length.to_s ! } ! hash.update(header) ! ! start_http(uri.host, uri.port) do |http| ! http.post(uri.path, data, hash) end end --- 317,334 ---- data = URI.escape(params.strip) end + return data + end ! def make_cgi_params_key_value(key, value) ! result = [] ! case value ! when Array ! value.each do |val| ! result << [key, val].map {|x| URI.escape(x.to_s) }.join('=') ! end ! else ! result << [key, value].map {|x| URI.escape(x.to_s) }.join('=') end + return result end From k at dev.open-bio.org Thu Mar 29 08:14:48 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 29 Mar 2007 12:14:48 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio test_command.rb,1.3,1.4 Message-ID: <200703291214.l2TCEmXa010972@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio In directory dev.open-bio.org:/tmp/cvs-serv10963/test/unit/bio Modified Files: test_command.rb Log Message: * routine for generating CGI arguments is separated from post_form to make_cgi_params Index: test_command.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/unit/bio/test_command.rb,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_command.rb 27 Jul 2006 03:50:36 -0000 1.3 --- test_command.rb 29 Mar 2007 12:14:46 -0000 1.4 *************** *** 131,134 **** --- 131,288 ---- end + def test_make_cgi_params_by_hash_in_symbol + ary = [ + "type1=bp", + "type2=bp", + "downstream=", + "upstream=", + "format=fasta", + "options=similarity", + "options=gene", + "action=export", + "_format=Text", + "output=txt", + "submit=Continue%20%3E%3E", + ] + hash = { + :type1 => 'bp', + :type2 => 'bp', + :downstream => '', + :upstream => '', + :format => 'fasta', + :options => ['similarity', 'gene'], + :action => 'export', + :_format => 'Text', + :output => 'txt', + :submit => 'Continue >>', + } + result = Bio::Command.make_cgi_params(hash) + ary.each do |str| + assert_match(str, result) + end + end + + def test_make_cgi_params_by_hash_in_string + ary = [ + "type1=bp", + "type2=bp", + "downstream=", + "upstream=", + "format=fasta", + "options=similarity", + "options=gene", + "action=export", + "_format=Text", + "output=txt", + "submit=Continue%20%3E%3E", + ] + hash = { + "type1" => 'bp', + "type2" => 'bp', + "downstream" => '', + "upstream" => '', + "format" => 'fasta', + "options" => ['similarity', 'gene'], + "action" => 'export', + "_format" => 'Text', + "output" => 'txt', + "submit" => 'Continue >>', + } + result = Bio::Command.make_cgi_params(hash) + ary.each do |str| + assert_match(str, result) + end + end + + def test_make_cgi_params_by_array_of_array + ary = [ + "type1=bp", + "type2=bp", + "downstream=", + "upstream=", + "format=fasta", + "options=similarity", + "options=gene", + "action=export", + "_format=Text", + "output=txt", + "submit=Continue%20%3E%3E", + ] + array_of_array = [ + ["type1", 'bp'], + ["type2", 'bp'], + ["downstream", ''], + ["upstream", ''], + ["format", 'fasta'], + ["options", ['similarity', 'gene']], + ["action", 'export'], + ["_format", 'Text'], + ["output", 'txt'], + ["submit", 'Continue >>'], + ] + result = Bio::Command.make_cgi_params(array_of_array) + ary.each do |str| + assert_match(str, result) + end + end + + def test_make_cgi_params_by_array_of_hash + ary = [ + "type1=bp", + "type2=bp", + "downstream=", + "upstream=", + "format=fasta", + "options=similarity", + "options=gene", + "action=export", + "_format=Text", + "output=txt", + "submit=Continue%20%3E%3E", + ] + array_of_hash = [ + {"type1" => 'bp'}, + {"type2" => 'bp'}, + {"downstream" => ''}, + {"upstream" => ''}, + {"format" => 'fasta'}, + {"options" => ['similarity', 'gene']}, + {"action" => 'export'}, + {"_format" => 'Text'}, + {"output" => 'txt'}, + {"submit" => 'Continue >>'}, + ] + result = Bio::Command.make_cgi_params(array_of_hash) + ary.each do |str| + assert_match(str, result) + end + end + + def test_make_cgi_params_by_array_of_string + str = "type1=bp&type2=bp&downstream=&upstream=&format=fasta&options=similarity&options=gene&action=export&_format=Text&output=txt&submit=Continue%20%3E%3E" + array_of_string = [ + "type1=bp", + "type2=bp", + "downstream=", + "upstream=", + "format=fasta", + "options=similarity", + "options=gene", + "action=export", + "_format=Text", + "output=txt", + "submit=Continue >>", + ] + result = Bio::Command.make_cgi_params(array_of_string) + assert_equal(str, result) + end + + def test_make_cgi_params_by_string + string = "type1=bp&type2=bp&downstream=&upstream=&format=fasta&options=similarity&options=gene&action=export&_format=Text&output=txt&submit=Continue%20%3E%3E" + query = " type1=bp&type2=bp&downstream=&upstream=&format=fasta&options=similarity&options=gene&action=export&_format=Text&output=txt&submit=Continue >> " + result = Bio::Command.make_cgi_params(query) + assert_equal(string, result) + end + end end From k at dev.open-bio.org Thu Mar 29 08:43:38 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 29 Mar 2007 12:43:38 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg cell.rb,1.7,NONE Message-ID: <200703291243.l2TChcSU011309@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg In directory dev.open-bio.org:/tmp/cvs-serv11287/db/kegg Removed Files: cell.rb Log Message: * KEGG CELL module is removed as the database is not publically available any more (for now) --- cell.rb DELETED --- From k at dev.open-bio.org Thu Mar 29 08:44:27 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 29 Mar 2007 12:44:27 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io fastacmd.rb,1.14,1.15 Message-ID: <200703291244.l2TCiRGT011363@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv11336/io Modified Files: fastacmd.rb Log Message: * license is changed from LGPL to Ruby's by permission of author Index: fastacmd.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/fastacmd.rb,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** fastacmd.rb 31 Dec 2006 21:54:49 -0000 1.14 --- fastacmd.rb 29 Mar 2007 12:44:25 -0000 1.15 *************** *** 7,32 **** # Mitsuteru C. Nakao , # Jan Aerts ! # License:: LGPL # # $Id$ # - #-- - # - # This library is free software; you can redistribute it and/or - # modify it under the terms of the GNU Lesser General Public - # License as published by the Free Software Foundation; either - # version 2 of the License, or (at your option) any later version. - # - # This library is distributed in the hope that it will be useful, - # but WITHOUT ANY WARRANTY; without even the implied warranty of - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - # Lesser General Public License for more details. - # - # You should have received a copy of the GNU Lesser General Public - # License along with this library; if not, write to the Free Software - # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - # - #++ - # require 'bio/db/fasta' --- 7,14 ---- # Mitsuteru C. Nakao , # Jan Aerts ! # License:: Ruby's # # $Id$ # require 'bio/db/fasta' From k at dev.open-bio.org Thu Mar 29 08:47:00 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 29 Mar 2007 12:47:00 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db transfac.rb,1.10,1.11 Message-ID: <200703291247.l2TCl0FG011482@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db In directory dev.open-bio.org:/tmp/cvs-serv11467/db Modified Files: transfac.rb Log Message: * license is changed from LGPL to Ruby's with permission from author Index: transfac.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/transfac.rb,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** transfac.rb 28 Nov 2005 04:57:33 -0000 1.10 --- transfac.rb 29 Mar 2007 12:46:58 -0000 1.11 *************** *** 1,22 **** # ! # bio/db/transfac.rb - TRANSFAC database class ! # ! # Copyright (C) 2001 KAWASHIMA Shuichi ! # ! # This library is free software; you can redistribute it and/or ! # modify it under the terms of the GNU Lesser General Public ! # License as published by the Free Software Foundation; either ! # version 2 of the License, or (at your option) any later version. ! # ! # This library is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! # Lesser General Public License for more details. # ! # You should have received a copy of the GNU Lesser General Public ! # License along with this library; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # ! # $Id$ # --- 1,10 ---- # ! # = bio/db/transfac.rb - TRANSFAC database class # ! # Copyright:: Copyright (C) 2001 ! # Shuichi Kawashima ! # License:: Ruby's # ! # $Id$ # From k at dev.open-bio.org Thu Mar 29 08:50:51 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 29 Mar 2007 12:50:51 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db pdb.rb,1.6,1.7 Message-ID: <200703291250.l2TCopdY011674@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db In directory dev.open-bio.org:/tmp/cvs-serv11658/db Modified Files: pdb.rb Log Message: * license is changed from LGPL to Ruby's with permission from authors Index: pdb.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb.rb,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pdb.rb 29 Jan 2006 06:54:13 -0000 1.6 --- pdb.rb 29 Mar 2007 12:50:49 -0000 1.7 *************** *** 1,22 **** # ! # bio/db/pdb.rb - PDB database classes ! # ! # Copyright (C) 2004 GOTO Naohisa ! # ! # This library is free software; you can redistribute it and/or ! # modify it under the terms of the GNU Lesser General Public ! # License as published by the Free Software Foundation; either ! # version 2 of the License, or (at your option) any later version. ! # ! # This library is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! # Lesser General Public License for more details. # ! # You should have received a copy of the GNU Lesser General Public ! # License along with this library; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # ! # $Id$ # --- 1,10 ---- # ! # = bio/db/pdb.rb - PDB database classes # ! # Copyright:: Copyright (C) 2004 ! # GOTO Naohisa ! # License:: Ruby's # ! # $Id$ # From k at dev.open-bio.org Thu Mar 29 08:50:51 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 29 Mar 2007 12:50:51 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db/pdb atom.rb, 1.6, 1.7 chain.rb, 1.6, 1.7 chemicalcomponent.rb, 1.1, 1.2 model.rb, 1.7, 1.8 pdb.rb, 1.19, 1.20 residue.rb, 1.10, 1.11 utils.rb, 1.5, 1.6 Message-ID: <200703291250.l2TCopnB011679@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db/pdb In directory dev.open-bio.org:/tmp/cvs-serv11658/db/pdb Modified Files: atom.rb chain.rb chemicalcomponent.rb model.rb pdb.rb residue.rb utils.rb Log Message: * license is changed from LGPL to Ruby's with permission from authors Index: atom.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb/atom.rb,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** atom.rb 8 Jan 2006 12:59:04 -0000 1.6 --- atom.rb 29 Mar 2007 12:50:49 -0000 1.7 *************** *** 5,27 **** # Alex Gutteridge # Naohisa Goto ! # License:: LGPL ! # ! # $Id$ ! # ! #-- ! # This library is free software; you can redistribute it and/or ! # modify it under the terms of the GNU Lesser General Public ! # License as published by the Free Software Foundation; either ! # version 2 of the License, or (at your option) any later version. ! # ! # This library is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! # Lesser General Public License for more details. # ! # You should have received a copy of the GNU Lesser General Public ! # License along with this library; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! #++ # # = Bio::PDB::Coordinate --- 5,11 ---- # Alex Gutteridge # Naohisa Goto ! # License:: Ruby's # ! # $Id$ # # = Bio::PDB::Coordinate Index: residue.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb/residue.rb,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** residue.rb 20 Jan 2006 13:54:08 -0000 1.10 --- residue.rb 29 Mar 2007 12:50:49 -0000 1.11 *************** *** 5,27 **** # Alex Gutteridge # Naohisa Goto ! # License:: LGPL ! # ! # $Id$ ! # ! #-- ! # This library is free software; you can redistribute it and/or ! # modify it under the terms of the GNU Lesser General Public ! # License as published by the Free Software Foundation; either ! # version 2 of the License, or (at your option) any later version. ! # ! # This library is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! # Lesser General Public License for more details. # ! # You should have received a copy of the GNU Lesser General Public ! # License along with this library; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! #++ # # = Bio::PDB::Residue --- 5,11 ---- # Alex Gutteridge # Naohisa Goto ! # License:: Ruby's # ! # $Id$ # # = Bio::PDB::Residue Index: model.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb/model.rb,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** model.rb 20 Jan 2006 13:54:08 -0000 1.7 --- model.rb 29 Mar 2007 12:50:49 -0000 1.8 *************** *** 5,27 **** # Alex Gutteridge # Naohisa Goto ! # License:: LGPL ! # ! # $Id$ ! # ! #-- ! # This library is free software; you can redistribute it and/or ! # modify it under the terms of the GNU Lesser General Public ! # License as published by the Free Software Foundation; either ! # version 2 of the License, or (at your option) any later version. ! # ! # This library is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! # Lesser General Public License for more details. # ! # You should have received a copy of the GNU Lesser General Public ! # License along with this library; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! #++ # # = Bio::PDB::Model --- 5,11 ---- # Alex Gutteridge # Naohisa Goto ! # License:: Ruby's # ! # $Id$ # # = Bio::PDB::Model Index: pdb.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb/pdb.rb,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** pdb.rb 28 Mar 2007 10:25:17 -0000 1.19 --- pdb.rb 29 Mar 2007 12:50:49 -0000 1.20 *************** *** 5,28 **** # GOTO Naohisa # Alex Gutteridge ! # License:: LGPL # # $Id$ # - #-- - # This library is free software; you can redistribute it and/or - # modify it under the terms of the GNU Lesser General Public - # License as published by the Free Software Foundation; either - # version 2 of the License, or (at your option) any later version. - # - # This library is distributed in the hope that it will be useful, - # but WITHOUT ANY WARRANTY; without even the implied warranty of - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - # Lesser General Public License for more details. - # - # You should have received a copy of the GNU Lesser General Public - # License along with this library; if not, write to the Free Software - # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - #++ - # # = About Bio::PDB # --- 5,12 ---- # GOTO Naohisa # Alex Gutteridge ! # License:: Ruby's # # $Id$ # # = About Bio::PDB # Index: utils.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb/utils.rb,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** utils.rb 8 Jan 2006 12:59:04 -0000 1.5 --- utils.rb 29 Mar 2007 12:50:49 -0000 1.6 *************** *** 5,27 **** # Alex Gutteridge # Naohisa Goto ! # License:: LGPL ! # ! # $Id$ ! # ! #-- ! # This library is free software; you can redistribute it and/or ! # modify it under the terms of the GNU Lesser General Public ! # License as published by the Free Software Foundation; either ! # version 2 of the License, or (at your option) any later version. ! # ! # This library is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! # Lesser General Public License for more details. # ! # You should have received a copy of the GNU Lesser General Public ! # License along with this library; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! #++ # # = Bio::PDB::Utils --- 5,11 ---- # Alex Gutteridge # Naohisa Goto ! # License:: Ruby's # ! # $Id$ # # = Bio::PDB::Utils Index: chemicalcomponent.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb/chemicalcomponent.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** chemicalcomponent.rb 29 Jan 2006 06:54:13 -0000 1.1 --- chemicalcomponent.rb 29 Mar 2007 12:50:49 -0000 1.2 *************** *** 4,26 **** # Copyright:: Copyright (C) 2006 # GOTO Naohisa ! # License:: LGPL ! # ! # $Id$ ! # ! #-- ! # This library is free software; you can redistribute it and/or ! # modify it under the terms of the GNU Lesser General Public ! # License as published by the Free Software Foundation; either ! # version 2 of the License, or (at your option) any later version. ! # ! # This library is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! # Lesser General Public License for more details. # ! # You should have received a copy of the GNU Lesser General Public ! # License along with this library; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! #++ # # = About Bio::PDB::ChemicalComponent --- 4,10 ---- # Copyright:: Copyright (C) 2006 # GOTO Naohisa ! # License:: Ruby's # ! # $Id$ # # = About Bio::PDB::ChemicalComponent Index: chain.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb/chain.rb,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** chain.rb 20 Jan 2006 13:54:08 -0000 1.6 --- chain.rb 29 Mar 2007 12:50:49 -0000 1.7 *************** *** 5,27 **** # Alex Gutteridge # Naohisa Goto ! # License:: LGPL # ! # $Id$ ! # ! #-- ! # This library is free software; you can redistribute it and/or ! # modify it under the terms of the GNU Lesser General Public ! # License as published by the Free Software Foundation; either ! # version 2 of the License, or (at your option) any later version. ! # ! # This library is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! # Lesser General Public License for more details. ! # ! # You should have received a copy of the GNU Lesser General Public ! # License along with this library; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! #++ # # = Bio::PDB::Chain --- 5,11 ---- # Alex Gutteridge # Naohisa Goto ! # License:: Ruby's # ! # $Id$ # # = Bio::PDB::Chain From k at dev.open-bio.org Thu Mar 29 08:52:56 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 29 Mar 2007 12:52:56 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/util sirna.rb,1.9,1.10 Message-ID: <200703291252.l2TCqua5011790@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/util In directory dev.open-bio.org:/tmp/cvs-serv11770/util Modified Files: sirna.rb Log Message: * removed LGPL notice as the license of this module is changed to Ruby's Index: sirna.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/sirna.rb,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** sirna.rb 22 Feb 2007 17:38:41 -0000 1.9 --- sirna.rb 29 Mar 2007 12:52:54 -0000 1.10 *************** *** 39,60 **** # Nature Biotech. 2004 22: 326-330. # - #-- - # - # This library is free software; you can redistribute it and/or - # modify it under the terms of the GNU Lesser General Public - # License as published by the Free Software Foundation; either - # version 2 of the License, or (at your option) any later version. - # - # This library is distributed in the hope that it will be useful, - # but WITHOUT ANY WARRANTY; without even the implied warranty of - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - # Lesser General Public License for more details. - # - # You should have received a copy of the GNU Lesser General Public - # License along with this library; if not, write to the Free Software - # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - # - #++ - # require 'bio/sequence' --- 39,42 ---- From nakao at dev.open-bio.org Thu Mar 29 09:08:48 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Thu, 29 Mar 2007 13:08:48 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio/appl test_fasta.rb,1.1,1.2 Message-ID: <200703291308.l2TD8mY1012008@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio/appl In directory dev.open-bio.org:/tmp/cvs-serv11988/test/unit/bio/appl Modified Files: test_fasta.rb Log Message: * Changed license (GPL2 -> Ruby's). Index: test_fasta.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/unit/bio/appl/test_fasta.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_fasta.rb 18 Dec 2005 16:50:20 -0000 1.1 --- test_fasta.rb 29 Mar 2007 13:08:46 -0000 1.2 *************** *** 2,20 **** # test/unit/bio/appl/test_fasta.rb - Unit test for Bio::Fasta # ! # Copyright (C) 2005 Mitsuteru Nakao ! # ! # This library is free software; you can redistribute it and/or ! # modify it under the terms of the GNU Lesser General Public ! # License as published by the Free Software Foundation; either ! # version 2 of the License, or (at your option) any later version. ! # ! # This library is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! # Lesser General Public License for more details. ! # ! # You should have received a copy of the GNU Lesser General Public ! # License along with this library; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # $Id$ --- 2,8 ---- # test/unit/bio/appl/test_fasta.rb - Unit test for Bio::Fasta # ! # Copyright:: Copyright (C) 2006 ! # Mitsuteru C. Nakao ! # License:: Ruby's # # $Id$ From nakao at dev.open-bio.org Thu Mar 29 10:14:19 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Thu, 29 Mar 2007 14:14:19 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io ensembl.rb,1.9,1.10 Message-ID: <200703291414.l2TEEJPS012260@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv12238/lib/bio/io Modified Files: ensembl.rb Log Message: * Added backward-conpatibility classes and test codes. Index: ensembl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/ensembl.rb,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ensembl.rb 29 Mar 2007 08:00:04 -0000 1.9 --- ensembl.rb 29 Mar 2007 14:14:17 -0000 1.10 *************** *** 179,183 **** end ! if aqrgs[4].class == Hash options.update(args[4]) end --- 179,183 ---- end ! if args[4].class == Hash options.update(args[4]) end *************** *** 196,197 **** --- 196,229 ---- + + # Codes for backward-compatibility. + # + class Bio::Ensembl + EBIServerURI = ENSEMBL_URL + + def self.server_uri(uri = nil) + if uri + @uri = uri + else + @uri || EBIServerURI + end + end + + class Base + def self.exportview(*args) + Bio::Ensembl.new(Organism).exportview(*args) + end + end + + class Human < Base + Organism = Bio::Ensembl.human.organism + end + + class Mouse < Base + Organism = Bio::Ensembl.mouse.organism + end + end # class Bio::Ensembl + + + + From nakao at dev.open-bio.org Thu Mar 29 10:14:19 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Thu, 29 Mar 2007 14:14:19 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio/io test_ensembl.rb,1.4,1.5 Message-ID: <200703291414.l2TEEJQh012265@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio/io In directory dev.open-bio.org:/tmp/cvs-serv12238/test/unit/bio/io Modified Files: test_ensembl.rb Log Message: * Added backward-conpatibility classes and test codes. Index: test_ensembl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/unit/bio/io/test_ensembl.rb,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_ensembl.rb 28 Mar 2007 12:24:30 -0000 1.4 --- test_ensembl.rb 29 Mar 2007 14:14:17 -0000 1.5 *************** *** 96,97 **** --- 96,109 ---- end end + + + class TestEnsemblOldStyleClient < Test::Unit::TestCase + class Rice < Bio::Ensembl::Base + Organism = 'Oryza_sativa' + end + + def test_organism + assert_equal('Oryza_sativa', Rice::Organism) + end + end + From k at dev.open-bio.org Fri Mar 30 18:26:17 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Fri, 30 Mar 2007 22:26:17 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/appl/hmmer report.rb,1.11,1.12 Message-ID: <200703302226.l2UMQHT2019621@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/appl/hmmer In directory dev.open-bio.org:/tmp/cvs-serv19607/lib/bio/appl/hmmer Modified Files: report.rb Log Message: * license is changed to Ruby's with permission from authors Index: report.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/hmmer/report.rb,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** report.rb 31 Dec 2006 21:53:32 -0000 1.11 --- report.rb 30 Mar 2007 22:26:15 -0000 1.12 *************** *** 6,10 **** # Copyright:: Copyright (C) 2005 # Masashi Fujita ! # License:: LGPL # # $Id$ --- 6,10 ---- # Copyright:: Copyright (C) 2005 # Masashi Fujita ! # License:: Ruby's # # $Id$ *************** *** 39,60 **** # http://hmmer.wustl.edu/ # - #-- - # - # This library is free software; you can redistribute it and/or - # modify it under the terms of the GNU Lesser General Public - # License as published by the Free Software Foundation; either - # version 2 of the License, or (at your option) any later version. - # - # This library is distributed in the hope that it will be useful, - # but WITHOUT ANY WARRANTY; without even the implied warranty of - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - # Lesser General Public License for more details. - # - # You should have received a copy of the GNU Lesser General Public - # License along with this library; if not, write to the Free Software - # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - # - #++ - # require 'bio/appl/hmmer' --- 39,42 ---- From k at dev.open-bio.org Thu Mar 8 00:04:00 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 08 Mar 2007 00:04:00 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates bioruby.css, 1.2, 1.3 Message-ID: <200703080004.l28040Qq013745@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-serv13741/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates Modified Files: bioruby.css Log Message: * better font size for textarea, leftified h1 Index: bioruby.css =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/bioruby.css,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** bioruby.css 16 Jan 2007 05:47:05 -0000 1.2 --- bioruby.css 8 Mar 2007 00:03:58 -0000 1.3 *************** *** 136,145 **** h1 { ! font-size: 200%; color: #ffffff; background-color: #6e8377; line-height: 64px; ! text-align: right; ! padding-right: 20px; } --- 136,145 ---- h1 { ! font-size: 180%; color: #ffffff; background-color: #6e8377; line-height: 64px; ! text-align: left; ! padding-left: 20px; } *************** *** 212,215 **** --- 212,216 ---- textarea { font-family: monospace; + font-size: 100%; overflow: auto; } From k at dev.open-bio.org Thu Mar 8 00:10:07 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 08 Mar 2007 00:10:07 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg compound.rb,0.13,0.14 Message-ID: <200703080010.l280A7KM013862@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg In directory dev.open-bio.org:/tmp/cvs-serv13858 Modified Files: compound.rb Log Message: * glycans method is added * names method is changed to return array of strings which ';' is strippe and surrounding spaces are consumed Index: compound.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/compound.rb,v retrieving revision 0.13 retrieving revision 0.14 diff -C2 -d -r0.13 -r0.14 *** compound.rb 15 Jan 2007 04:34:32 -0000 0.13 --- compound.rb 8 Mar 2007 00:10:05 -0000 0.14 *************** *** 32,39 **** # NAME def names ! lines_fetch('NAME') end def name ! names[0] end --- 32,40 ---- # NAME def names ! field_fetch('NAME').split(/\s*;\s*/) end + def name ! names.first end *************** *** 48,51 **** --- 49,60 ---- end + # GLYCAN + def glycans + unless @data['GLYCAN'] + @data['GLYCAN'] = fetch('GLYCAN').split(/\s+/) + end + @data['GLYCAN'] + end + # REACTION def reactions From k at dev.open-bio.org Thu Mar 8 00:10:52 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 08 Mar 2007 00:10:52 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg genes.rb,0.23,0.24 Message-ID: <200703080010.l280AqLP013905@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg In directory dev.open-bio.org:/tmp/cvs-serv13901 Modified Files: genes.rb Log Message: * orthologs method is added Index: genes.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/genes.rb,v retrieving revision 0.23 retrieving revision 0.24 diff -C2 -d -r0.23 -r0.24 *** genes.rb 25 Jul 2006 19:12:32 -0000 0.23 --- genes.rb 8 Mar 2007 00:10:50 -0000 0.24 *************** *** 137,140 **** --- 137,144 ---- end + def orthologs + lines_fetch('ORTHOLOG') + end + def pathway field_fetch('PATHWAY') From k at dev.open-bio.org Thu Mar 8 00:11:51 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 08 Mar 2007 00:11:51 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg drug.rb,NONE,1.1 Message-ID: <200703080011.l280BpJA013948@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg In directory dev.open-bio.org:/tmp/cvs-serv13944 Added Files: drug.rb Log Message: * newly added KEGG DRUG parser --- NEW FILE: drug.rb --- # # = bio/db/kegg/drug.rb - KEGG DRUG database class # # Copyright:: Copyright (C) 2007 Toshiaki Katayama # License:: Ruby's # # $Id: drug.rb,v 1.1 2007/03/08 00:11:49 k Exp $ # require 'bio/db' module Bio class KEGG class DRUG < KEGGDB DELIMITER = RS = "\n///\n" TAGSIZE = 12 def initialize(entry) super(entry, TAGSIZE) end # ENTRY def entry_id unless @data['ENTRY'] @data['ENTRY'] = fetch('ENTRY').split(/\s+/).first end @data['ENTRY'] end # NAME def names field_fetch('NAME').split(/\s*;\s*/) end def name names.first end # FORMULA def formula field_fetch('FORMULA') end # MASS def mass field_fetch('MASS').to_f end # ACTIVITY def activity field_fetch('ACTIVITY') end # REMARK def remark field_fetch('REMARK') end # COMMENT def comment field_fetch('COMMENT') end # PATHWAY def pathways lines_fetch('DBLINKS') end # DBLINKS def dblinks lines_fetch('DBLINKS') end # ATOM, BOND def kcf return "#{get('ATOM')}#{get('BOND')}" end end # DRUG end # KEGG end # Bio if __FILE__ == $0 entry = ARGF.read # dr:D00001 dr = Bio::KEGG::DRUG.new(entry) p dr.entry_id p dr.names p dr.name p dr.formula p dr.mass p dr.activity p dr.remark p dr.comment p dr.dblinks p dr.kcf end From k at dev.open-bio.org Thu Mar 8 00:14:18 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 08 Mar 2007 00:14:18 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg glycan.rb,1.3,1.4 Message-ID: <200703080014.l280EITo013991@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg In directory dev.open-bio.org:/tmp/cvs-serv13987 Modified Files: glycan.rb Log Message: * bindings method is removed * comment and remarks methods are added * orthologs and dblinks methods are changed to use lines_fetch Index: glycan.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/glycan.rb,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** glycan.rb 19 Sep 2006 05:53:13 -0000 1.3 --- glycan.rb 8 Mar 2007 00:14:16 -0000 1.4 *************** *** 64,84 **** end - # BINDING - def bindings - unless @data['BINDING'] - ary = Array.new - lines = lines_fetch('BINDING') - lines.each do |line| - if /^\S/.match(line) - ary << line - else - ary.last << " #{line.strip}" - end - end - @data['BINDING'] = ary - end - @data['BINDING'] - end - # COMPOUND def compounds --- 64,67 ---- *************** *** 118,135 **** def orthologs unless @data['ORTHOLOG'] ! ary = Array.new ! lines = lines_fetch('ORTHOLOG') ! lines.each do |line| ! if /^\S/.match(line) ! ary << line ! else ! ary.last << " #{line.strip}" ! end ! end ! @data['ORTHOLOG'] = ary end @data['ORTHOLOG'] end # REFERENCE def references --- 101,119 ---- def orthologs unless @data['ORTHOLOG'] ! @data['ORTHOLOG'] = lines_fetch('ORTHOLOG') end @data['ORTHOLOG'] end + # COMMENT + def comment + field_fetch('COMMENT') + end + + # REMARK + def remark + field_fetch('REMARK') + end + # REFERENCE def references *************** *** 152,165 **** def dblinks unless @data['DBLINKS'] ! ary = Array.new ! lines = lines_fetch('DBLINKS') ! lines.each do |line| ! if /^\S/.match(line) ! ary << line ! else ! ary.last << " #{line.strip}" ! end ! end ! @data['DBLINKS'] = ary end @data['DBLINKS'] --- 136,140 ---- def dblinks unless @data['DBLINKS'] ! @data['DBLINKS'] = lines_fetch('DBLINKS') end @data['DBLINKS'] From k at dev.open-bio.org Thu Mar 8 00:20:23 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 08 Mar 2007 00:20:23 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg ortholog.rb, NONE, 1.1 ko.rb, 1.6, NONE Message-ID: <200703080020.l280KNX8014070@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg In directory dev.open-bio.org:/tmp/cvs-serv14066 Added Files: ortholog.rb Removed Files: ko.rb Log Message: * Recently, KEGG KO database is renamed to KEGG ORTHOLOG, so we follow the change as * ko.rb is renamed to ortholog.rb * Bio::KEGG::KO is renamed to Bio::KEGG::ORTHOLOG * genes and dblinks methods are rewrited to use lines_fetch --- NEW FILE: ortholog.rb --- # # = bio/db/kegg/ortholog.rb - KEGG ORTHOLOG database class # # Copyright:: Copyright (C) 2003-2007 Toshiaki Katayama # Copyright:: Copyright (C) 2003 Masumi Itoh # # $Id: ortholog.rb,v 1.1 2007/03/08 00:20:21 k Exp $ # require 'bio/db' module Bio class KEGG # == Description # # KO (KEGG Orthology) entry parser. # # == References # # * http://www.genome.jp/dbget-bin/get_htext?KO # * ftp://ftp.genome.jp/pub/kegg/tarfiles/ko # class ORTHOLOG < KEGGDB DELIMITER = RS = "\n///\n" TAGSIZE = 12 # Reads a flat file format entry of the KO database. def initialize(entry) super(entry, TAGSIZE) end # Returns ID of the entry. def entry_id field_fetch('ENTRY')[/\S+/] end # Returns NAME field of the entry. def name field_fetch('NAME') end # Returns an Array of names in NAME field. def names name.split(', ') end # Returns DEFINITION field of the entry. def definition field_fetch('DEFINITION') end # Returns CLASS field of the entry. def keggclass field_fetch('CLASS') end # Returns an Array of biological classes in CLASS field. def keggclasses keggclass.gsub(/ \[[^\]]+/, '').split(/\] ?/) end # Returns an Array of KEGG/PATHWAY ID in CLASS field. def pathways keggclass.scan(/\[PATH:(.*?)\]/).flatten end # Returns a Hash of Array of a database name and entry IDs in DBLINKS field. def dblinks unless @data['DBLINKS'] @data['DBLINKS'] = lines_fetch('DBLINKS') end @data['DBLINKS'] end # Returns a Hash of Array of the organism ID and entry IDs in GENES field. def genes unless @data['GENES'] @data['GENES'] = lines_fetch('GENES') end @data['DBLINKS'] end end # KO end # KEGG end # Bio if __FILE__ == $0 require 'bio/io/fetch' flat = Bio::Fetch.query('ko', 'K00001') entry = Bio::KEGG::KO.new(flat) p entry.entry_id p entry.name p entry.names p entry.definition p entry.keggclass p entry.keggclasses p entry.pathways p entry.dblinks p entry.genes end --- ko.rb DELETED --- From k at dev.open-bio.org Thu Mar 8 00:25:28 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 08 Mar 2007 00:25:28 +0000 Subject: [BioRuby-cvs] bioruby/lib bio.rb,1.81,1.82 Message-ID: <200703080025.l280PS0b014113@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib In directory dev.open-bio.org:/tmp/cvs-serv14109 Modified Files: bio.rb Log Message: * Bio::KEGG::DRUG is added * Bio::KEGG::KO is renamed to Bio::KEGG::ORTHOLOG Index: bio.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio.rb,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** bio.rb 2 Feb 2007 06:13:10 -0000 1.81 --- bio.rb 8 Mar 2007 00:25:26 -0000 1.82 *************** *** 89,92 **** --- 89,93 ---- autoload :ENZYME, 'bio/db/kegg/enzyme' autoload :COMPOUND, 'bio/db/kegg/compound' + autoload :DRUG, 'bio/db/kegg/drug' autoload :GLYCAN, 'bio/db/kegg/glycan' autoload :REACTION, 'bio/db/kegg/reaction' *************** *** 94,100 **** autoload :CELL, 'bio/db/kegg/cell' autoload :EXPRESSION, 'bio/db/kegg/expression' ! autoload :Keggtab, 'bio/db/kegg/keggtab' ! autoload :KO, 'bio/db/kegg/ko' autoload :KGML, 'bio/db/kegg/kgml' end --- 95,101 ---- autoload :CELL, 'bio/db/kegg/cell' autoload :EXPRESSION, 'bio/db/kegg/expression' ! autoload :ORTHOLOG, 'bio/db/kegg/ortholog' autoload :KGML, 'bio/db/kegg/kgml' + autoload :Keggtab, 'bio/db/kegg/keggtab' end From k at dev.open-bio.org Thu Mar 8 00:27:20 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 08 Mar 2007 00:27:20 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io flatfile.rb,1.55,1.56 Message-ID: <200703080027.l280RK2N014156@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv14152 Modified Files: flatfile.rb Log Message: * Bio::KEGG::DRUG is added * Bio::KEGG::KO is renamed to Bio::KEGG::ORTHOLOG Index: flatfile.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/flatfile.rb,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** flatfile.rb 12 Feb 2007 09:59:37 -0000 1.55 --- flatfile.rb 8 Mar 2007 00:27:18 -0000 1.56 *************** *** 1145,1150 **** brite = RuleRegexp[ 'Bio::KEGG::BRITE', /^Entry [A-Z0-9]+/ ], ! ko = RuleRegexp[ 'Bio::KEGG::KO', /^ENTRY .+ KO\s*/ ], glycan = RuleRegexp[ 'Bio::KEGG::GLYCAN', /^ENTRY .+ Glycan\s*/ ], --- 1145,1152 ---- brite = RuleRegexp[ 'Bio::KEGG::BRITE', /^Entry [A-Z0-9]+/ ], ! ortholog = RuleRegexp[ 'Bio::KEGG::ORTHOLOG', /^ENTRY .+ KO\s*/ ], + drug = RuleRegexp[ 'Bio::KEGG::DRUG', + /^ENTRY .+ Drug\s*/ ], glycan = RuleRegexp[ 'Bio::KEGG::GLYCAN', /^ENTRY .+ Glycan\s*/ ], *************** *** 1247,1252 **** #aaindex.is_prior_to litdb #litdb.is_prior_to brite ! brite.is_prior_to ko ! ko.is_prior_to glycan glycan.is_prior_to enzyme enzyme.is_prior_to compound --- 1249,1255 ---- #aaindex.is_prior_to litdb #litdb.is_prior_to brite ! brite.is_prior_to ortholog ! ortholog.is_prior_to drug ! drug.is_prior_to glycan glycan.is_prior_to enzyme enzyme.is_prior_to compound From k at dev.open-bio.org Thu Mar 8 08:30:18 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 08 Mar 2007 08:30:18 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg ortholog.rb,1.1,1.2 Message-ID: <200703080830.l288UIfN014845@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg In directory dev.open-bio.org:/tmp/cvs-serv14841 Modified Files: ortholog.rb Log Message: * fixed a bug in genes method Index: ortholog.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/kegg/ortholog.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ortholog.rb 8 Mar 2007 00:20:21 -0000 1.1 --- ortholog.rb 8 Mar 2007 08:30:15 -0000 1.2 *************** *** 80,84 **** @data['GENES'] = lines_fetch('GENES') end ! @data['DBLINKS'] end --- 80,84 ---- @data['GENES'] = lines_fetch('GENES') end ! @data['GENES'] end From nakao at dev.open-bio.org Tue Mar 13 17:03:57 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Tue, 13 Mar 2007 17:03:57 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db/embl embl.rb,1.27,1.28 Message-ID: <200703131703.l2DH3vWq007326@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db/embl In directory dev.open-bio.org:/tmp/cvs-serv7300/lib/bio/db/embl Modified Files: embl.rb Log Message: * Fixed a bug for parsing id_line in the EMBL release 89 format reported by Michael Han. * Added the unit test and data files for EMBL release 89 format. Index: embl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/embl/embl.rb,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** embl.rb 14 Apr 2006 05:49:30 -0000 1.27 --- embl.rb 13 Mar 2007 17:03:55 -0000 1.28 *************** *** 3,7 **** # # ! # Copyright:: Copyright (C) 2001-2006 Mitsuteru C. Nakao # License:: Ruby's # --- 3,7 ---- # # ! # Copyright:: Copyright (C) 2001-2007 Mitsuteru C. Nakao # License:: Ruby's # *************** *** 41,45 **** # where is: # {'ENTRY_NAME' => String, 'MOLECULE_TYPE' => String, 'DIVISION' => String, ! # 'SEQUENCE_LENGTH' => Int} # # ID Line --- 41,45 ---- # where is: # {'ENTRY_NAME' => String, 'MOLECULE_TYPE' => String, 'DIVISION' => String, ! # 'SEQUENCE_LENGTH' => Int, 'SEQUENCE_VERSION' => Int} # # ID Line *************** *** 70,81 **** # VRL (Viruses) # def id_line(key=nil) unless @data['ID'] tmp = Hash.new idline = fetch('ID').split(/; +/) ! tmp['ENTRY_NAME'], tmp['DATA_CLASS'] = idline[0].split(/ +/) ! tmp['MOLECULE_TYPE'] = idline[1] ! tmp['DIVISION'] = idline[2] ! tmp['SEQUENCE_LENGTH'] = idline[3].strip.split(' ').first.to_i @data['ID'] = tmp --- 70,98 ---- # VRL (Viruses) # + # Rel 89- + # ID CD789012; SV 4; linear; genomic DNA; HTG; MAM; 500 BP. + # ID <1>; SV <2>; <3>; <4>; <5>; <6>; <7> BP. + # 1. Primary accession number + # 2. Sequence version number + # 3. Topology: 'circular' or 'linear' + # 4. Molecule type (see note 1 below) + # 5. Data class (see section 3.1) + # 6. Taxonomic division (see section 3.2) + # 7. Sequence length (see note 2 below) def id_line(key=nil) unless @data['ID'] tmp = Hash.new idline = fetch('ID').split(/; +/) ! tmp['ENTRY_NAME'], tmp['DATA_CLASS'] = idline.shift.split(/ +/) ! if idline.first =~ /^SV/ ! tmp['SEQUENCE_VERSION'] = idline.shift.split(' ').last ! tmp['TOPOLOGY'] = idline.shift ! tmp['MOLECULE_TYPE'] = idline.shift ! tmp['DATA_CLASS'] = idline.shift ! else ! tmp['MOLECULE_TYPE'] = idline.shift ! end ! tmp['DIVISION'] = idline.shift ! tmp['SEQUENCE_LENGTH'] = idline.shift.strip.split(' ').first.to_i @data['ID'] = tmp *************** *** 129,136 **** # SV Accession.Version def sv ! field_fetch('SV').sub(/;/,'') end def version ! sv.split(".")[1].to_i end --- 146,157 ---- # SV Accession.Version def sv ! if (v = field_fetch('SV').sub(/;/,'')) == "" ! [id_line['ENTRY_NAME'], id_line['SEQUENCE_VERSION']].join('.') ! else ! v ! end end def version ! (sv.split(".")[1] || id_line['SEQUENCE_VERSION']).to_i end From nakao at dev.open-bio.org Tue Mar 13 17:03:57 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Tue, 13 Mar 2007 17:03:57 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio/db/embl test_embl_rel89.rb, NONE, 1.1 Message-ID: <200703131703.l2DH3vCL007331@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio/db/embl In directory dev.open-bio.org:/tmp/cvs-serv7300/test/unit/bio/db/embl Added Files: test_embl_rel89.rb Log Message: * Fixed a bug for parsing id_line in the EMBL release 89 format reported by Michael Han. * Added the unit test and data files for EMBL release 89 format. --- NEW FILE: test_embl_rel89.rb --- # # test/unit/bio/db/embl/test_embl_rel89.rb - Unit test for Bio::EMBL # # Copyright:: Copyright (C) 2007 Mitsuteru Nakao # License:: Ruby's # # $Id: test_embl_rel89.rb,v 1.1 2007/03/13 17:03:55 nakao 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/db/embl/embl' module Bio class TestEMBL < Test::Unit::TestCase def setup bioruby_root = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 5)).cleanpath.to_s output = File.open(File.join(bioruby_root, 'test', 'data', 'embl', 'AB090716.embl.rel89')).read @obj = Bio::EMBL.new(output) end # http://www.ebi.ac.uk/embl/Documentation/User_manual/usrman.html#s_3_4_1 def test_id_line assert(@obj.id_line) end def test_id_line_iterator assert(@obj.id_line {|key, value| }) end def test_id_line_entry_name assert_equal('AB090716', @obj.id_line('ENTRY_NAME')) end def test_id_line_data_class assert_equal('STD', @obj.id_line('DATA_CLASS')) end def test_id_line_sequence_version assert_equal('1', @obj.id_line('SEQUENCE_VERSION')) end def test_id_line_molecule_type assert_equal('genomic DNA', @obj.id_line('MOLECULE_TYPE')) end def test_id_line_division assert_equal('VRT', @obj.id_line('DIVISION')) end def test_id_line_sequence_length assert_equal(166, @obj.id_line('SEQUENCE_LENGTH')) end def test_entry entry_id = 'AB090716' assert_equal(entry_id, @obj.entry) assert_equal(entry_id, @obj.entry_name) assert_equal(entry_id, @obj.entry_id) end def test_molecule molecule = 'genomic DNA' assert_equal(molecule, @obj.molecule) assert_equal(molecule, @obj.molecule_type) end def test_division assert_equal('VRT', @obj.division) end def test_sequence_length seqlen = 166 assert_equal(seqlen, @obj.sequence_length) assert_equal(seqlen, @obj.seqlen) end # Bio::EMBLDB::COMMON#ac def test_ac ac = ['AB090716'] assert_equal(ac, @obj.ac) assert_equal(ac, @obj.accessions) end # Bio::EMBLDB::COMMON#accession def test_accession assert_equal('AB090716', @obj.accession) end def test_sv assert_equal('AB090716.1', @obj.sv) end def test_version assert_equal(1, @obj.version) end def test_dt assert(@obj.dt) end def test_dt_iterator assert(@obj.dt {|key, value| }) end def test_dt_created assert_equal('25-OCT-2002 (Rel. 73, Created)', @obj.dt('created')) end def test_dt_updated assert_equal('14-NOV-2006 (Rel. 89, Last updated, Version 3)', @obj.dt('updated')) end # Bio::EMBLDB::COMMON#de def test_de assert_equal("Haplochromis sp. 'muzu, rukwa' LWS gene for long wavelength-sensitive opsin, partial cds, specimen_voucher:specimen No. HT-9361.", @obj.de) end # Bio::EMBLDB::COMMON#kw def test_kw k = [] assert_equal([], @obj.kw) assert_equal([], @obj.keywords) end def test_os # assert_equal('', @obj.os) assert_raises(RuntimeError) { @obj.os } end def test_os_valid @obj.instance_eval { @data['OS'] = "Haplochromis sp. 'muzu rukwa'" } assert_equal("Haplochromis sp. 'muzu rukwa'", @obj.os) end # Bio::EMBLDB::COMMON#oc def test_oc assert_equal('Eukaryota', @obj.oc.first) end # Bio::EMBLDB::COMMON#og def test_og assert_equal([], @obj.og) end # Bio::EMBLDB::COMMON#ref def test_ref assert_equal(2, @obj.ref.size) end # Bio::EMBLDB::COMMON#references def test_references assert_equal(Bio::References, @obj.references.class) end # Bio::EMBLDB::COMMON#dr def test_dr assert_equal({}, @obj.dr) end def test_fh assert_equal('Key Location/Qualifiers', @obj.fh) end def test_ft assert_equal(Bio::Features, @obj.ft.class) end def test_ft_iterator @obj.ft.each do |feature| assert_equal(Bio::Feature, feature.class) end end def test_ft_accessor assert_equal('CDS', @obj.ft.features[1].feature) end def test_each_cds @obj.each_cds do |x| assert_equal('CDS', x.feature) end end def test_each_gene @obj.each_gene do |x| assert_equal('gene', x.feature) end end def test_cc assert_equal('', @obj.cc) end # def test_xx # end def test_sq data = {"a"=>29, "c"=>42, "ntlen"=>166, "g"=>41, "t"=>54, "other"=>0} assert_equal(data, @obj.sq) end def test_sq_get assert_equal(29, @obj.sq("a")) end def test_seq seq = 'gttctggcctcatggactgaagacttcctgtggacctgatgtgttcagtggaagtgaagaccctggagtacagtcctacatgattgttctcatgattacttgctgtttcatccccctggctatcatcatcctgtgctaccttgctgtgtggatggccatccgtgct' assert_equal(seq, @obj.seq) assert_equal(seq, @obj.naseq) assert_equal(seq, @obj.ntseq) end end end From nakao at dev.open-bio.org Tue Mar 13 17:03:57 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Tue, 13 Mar 2007 17:03:57 +0000 Subject: [BioRuby-cvs] bioruby/test/data/embl AB090716.embl.rel89,NONE,1.1 Message-ID: <200703131703.l2DH3vdZ007336@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/data/embl In directory dev.open-bio.org:/tmp/cvs-serv7300/test/data/embl Added Files: AB090716.embl.rel89 Log Message: * Fixed a bug for parsing id_line in the EMBL release 89 format reported by Michael Han. * Added the unit test and data files for EMBL release 89 format. --- NEW FILE: AB090716.embl.rel89 --- ID AB090716; SV 1; linear; genomic DNA; STD; VRT; 166 BP. XX AC AB090716; XX DT 25-OCT-2002 (Rel. 73, Created) DT 14-NOV-2006 (Rel. 89, Last updated, Version 3) XX DE Haplochromis sp. 'muzu, rukwa' LWS gene for long wavelength-sensitive DE opsin, partial cds, specimen_voucher:specimen No. HT-9361. XX KW . XX OS Haplochromis sp. 'muzu, rukwa' OC Eukaryota; Metazoa; Chordata; Craniata; Vertebrata; Euteleostomi; OC Actinopterygii; Neopterygii; Teleostei; Euteleostei; Neoteleostei; OC Acanthomorpha; Acanthopterygii; Percomorpha; Perciformes; Labroidei; OC Cichlidae; African cichlids; Pseudocrenilabrinae; Haplochromini; OC Haplochromis. XX RN [1] RP 1-166 RA Terai Y., Mayer W.E., Klein J., Tichy H., Okada N.; RT ; RL Submitted (26-AUG-2002) to the EMBL/GenBank/DDBJ databases. RL Yohey Terai, Tokyo Institute of Technology, Graduate School of Bioscience RL and Biotechnology; 4259 Nagatsuta-cho, Midori-ku, Yokohama, Kanagawa RL 226-8501, Japan (E-mail:yterai at bio.titech.ac.jp, Tel:81-45-924-5744, RL Fax:81-45-924-5835) XX RN [2] RX DOI; 10.1073/pnas.232561099. RX PUBMED; 12438648. RA Terai Y., Mayer W.E., Klein J., Tichy H., Okada N.; RT "The effect of selection on a long wavelength-sensitive (LWS) opsin gene of RT Lake Victoria cichlid fishes"; RL Proc. Natl. Acad. Sci. U.S.A. 99(24):15501-15506(2002). XX FH Key Location/Qualifiers FH FT source 1..166 FT /organism="Haplochromis sp. 'muzu, rukwa'" FT /mol_type="genomic DNA" FT /specimen_voucher="specimen No. HT-9361" FT /tissue_type="piece of fin" FT /db_xref="taxon:205497" FT CDS <1..>166 FT /codon_start=2 FT /gene="LWS" FT /product="long wavelength-sensitive opsin" FT /db_xref="UniProtKB/TrEMBL:Q8AUS6" FT /protein_id="BAC22028.1" FT /translation="FWPHGLKTSCGPDVFSGSEDPGVQSYMIVLMITCCFIPLAIIILC FT YLAVWMAIRA" FT exon 1..166 FT /gene="LWS" FT /product="long wavelength-sensitive opsin" FT /number=4 XX SQ Sequence 166 BP; 29 A; 42 C; 41 G; 54 T; 0 other; gttctggcct catggactga agacttcctg tggacctgat gtgttcagtg gaagtgaaga 60 ccctggagta cagtcctaca tgattgttct catgattact tgctgtttca tccccctggc 120 tatcatcatc ctgtgctacc ttgctgtgtg gatggccatc cgtgct 166 // From k at dev.open-bio.org Wed Mar 14 19:50:16 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 14 Mar 2007 19:50:16 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates bioruby_controller.rb, 1.2, 1.3 Message-ID: <200703141950.l2EJoGWr023012@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-serv23008/shell/rails/vendor/plugins/generators/bioruby/templates Modified Files: bioruby_controller.rb Log Message: * to avoid error on Mongrel 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.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** bioruby_controller.rb 16 Jan 2007 05:47:05 -0000 1.2 --- bioruby_controller.rb 14 Mar 2007 19:50:14 -0000 1.3 *************** *** 11,17 **** ActiveSupport::CoreExtensions::Numeric::Bytes, ActiveSupport::CoreExtensions::Numeric::Time, ! WEBrick, Base64::Deprecated, Base64, PP::ObjectMixin, Bio::Shell ] HIDE_VARIABLES = [ --- 11,18 ---- ActiveSupport::CoreExtensions::Numeric::Bytes, ActiveSupport::CoreExtensions::Numeric::Time, ! Base64::Deprecated, Base64, PP::ObjectMixin, Bio::Shell ] + HIDE_MODULES << WEBrick if defined?(WEBrick) HIDE_VARIABLES = [ From k at dev.open-bio.org Wed Mar 14 19:54:53 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 14 Mar 2007 19:54:53 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/shell irb.rb,1.1,1.2 Message-ID: <200703141954.l2EJsrXp023073@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/shell In directory dev.open-bio.org:/tmp/cvs-serv23069/shell Modified Files: irb.rb Log Message: * activate rails environment (models) if rails is installed in the current project. this means you can use 'bioruby' command as a better './scriopt/console' shell having persistent history and object serialization. Index: irb.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/irb.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** irb.rb 24 Dec 2006 08:32:08 -0000 1.1 --- irb.rb 14 Mar 2007 19:54:51 -0000 1.2 *************** *** 48,51 **** --- 48,57 ---- return line end + + if File.exists?("./config/boot.rb") + require "./config/boot" + require "./config/environment" + #require 'commands/console' + end end From k at dev.open-bio.org Wed Mar 14 19:55:12 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 14 Mar 2007 19:55:12 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/shell web.rb,1.2,1.3 Message-ID: <200703141955.l2EJtC9o023098@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/shell In directory dev.open-bio.org:/tmp/cvs-serv23094/shell Modified Files: web.rb Log Message: * minor update Index: web.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/web.rb,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** web.rb 24 Dec 2006 08:32:08 -0000 1.2 --- web.rb 14 Mar 2007 19:55:10 -0000 1.3 *************** *** 31,35 **** puts ">>>" puts ! puts '(port # may differ if opts for rails are given "bioruby --web proj -- -p port")' puts end --- 31,35 ---- puts ">>>" puts ! puts '(You can change the port number by adding "-- -p 4000" option)' puts end From ngoto at dev.open-bio.org Mon Mar 26 17:09:47 2007 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Mon, 26 Mar 2007 17:09:47 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio command.rb,1.12,1.13 Message-ID: <200703261709.l2QH9lYD026611@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio In directory dev.open-bio.org:/tmp/cvs-serv26590/lib/bio Modified Files: command.rb Log Message: changed to handle exceptions and to do exit! to avoid failure on error (e.g. commmand not found) Index: command.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/command.rb,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** command.rb 14 Jul 2006 14:23:47 -0000 1.12 --- command.rb 26 Mar 2007 17:09:45 -0000 1.13 *************** *** 116,120 **** else # child ! Kernel.exec(*cmd) end end --- 116,126 ---- else # child ! begin ! Kernel.exec(*cmd) ! rescue Errno::ENOENT, Errno::EACCES ! Process.exit!(127) ! rescue Exception ! end ! Process.exit!(1) end end *************** *** 179,183 **** else # child ! Kernel.exec(*cmd) end end --- 185,195 ---- else # child ! begin ! Kernel.exec(*cmd) ! rescue Errno::ENOENT, Errno::EACCES ! Process.exit!(127) ! rescue Exception ! end ! Process.exit!(1) end end From ngoto at dev.open-bio.org Tue Mar 27 09:26:05 2007 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Tue, 27 Mar 2007 09:26:05 +0000 Subject: [BioRuby-cvs] bioruby ChangeLog,1.61,1.62 Message-ID: <200703270926.l2R9Q5P7028897@dev.open-bio.org> Update of /home/repository/bioruby/bioruby In directory dev.open-bio.org:/tmp/cvs-serv28875 Modified Files: ChangeLog Log Message: UniProt format autodetection was changed to follow the change of UniProtKB release 9.0 of 31-Oct-2006. Index: ChangeLog =================================================================== RCS file: /home/repository/bioruby/bioruby/ChangeLog,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** ChangeLog 12 Feb 2007 10:04:59 -0000 1.61 --- ChangeLog 27 Mar 2007 09:26:02 -0000 1.62 *************** *** 1,2 **** --- 1,14 ---- + 2007-03-27 Naohisa Goto + + * 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 From ngoto at dev.open-bio.org Tue Mar 27 09:26:05 2007 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Tue, 27 Mar 2007 09:26:05 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io flatfile.rb,1.56,1.57 Message-ID: <200703270926.l2R9Q5R5028900@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv28875/lib/bio/io Modified Files: flatfile.rb Log Message: UniProt format autodetection was changed to follow the change of UniProtKB release 9.0 of 31-Oct-2006. Index: flatfile.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/flatfile.rb,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** flatfile.rb 8 Mar 2007 00:27:18 -0000 1.56 --- flatfile.rb 27 Mar 2007 09:26:03 -0000 1.57 *************** *** 1120,1125 **** embl = RuleRegexp[ 'Bio::EMBL', /^ID .+\; .*(DNA|RNA|XXX)\;/ ], ! sptr = RuleRegexp[ 'Bio::SPTR', ! /^ID .+\; *PRT\;/ ], prosite = RuleRegexp[ 'Bio::PROSITE', /^ID [-A-Za-z0-9_\.]+\; (PATTERN|RULE|MATRIX)\.$/ ], --- 1120,1126 ---- embl = RuleRegexp[ 'Bio::EMBL', /^ID .+\; .*(DNA|RNA|XXX)\;/ ], ! sptr = RuleRegexp2[ 'Bio::SPTR', ! /^ID .+\; *PRT\;/, ! /^ID [-A-Za-z0-9_\.]+ .+\; *[0-9]+ *AA\./ ], prosite = RuleRegexp[ 'Bio::PROSITE', /^ID [-A-Za-z0-9_\.]+\; (PATTERN|RULE|MATRIX)\.$/ ], From ngoto at dev.open-bio.org Tue Mar 27 16:29:34 2007 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Tue, 27 Mar 2007 16:29:34 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db/pdb pdb.rb,1.16,1.17 Message-ID: <200703271629.l2RGTYPY003750@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db/pdb In directory dev.open-bio.org:/tmp/cvs-serv3725 Modified Files: pdb.rb Log Message: Atom name of ATOM record output changed to be more precisely (Mailing list: [BioRuby] Bug in writing PDB ATOM). For the purpose, private method justify_atomname was added to Bio::PDB::Record::ATOM. Index: pdb.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb/pdb.rb,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** pdb.rb 27 Jun 2006 14:23:45 -0000 1.16 --- pdb.rb 27 Mar 2007 16:29:32 -0000 1.17 *************** *** 1011,1020 **** end ! def to_s atomname = self.name.to_s elem = self.element.to_s.strip ! if elem.length == 1 and atomname.lstrip[0, 1] == elem then ! atomname = ' ' + atomname end sprintf("%-6s%5d %-4s%-1s%3s %-1s%4d%-1s %8.3f%8.3f%8.3f%6.2f%6.2f %-4s%2s%-2s\n", self.record_name, --- 1011,1063 ---- end ! def justify_atomname atomname = self.name.to_s + return atomname[0, 4] if atomname.length >= 4 + case atomname.length + when 0 + return ' ' + when 1 + return ' ' + atomname + ' ' + when 2 + if /\A[0-9]/ =~ atomname then + return sprintf('%-4s', atomname) + elsif /[0-9]\z/ =~ atomname then + return sprintf(' %-3s', atomname) + end + when 3 + if /\A[0-9]/ =~ atomname then + return sprintf('%-4s', atomname) + end + end + # ambiguous case for two- or three-letter name elem = self.element.to_s.strip ! if elem.size > 0 and i = atomname.index(elem) then ! if i == 0 and elem.size == 1 then ! return sprintf(' %-3s', atomname) ! else ! return sprintf('%-4s', atomname) ! end ! end ! if self.class == HETATM then ! if /\A(B[^AEHIKR]|C[^ADEFLMORSU]|F[^EMR]|H[^EFGOS]|I[^NR]|K[^R]|N[^ABDEIOP]|O[^S]|P[^ABDMORTU]|S[^BCEGIMNR]|V|W|Y[^B])/ =~ ! atomname then ! return sprintf(' %-3s', atomname) ! else ! return sprintf('%-4s', atomname) ! end ! else # ATOM ! if /\A[CHONS]/ =~ atomname then ! return sprintf(' %-3s', atomname) ! else ! return sprintf('%-4s', atomname) ! end end + # could not be reached here + raise 'bug!' + end + private :justify_atomname + + def to_s + atomname = justify_atomname sprintf("%-6s%5d %-4s%-1s%3s %-1s%4d%-1s %8.3f%8.3f%8.3f%6.2f%6.2f %-4s%2s%-2s\n", self.record_name, From ngoto at dev.open-bio.org Tue Mar 27 16:37:35 2007 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Tue, 27 Mar 2007 16:37:35 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db/pdb pdb.rb,1.17,1.18 Message-ID: <200703271637.l2RGbZDO003823@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db/pdb In directory dev.open-bio.org:/tmp/cvs-serv3803 Modified Files: pdb.rb Log Message: fixed a bug: Bio::PDB::Record::***.new.inspect fails. Index: pdb.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb/pdb.rb,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** pdb.rb 27 Mar 2007 16:29:32 -0000 1.17 --- pdb.rb 27 Mar 2007 16:37:33 -0000 1.18 *************** *** 355,359 **** # def do_parse ! return self if @parsed str = @str each_symbol do |key, klass, ranges| --- 355,359 ---- # def do_parse ! return self if @parsed or !@str str = @str each_symbol do |key, klass, ranges| *************** *** 991,995 **** def do_parse ! return self if @parsed self.serial = @str[6..10].to_i self.name = @str[12..15].strip --- 991,995 ---- def do_parse ! return self if @parsed or !@str self.serial = @str[6..10].to_i self.name = @str[12..15].strip From k at dev.open-bio.org Wed Mar 28 09:11:05 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 28 Mar 2007 09:11:05 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io ncbisoap.rb, 1.1, 1.2 ebisoap.rb, 1.1, 1.2 ddbjxml.rb, 1.12, 1.13 Message-ID: <200703280911.l2S9B525005842@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv5838/lib/bio/io Modified Files: ncbisoap.rb ebisoap.rb ddbjxml.rb Log Message: * assign default wsdl to Bio::DDBJ::XML, Bio::EBI::SOAP, Bio::NCBI::SOAP Index: ddbjxml.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/ddbjxml.rb,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ddbjxml.rb 19 Sep 2006 05:44:41 -0000 1.12 --- ddbjxml.rb 28 Mar 2007 09:11:02 -0000 1.13 *************** *** 28,31 **** --- 28,34 ---- BASE_URI = "http://xml.nig.ac.jp/wsdl/" + # set default to GetEntry + SERVER_URI = BASE_URI + "GetEntry.wsdl" + def initialize(wsdl = nil) super(wsdl || self.class::SERVER_URI) Index: ncbisoap.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/ncbisoap.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ncbisoap.rb 19 Sep 2006 05:41:45 -0000 1.1 --- ncbisoap.rb 28 Mar 2007 09:11:02 -0000 1.2 *************** *** 68,71 **** --- 68,74 ---- BASE_URI = "http://www.ncbi.nlm.nih.gov/entrez/eutils/soap/" + # set default to EUtils + SERVER_URI = BASE_URI + "eutils.wsdl" + def initialize(wsdl = nil) super(wsdl || self.class::SERVER_URI) Index: ebisoap.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/ebisoap.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ebisoap.rb 19 Sep 2006 05:41:45 -0000 1.1 --- ebisoap.rb 28 Mar 2007 09:11:02 -0000 1.2 *************** *** 18,21 **** --- 18,24 ---- BASE_URI = "http://www.ebi.ac.uk/Tools/webservices/wsdl/" + # set default to Dbfetch + SERVER_URI = BASE_URI + "WSDbfetch.wsdl" + def initialize(wsdl = nil) super(wsdl || self.class::SERVER_URI) From k at dev.open-bio.org Wed Mar 28 09:21:47 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 28 Mar 2007 09:21:47 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates bioruby_controller.rb, 1.3, 1.4 bioruby.css, 1.3, 1.4 index.rhtml, 1.2, 1.3 Message-ID: <200703280921.l2S9LljA006037@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-serv6033 Modified Files: bioruby_controller.rb bioruby.css index.rhtml Log Message: * restrict evaluation access only from localhost for security purpose Index: index.rhtml =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/index.rhtml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** index.rhtml 16 Jan 2007 05:47:05 -0000 1.2 --- index.rhtml 28 Mar 2007 09:21:45 -0000 1.3 *************** *** 1,3 **** --- 1,6 ----
+ <%- if flash[:notice] -%> +

<%= flash[:notice] %>


+ <%- end -%> <%= form_remote_tag(:url => {:action => "evaluate"}, :position => "top") %> BioRuby script 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.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** bioruby_controller.rb 14 Mar 2007 19:50:14 -0000 1.3 --- bioruby_controller.rb 28 Mar 2007 09:21:45 -0000 1.4 *************** *** 20,37 **** ] def evaluate ! begin ! @script = params[:script].strip ! # write out to history ! Bio::Shell.store_history(@script) ! # evaluate ruby script ! @result = eval(@script, Bio::Shell.cache[:binding]) ! # *TODO* need to handle with output of print/puts/p/pp etc. here ! @output = nil ! rescue ! @result = $! @output = nil end --- 20,50 ---- ] + SECURITY_NOTICE = "For security purposes, this functionality is only available to local requests." + + def index + unless local_request? + flash[:notice] = SECURITY_NOTICE + end + end + def evaluate ! if local_request? ! begin ! @script = params[:script].strip ! # write out to history ! Bio::Shell.store_history(@script) ! # evaluate ruby script ! @result = eval(@script, Bio::Shell.cache[:binding]) ! # *TODO* need to handle with output of print/puts/p/pp etc. here ! @output = nil ! rescue ! @result = $! ! @output = nil ! end ! else ! @result = SECURITY_NOTICE @output = nil end Index: bioruby.css =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/rails/vendor/plugins/generators/bioruby/templates/bioruby.css,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** bioruby.css 8 Mar 2007 00:03:58 -0000 1.3 --- bioruby.css 28 Mar 2007 09:21:45 -0000 1.4 *************** *** 16,19 **** --- 16,28 ---- } + div#notice { + background-color: #fcc; + border: 1px solid #f00; + } + div#notice p { + margin: 0; + padding: 10px; + } + pre { color: #6e8377; *************** *** 194,199 **** --- 203,214 ---- /* table */ + table { + border: 1px solid #cccccc; + border-collapse: collapse; + } + table#list_methods { width: 680px; + border: none; } *************** *** 208,211 **** --- 223,227 ---- } + /* textarea */ *************** *** 214,219 **** --- 230,237 ---- font-size: 100%; overflow: auto; + width: 80%; } + /* blockquote */ From ngoto at dev.open-bio.org Wed Mar 28 10:25:19 2007 From: ngoto at dev.open-bio.org (Naohisa Goto) Date: Wed, 28 Mar 2007 10:25:19 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db/pdb pdb.rb,1.18,1.19 Message-ID: <200703281025.l2SAPJCx006357@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db/pdb In directory dev.open-bio.org:/tmp/cvs-serv6337/lib/bio/db/pdb Modified Files: pdb.rb Log Message: In justify_atomname, changed to determine HETATM, and P is added to the 1-letter atoms when ATOM. Index: pdb.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb/pdb.rb,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** pdb.rb 27 Mar 2007 16:37:33 -0000 1.18 --- pdb.rb 28 Mar 2007 10:25:17 -0000 1.19 *************** *** 1039,1043 **** end end ! if self.class == HETATM then if /\A(B[^AEHIKR]|C[^ADEFLMORSU]|F[^EMR]|H[^EFGOS]|I[^NR]|K[^R]|N[^ABDEIOP]|O[^S]|P[^ABDMORTU]|S[^BCEGIMNR]|V|W|Y[^B])/ =~ atomname then --- 1039,1043 ---- end end ! if self.kind_of?(HETATM) then if /\A(B[^AEHIKR]|C[^ADEFLMORSU]|F[^EMR]|H[^EFGOS]|I[^NR]|K[^R]|N[^ABDEIOP]|O[^S]|P[^ABDMORTU]|S[^BCEGIMNR]|V|W|Y[^B])/ =~ atomname then *************** *** 1047,1051 **** end else # ATOM ! if /\A[CHONS]/ =~ atomname then return sprintf(' %-3s', atomname) else --- 1047,1051 ---- end else # ATOM ! if /\A[CHONSP]/ =~ atomname then return sprintf(' %-3s', atomname) else From k at dev.open-bio.org Wed Mar 28 10:31:50 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 28 Mar 2007 10:31:50 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io ensembl.rb,1.3,1.4 Message-ID: <200703281031.l2SAVoLC006384@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv6378/lib/bio/io Modified Files: ensembl.rb Log Message: * modified to use Bio::Command.post_form * newly introduced Bio::Ensembl.new accepts organism and server url as its argument, so that user does not need to create subclass. * several bug fixed Index: ensembl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/ensembl.rb,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ensembl.rb 14 Jul 2006 14:28:44 -0000 1.3 --- ensembl.rb 28 Mar 2007 10:31:48 -0000 1.4 *************** *** 39,53 **** # == Examples # ! # seq = Bio::Ensembl::Human.exportview(1, 1000, 100000) ! # gff = Bio::Ensembl::Human.exportview(1, 1000, 100000, ['gene']) # ! # seq = Bio::Ensembl::Mouse.exportview(1, 1000, 100000) ! # gff = Bio::Ensembl::Mouse.exportview(1, 1000, 100000, ['gene', 'variation', 'genscan']) # ! # Bio::Enesmbl.server_uri("http://www.gramene.org") ! # class Rice < Base ! # Organism = 'Oryza_sativa' ! # end ! # seq = Bio::Ensembl::Rice.exportview(1, 1000, 100000) # # == References --- 39,52 ---- # == Examples # ! # human = Bio::Ensembl.new('Homo_sapiens') ! # seq = human.exportview(1, 1000, 100000) ! # gff = human.exportview(1, 1000, 100000, ['gene']) # ! # mouse = Bio::Ensembl.new('Mus_musculus') ! # seq = mouse.exportview(1, 1000, 100000) ! # gff = mouse.exportview(1, 1000, 100000, ['gene', 'variation', 'genscan']) # ! # rice = Bio::Enesmbl.new('Oryza_sativa', 'http://www.gramene.org') ! # seq = rice.exportview(1, 1000, 100000) # # == References *************** *** 61,258 **** class Ensembl ! # Hostname of the Ensembl Genome Browser. ! EBIServerURI = 'http://www.ensembl.org' ! # An Alternative Hostname for Ensembl Genome Browser. ! @@server_uri = nil ! # Sets and uses an alternative hostname for ensembl genome browser. ! # ! # == Example ! # ! # require 'bio' ! # p Bio::Enesmbl.server_uri #=> 'http://www.ensembl.org' ! # Bio::Enesmbl.server_uri("http://www.gramene.org") ! # p Bio::Enesmbl.server_uri #=> "http://www.gramene.org" ! # ! def self.server_uri(uri = nil) ! if uri ! @@server_uri = uri ! else ! @@server_uri || EBIServerURI ! end end ! # Ensembl Genome Browser Client Super Class # # == Examples - # - # module Bio - # class Ensembl::Kumamushi < Base - # Organism = 'Milnesium_tardigradum' - # end - # end - # fna = Bio::Ensembl::Kumamushi.exportview(1, 1000, 20000) # ! class Base ! ! # Ensembl ExportView Client. ! # ! # Retrieve genomic sequence/features from Ensembl ExportView in plain text. ! # Ensembl ExportView exports genomic data (sequence and features) in ! # several file formats including fasta, GFF and tab. ! # ! # * ExportViwe (http://www.ensembl.org/Homo_sapiens/exportview). ! # ! # == Examples ! # ! # # Genomic sequence in Fasta format ! # Bio::Ensembl::Human.exportview(:seq_region_name => 1, ! # :anchor1 => 1149206, :anchor2 => 1149229) ! # Bio::Ensembl::Human.exportview(1, 1149206, 1149229) ! # ! # # Feature in GFF ! # Bio::Ensembl::Human.exportview(:seq_region_name => 1, ! # :anchor1 => 1149206, :anchor2 => 1150000, ! # :options => ['similarity', 'repeat', ! # 'genscan', 'variation', ! # 'gene']) ! # Bio::Ensembl::Human.exportview(1, 1149206, 1150000, ! # ['variation', 'gene']) ! # ! # == Arguments ! # ! # Bio::Ensembl::Base#exportview method allow both orderd arguments and ! # named arguments. ! # Note: mandatory arguments marked '*'. ! # ! # === Orderd Arguments ! # ! # 1. seq_region_name - Chromosome number (*) ! # 2. anchor1 - From coordination (*) ! # 3. anchor2 - To coordination (*) ! # 4. options - Features to export (in :format => 'gff' or 'tab') ! # ['similarity', 'repeat', 'genscan', 'variation', ! # 'gene'] ! # ! # === Named Arguments ! # ! # * :seq_region_name - Chromosome number (*) ! # * :anchor1 - From coordination (*) ! # * :anchor2 - To coordination (*) ! # * :type1 - From coordination type ['bp', ] ! # * :type2 - To coordination type ['bp', ] ! # * :upstream - Bp upstream ! # * :downstream - Bp downstream ! # * :format - File format ['fasta', 'gff', 'tab'] ! # * :options - Features to export (for :format => 'gff' or 'tab') ! # ['similarity', 'repeat', 'genscan', 'variation', ! # 'gene'] ! # ! def self.exportview(*args) ! if args.first.class == Hash then opts = args.first ! else ! options = {:seq_region_name => args[0], ! :anchor1 => args[1], ! :anchor2 => args[2]} ! case args.size ! when 3 then ! options.update({:format => 'fasta'}) ! when 4 then ! options.update({:format => 'gff', :options => args[3]}) ! end end - - @data = {:type1 => 'bp', - :type2 => 'bp', - :downstream => '', - :upstream => '', - :format => 'fasta', - :options => [], - :action => 'export', - :_format => 'Text', - :output => 'txt', - :submit => 'Continue >>'} - - cgi = Client.new('exportview', self::Organism) - cgi.exec(@data.update(options)) end ! ! # An Ensembl CGI client class ! # ! # Enable the use of HTTP access via a proxy by setting the proxy address up ! # as the 'http_proxy' enviroment variable. ! # ! # === Examples ! # ! # cgi = Client.new('martview', 'Homo_sapiens') ! # result_body = cgi.exec(hash_data) ! # ! class Client ! ! # Sets cgi_name and genome_name. ! # ! # === Example ! # ! # cgi = Client.new('martview', 'Homo_sapiens') ! # ! def initialize(cgi_name, genome_name) ! @uri = URI.parse(Ensembl.server_uri) ! @path = ['', genome_name, cgi_name].join('/') ! end ! ! # Executes query with data. ! # ! # === Example ! # ! # result_body = cgi.exec(hash_data) ! # ! def exec(data_hash) ! data = make_args(data_hash) ! ! result = nil ! Bio::Command.start_http(@uri.host, @uri.port) {|http| ! result, = http.post(@path, data) ! } ! result.body ! end ! ! private ! ! def make_args(hash) ! tmp = [] ! hash.each do |key, value| ! if value.class == Array then ! value.each { |val| tmp << [key, val] } ! else ! tmp << [key, value] ! end ! end ! tmp.map {|e| e.map {|x| CGI.escape(x.to_s) }.join("=") }.join('&') ! end ! ! end # class Client ! ! end # class Base ! ! ! # Ensembl Human Genome ! # ! # See Bio::Ensembl::Base class. ! # ! class Human < Base ! Organism = 'Homo_sapiens' ! end # class Human ! ! # Ensembl Mouse Genome ! # ! # See Bio::Ensembl::Base class. ! # ! class Mouse < Base ! Organism = 'Mus_musculus' ! end # class Mouse end # class Ensembl --- 60,167 ---- class Ensembl ! ENSEMBL_URL = 'http://www.ensembl.org' ! def initialize(organism, server = nil) ! @server = server || ENSEMBL_URL ! @organism = organism ! @uri = [ server.chomp('/'), @organism ].join('/') ! end ! def self.human ! self.new("Homo_sapiens") end + def self.mouse + self.new("Mus_musculus") + end ! # Ensembl ExportView Client. ! # ! # Retrieve genomic sequence/features from Ensembl ExportView in plain text. ! # Ensembl ExportView exports genomic data (sequence and features) in ! # several file formats including fasta, GFF and tab. ! # ! # * ExportViwe (http://www.ensembl.org/Homo_sapiens/exportview). # # == Examples # ! # human = Bio::Ensembl.new('Homo_sapiens') ! # or ! # human = Bio::Ensembl.human ! # ! # # Genomic sequence in Fasta format ! # human.exportview(:seq_region_name => 1, ! # :anchor1 => 1149206, :anchor2 => 1149229) ! # human.exportview(1, 1149206, 1149229) ! # ! # # Feature in GFF ! # human.exportview(:seq_region_name => 1, ! # :anchor1 => 1149206, :anchor2 => 1150000, ! # :options => ['similarity', 'repeat', ! # 'genscan', 'variation', 'gene']) ! # human.exportview(1, 1149206, 1150000, ['variation', 'gene']) ! # ! # == Arguments ! # ! # Bio::Ensembl#exportview method allow both orderd arguments and ! # named arguments. (Note: mandatory arguments are marked by '*'). ! # ! # === Orderd Arguments ! # ! # 1. seq_region_name - Chromosome number (*) ! # 2. anchor1 - From coordination (*) ! # 3. anchor2 - To coordination (*) ! # 4. options - Features to export (in :format => 'gff' or 'tab') ! # ['similarity', 'repeat', 'genscan', 'variation', ! # 'gene'] ! # ! # === Named Arguments ! # ! # * :seq_region_name - Chromosome number (*) ! # * :anchor1 - From coordination (*) ! # * :anchor2 - To coordination (*) ! # * :type1 - From coordination type ['bp', ] ! # * :type2 - To coordination type ['bp', ] ! # * :upstream - Bp upstream ! # * :downstream - Bp downstream ! # * :format - File format ['fasta', 'gff', 'tab'] ! # * :options - Features to export (for :format => 'gff' or 'tab') ! # ['similarity', 'repeat', 'genscan', 'variation', ! # 'gene'] ! # ! def exportview(*args) ! if args.first.class == Hash ! options = args.first ! else ! options = { ! :seq_region_name => args[0], ! :anchor1 => args[1], ! :anchor2 => args[2], ! } ! case args.size ! when 3 then ! options.update({:format => 'fasta'}) ! when 4 then ! options.update({:format => 'gff', :options => args[3]}) end end + + defaults = { + :type1 => 'bp', + :type2 => 'bp', + :downstream => '', + :upstream => '', + :format => 'fasta', + :options => [], + :action => 'export', + :_format => 'Text', + :output => 'txt', + :submit => 'Continue >>' + } + params = defaults.update(options) ! Bio::Command.post_form("#{@uri}/exportview", params) ! end end # class Ensembl From nakao at dev.open-bio.org Wed Mar 28 11:21:22 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Wed, 28 Mar 2007 11:21:22 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio/io test_ddbjxml.rb,1.2,1.3 Message-ID: <200703281121.l2SBLMSC006618@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio/io In directory dev.open-bio.org:/tmp/cvs-serv6598/test/unit/bio/io Modified Files: test_ddbjxml.rb Log Message: * Fixed test_constants. Index: test_ddbjxml.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/unit/bio/io/test_ddbjxml.rb,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_ddbjxml.rb 24 Dec 2006 17:19:05 -0000 1.2 --- test_ddbjxml.rb 28 Mar 2007 11:21:20 -0000 1.3 *************** *** 21,25 **** def test_constants ! constants = ["DDBJ", "TxSearch", "ClustalW", "PML", "Gib", "Fasta", "BASE_URI", "SRS", "Gtop", "GetEntry", "Blast"].sort assert_equal(constants, Bio::DDBJ::XML.constants.sort) end --- 21,26 ---- def test_constants ! constants = ["DDBJ", "TxSearch", "ClustalW", "PML", "Gib", "Fasta", ! "BASE_URI", "SRS", "SERVER_URI", "Gtop", "GetEntry", "Blast"].sort assert_equal(constants, Bio::DDBJ::XML.constants.sort) end From nakao at dev.open-bio.org Wed Mar 28 12:01:02 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Wed, 28 Mar 2007 12:01:02 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio/io test_ensembl.rb,1.2,1.3 Message-ID: <200703281201.l2SC12lE006750@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio/io In directory dev.open-bio.org:/tmp/cvs-serv6728/test/unit/bio/io Modified Files: test_ensembl.rb Log Message: * Added TestEnsembl_v14 class. Index: test_ensembl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/unit/bio/io/test_ensembl.rb,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_ensembl.rb 27 Apr 2006 05:38:50 -0000 1.2 --- test_ensembl.rb 28 Mar 2007 12:01:00 -0000 1.3 *************** *** 2,6 **** # = test/unit/bio/io/test_ensembl.rb - Unit test for Bio::Ensembl. # ! # Copyright:: Copyright (C) 2006 # Mitsuteru C. Nakao # License:: Ruby's --- 2,6 ---- # = test/unit/bio/io/test_ensembl.rb - Unit test for Bio::Ensembl. # ! # Copyright:: Copyright (C) 2006, 2007 # Mitsuteru C. Nakao # License:: Ruby's *************** *** 16,19 **** --- 16,49 ---- require 'bio/io/ensembl' + # tests for ensembl.rb,v 1.4 + class TestEnsembl_v14 < Test::Unit::TestCase + def test_ensembl_url + assert_equal('http://www.ensembl.org', Bio::Ensembl::ENSEMBL_URL) + end + + def test_server + obj = Bio::Ensembl.new('Homo_sapiens') + assert_equal('http://www.ensembl.org', obj.server) + end + + def test_organism + organism = 'Homo_sapiens' + obj = Bio::Ensembl.new(organism) + assert_equal(organism, obj.organism) + end + + def test_self_human + organism = 'Homo_sapiens' + obj = Bio::Ensembl.human + assert_equal(organism, obj.organism) + end + + def test_self_mouse + organism = 'Mus_musculus' + obj = Bio::Ensembl.mouse + assert_equal(organism, obj.organism) + end + end + class TestEnsembl < Test::Unit::TestCase *************** *** 33,36 **** --- 63,67 ---- end + class TestEnsemblBase < Test::Unit::TestCase def test_exportview From nakao at dev.open-bio.org Wed Mar 28 12:01:50 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Wed, 28 Mar 2007 12:01:50 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io ensembl.rb,1.4,1.5 Message-ID: <200703281201.l2SC1oSe006778@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv6758/lib/bio/io Modified Files: ensembl.rb Log Message: * Fixed a bug (server.chomp('/') -> @server.chump('/')). Index: ensembl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/ensembl.rb,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ensembl.rb 28 Mar 2007 10:31:48 -0000 1.4 --- ensembl.rb 28 Mar 2007 12:01:48 -0000 1.5 *************** *** 14,22 **** # == Examples # ! # seq = Bio::Ensembl::Human.exportview(1, 1000, 100000) ! # gff = Bio::Ensembl::Human.exportview(1, 1000, 100000, ['gene']) # ! # seq = Bio::Ensembl::Mouse.exportview(1, 1000, 100000) ! # gff = Bio::Ensembl::Mouse.exportview(1, 1000, 100000, ['gene', 'variation', 'genscan']) # # --- 14,22 ---- # == Examples # ! # seq = Bio::Ensembl.human.exportview(1, 1000, 100000) ! # gff = Bio::Ensembl.human.exportview(1, 1000, 100000, ['gene']) # ! # seq = Bio::Ensembl.mouse.exportview(1, 1000, 100000) ! # gff = Bio::Ensembl.mouse.exportview(1, 1000, 100000, ['gene', 'variation', 'genscan']) # # *************** *** 59,69 **** # class Ensembl ! ENSEMBL_URL = 'http://www.ensembl.org' def initialize(organism, server = nil) @server = server || ENSEMBL_URL @organism = organism ! @uri = [ server.chomp('/'), @organism ].join('/') end --- 59,73 ---- # class Ensembl ! ENSEMBL_URL = 'http://www.ensembl.org' + attr_reader :server + + attr_reader :organism + def initialize(organism, server = nil) @server = server || ENSEMBL_URL @organism = organism ! @uri = [ @server.chomp('/'), @organism ].join('/') end From nakao at dev.open-bio.org Wed Mar 28 12:24:32 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Wed, 28 Mar 2007 12:24:32 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio/io test_ensembl.rb,1.3,1.4 Message-ID: <200703281224.l2SCOWRQ006910@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio/io In directory dev.open-bio.org:/tmp/cvs-serv6890/test/unit/bio/io Modified Files: test_ensembl.rb Log Message: Index: test_ensembl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/unit/bio/io/test_ensembl.rb,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_ensembl.rb 28 Mar 2007 12:01:00 -0000 1.3 --- test_ensembl.rb 28 Mar 2007 12:24:30 -0000 1.4 *************** *** 44,47 **** --- 44,55 ---- assert_equal(organism, obj.organism) end + + def test_new_with_2_args + organism = 'Oryza_sativa' + server_url = 'http://www.gramene.org' + obj = Bio::Ensembl.new(organism, server_url) + assert_equal(organism, obj.organism) + assert_equal(server_url, obj.server) + end end From k at dev.open-bio.org Wed Mar 28 12:31:05 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 28 Mar 2007 12:31:05 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio command.rb,1.13,1.14 Message-ID: <200703281231.l2SCV5eq006956@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio In directory dev.open-bio.org:/tmp/cvs-serv6952 Modified Files: command.rb Log Message: * keys and parameters of params are forced to to_s * post_form is modified to accept url in string Index: command.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/command.rb,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** command.rb 26 Mar 2007 17:09:45 -0000 1.13 --- command.rb 28 Mar 2007 12:31:03 -0000 1.14 *************** *** 273,278 **** # def post_form(uri, params, header = {}) data = params.map do |key, val| ! "#{URI.escape(key)}=#{URI.escape(val)}" end.join('&') h = { --- 273,281 ---- # def post_form(uri, params, header = {}) + unless uri.is_a?(URI) + uri = URI.parse(uri) + end data = params.map do |key, val| ! "#{URI.escape(key.to_s)}=#{URI.escape(val.to_s)}" end.join('&') h = { From k at dev.open-bio.org Wed Mar 28 12:31:50 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 28 Mar 2007 12:31:50 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io ensembl.rb,1.5,1.6 Message-ID: <200703281231.l2SCVoVZ006983@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv6977/io Modified Files: ensembl.rb Log Message: * exportview is fixed to extract body from Net::HTTP response Index: ensembl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/ensembl.rb,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ensembl.rb 28 Mar 2007 12:01:48 -0000 1.5 --- ensembl.rb 28 Mar 2007 12:31:48 -0000 1.6 *************** *** 14,22 **** # == Examples # ! # seq = Bio::Ensembl.human.exportview(1, 1000, 100000) ! # gff = Bio::Ensembl.human.exportview(1, 1000, 100000, ['gene']) # ! # seq = Bio::Ensembl.mouse.exportview(1, 1000, 100000) ! # gff = Bio::Ensembl.mouse.exportview(1, 1000, 100000, ['gene', 'variation', 'genscan']) # # --- 14,27 ---- # == Examples # ! # human = Bio::Ensembl.new('Homo_sapiens') ! # seq = human.exportview(1, 1000, 100000) ! # gff = human.exportview(1, 1000, 100000, ['gene', 'variation', 'genscan']) # ! # human = Bio::Ensembl.human ! # seq = human.exportview(1, 1000, 100000) ! # gff = human.exportview(1, 1000, 100000, ['gene']) ! # ! # seq = Bio::Ensembl.human.exportview(1, 1000, 100000) ! # gff = Bio::Ensembl.human.exportview(1, 1000, 100000, ['gene', 'variation', 'genscan']) # # *************** *** 28,33 **** require 'bio/command' - require 'uri' - require 'cgi' module Bio --- 33,36 ---- *************** *** 166,170 **** params = defaults.update(options) ! Bio::Command.post_form("#{@uri}/exportview", params) end --- 169,175 ---- params = defaults.update(options) ! result, = Bio::Command.post_form("#{@uri}/exportview", params) ! ! return result.body end From k at dev.open-bio.org Wed Mar 28 16:51:39 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 28 Mar 2007 16:51:39 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io das.rb,1.13,1.14 Message-ID: <200703281651.l2SGpdcT007692@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv7688/io Modified Files: das.rb Log Message: * modified to use Bio::Command Index: das.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/das.rb,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** das.rb 25 Jul 2006 19:46:43 -0000 1.13 --- das.rb 28 Mar 2007 16:51:37 -0000 1.14 *************** *** 2,6 **** # = bio/io/das.rb - BioDAS access module # ! # Copyright:: Copyright (C) 2003, 2004 # Shuichi Kawashima , # Toshiaki Katayama --- 2,6 ---- # = bio/io/das.rb - BioDAS access module # ! # Copyright:: Copyright (C) 2003, 2004, 2007 # Shuichi Kawashima , # Toshiaki Katayama *************** *** 21,26 **** rescue LoadError end ! require 'uri' ! require 'net/http' require 'bio/sequence' --- 21,25 ---- rescue LoadError end ! require 'bio/command' require 'bio/sequence' *************** *** 32,38 **** # Specify DAS server to connect def initialize(url = 'http://www.wormbase.org:80/db/') ! schema, user, host, port, reg, path, = URI.split(url) ! @server = Net::HTTP.new(host, port) ! @prefix = path ? path.chomp('/') : '' end --- 31,35 ---- # Specify DAS server to connect def initialize(url = 'http://www.wormbase.org:80/db/') ! @server = url.chomp('/') end *************** *** 40,44 **** def get_dsn ary = [] ! result, = @server.get(@prefix + '/das/dsn') doc = REXML::Document.new(result.body) doc.elements.each('/descendant::DSN') do |e| --- 37,41 ---- def get_dsn ary = [] ! result, = Bio::Command.post_form("#{@server}/das/dsn") doc = REXML::Document.new(result.body) doc.elements.each('/descendant::DSN') do |e| *************** *** 71,75 **** src = dsn end ! result, = @server.get(@prefix + '/das/' + src + '/entry_points') doc = REXML::Document.new(result.body) doc.elements.each('/descendant::ENTRY_POINTS') do |e| --- 68,72 ---- src = dsn end ! result, = Bio::Command.post_form("#{@server}/das/#{src}/entry_points") doc = REXML::Document.new(result.body) doc.elements.each('/descendant::ENTRY_POINTS') do |e| *************** *** 80,84 **** segment.entry_id = e.attributes['id'] segment.start = e.attributes['start'] ! segment.stop = e.attributes['stop'] segment.orientation = e.attributes['orientation'] segment.subparts = e.attributes['subparts'] --- 77,81 ---- segment.entry_id = e.attributes['id'] segment.start = e.attributes['start'] ! segment.stop = e.attributes['stop'] || e.attributes['size'] segment.orientation = e.attributes['orientation'] segment.subparts = e.attributes['subparts'] *************** *** 104,110 **** opts << "segment=#{s.entry_id}:#{s.start},#{s.stop}" end - query = opts.join(';') ! result, = @server.get(@prefix + '/das/' + dsn + '/dna?' + query) doc = REXML::Document.new(result.body) doc.elements.each('/descendant::SEQUENCE') do |e| --- 101,106 ---- opts << "segment=#{s.entry_id}:#{s.start},#{s.stop}" end ! result, = Bio::Command.post_form("#{@server}/das/#{dsn}/dna", opts) doc = REXML::Document.new(result.body) doc.elements.each('/descendant::SEQUENCE') do |e| *************** *** 137,143 **** opts << "segment=#{s.entry_id}:#{s.start},#{s.stop}" end - query = opts.join(';') ! result, = @server.get(@prefix + '/das/' + dsn + '/sequence?' + query) doc = REXML::Document.new(result.body) doc.elements.each('/descendant::SEQUENCE') do |e| --- 133,138 ---- opts << "segment=#{s.entry_id}:#{s.start},#{s.stop}" end ! result, = Bio::Command.post_form("#{@server}/das/#{dsn}/sequence", opts) doc = REXML::Document.new(result.body) doc.elements.each('/descendant::SEQUENCE') do |e| *************** *** 175,181 **** opts << "segment=#{s.entry_id}:#{s.start},#{s.stop}" end - query = opts.join(';') ! result, = @server.get(@prefix + '/das/' + dsn + '/types?' + query) doc = REXML::Document.new(result.body) doc.elements.each('/descendant::GFF') do |e| --- 170,175 ---- opts << "segment=#{s.entry_id}:#{s.start},#{s.stop}" end ! result, = Bio::Command.post_form("#{@server}/das/#{dsn}/types", opts) doc = REXML::Document.new(result.body) doc.elements.each('/descendant::GFF') do |e| *************** *** 227,233 **** opts << "group_id=#{gid}" end - query = opts.join(';') ! result, = @server.get(@prefix + '/das/' + dsn + '/features?' + query) doc = REXML::Document.new(result.body) doc.elements.each('/descendant::GFF') do |e| --- 221,226 ---- opts << "group_id=#{gid}" end ! result, = Bio::Command.post_form("#{@server}/das/#{dsn}/features", opts) doc = REXML::Document.new(result.body) doc.elements.each('/descendant::GFF') do |e| *************** *** 446,450 **** org_list.each do |org| print "#{org} : " ! list = kegg_das.get_entry_point(org) list.segments.each do |seg| print " #{seg.entry_id}" --- 439,443 ---- org_list.each do |org| print "#{org} : " ! list = kegg_das.get_entry_points(org) list.segments.each do |seg| print " #{seg.entry_id}" From k at dev.open-bio.org Wed Mar 28 16:52:22 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 28 Mar 2007 16:52:22 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/shell/plugin das.rb,NONE,1.1 Message-ID: <200703281652.l2SGqMqW007735@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/shell/plugin In directory dev.open-bio.org:/tmp/cvs-serv7731/shell/plugin Added Files: das.rb Log Message: * newly added BioDAS client plugin --- NEW FILE: das.rb --- # # = bio/shell/plugin/keggdas.rb - plugin for KEGG DAS # # Copyright:: Copyright (C) 2006 # Toshiaki Katayama # License:: Ruby's # # $Id: das.rb,v 1.1 2007/03/28 16:52:20 k Exp $ # module Bio class DAS def list(serv = nil) result = "" self.get_dsn.each do |dsn| src = dsn.source_id self.get_entry_points(src).each do |ep| data = [src, ep.entry_id, ep.start.to_i, ep.stop.to_i, "# #{ep.description}"].join("\t") + "\n" puts data result += data end end return result end def dna(dsn, entry_point, start, stop) seg = Bio::DAS::SEGMENT.region(entry_point, start, stop) self.get_dna(dsn, seg).first.sequence end def features(dsn, entry_point, start, stop) seg = Bio::DAS::SEGMENT.region(entry_point, start, stop) self.get_features(dsn, seg) end end end module Bio::Shell private # http://www.biodas.org/ # http://www.dasregistry.org/ def das(url = nil) if url @das = Bio::DAS.new(url) else @das ||= keggdas end end def keggdas(url = "http://das.hgc.jp/cgi-bin/") das(url) end def ensembl(url = "http://das.ensembl.org/") das(url) end def wormbase(url = "http://www.wormbase.org/db/") das(url) end end From k at dev.open-bio.org Wed Mar 28 16:54:13 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 28 Mar 2007 16:54:13 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio command.rb,1.14,1.15 Message-ID: <200703281654.l2SGsDIj007778@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio In directory dev.open-bio.org:/tmp/cvs-serv7774 Modified Files: command.rb Log Message: * post_form method is extended to accept params as array of string, array of hash, array of array, or string in addition to hash. * params option can be ommited if not needed (defaults to nil) Index: command.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/command.rb,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** command.rb 28 Mar 2007 12:31:03 -0000 1.14 --- command.rb 28 Mar 2007 16:54:11 -0000 1.15 *************** *** 272,289 **** # +header+ must be a hash. # ! def post_form(uri, params, header = {}) unless uri.is_a?(URI) uri = URI.parse(uri) end ! data = params.map do |key, val| ! "#{URI.escape(key.to_s)}=#{URI.escape(val.to_s)}" ! end.join('&') ! h = { 'Content-Type' => 'application/x-www-form-urlencoded', 'Content-Length' => data.length.to_s } ! h.update(header) start_http(uri.host, uri.port) do |http| ! http.post(uri.path, data, h) end end --- 272,310 ---- # +header+ must be a hash. # ! def post_form(uri, params = nil, header = {}) unless uri.is_a?(URI) uri = URI.parse(uri) end ! ! data = "" ! ! case params ! when Hash ! data = params.map do |key, val| ! "#{URI.escape(key.to_s)}=#{URI.escape(val.to_s)}" ! end.join('&') ! when Array ! case params.first ! when Hash, Array ! data = params.map do |key, val| ! "#{URI.escape(key.to_s)}=#{URI.escape(val.to_s)}" ! end.join('&') ! when String ! data = params.map do |str| ! URI.escape(str.strip) ! end.join('&') ! end ! when String ! data = URI.escape(params.strip) ! end ! ! hash = { 'Content-Type' => 'application/x-www-form-urlencoded', 'Content-Length' => data.length.to_s } ! hash.update(header) ! start_http(uri.host, uri.port) do |http| ! http.post(uri.path, data, hash) end end From trevor at dev.open-bio.org Wed Mar 28 19:45:29 2007 From: trevor at dev.open-bio.org (Trevor Wennblom) Date: Wed, 28 Mar 2007 19:45:29 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio/util/restriction_enzyme test_analysis.rb, 1.8, 1.9 Message-ID: <200703281945.l2SJjTko008166@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio/util/restriction_enzyme In directory dev.open-bio.org:/tmp/cvs-serv8138/test/unit/bio/util/restriction_enzyme Modified Files: test_analysis.rb Log Message: Bugfix Index: test_analysis.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/unit/bio/util/restriction_enzyme/test_analysis.rb,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** test_analysis.rb 5 Jan 2007 06:11:39 -0000 1.8 --- test_analysis.rb 28 Mar 2007 19:45:27 -0000 1.9 *************** *** 137,145 **** assert_equal(["ag", "cag"], Bio::Sequence::NA.new('cagagag').cut_with_enzymes('ag^ag', 'EcoRII').primary ) ! # NOTE: investigate where the '' is coming from ! assert_equal(["", "ag", "ag", "cag", "ccagg"], Bio::Sequence::NA.new('cagagagccagg').cut_with_enzymes('ag^ag', 'EcoRII').primary ) end end ! end --- 137,172 ---- assert_equal(["ag", "cag"], Bio::Sequence::NA.new('cagagag').cut_with_enzymes('ag^ag', 'EcoRII').primary ) ! # Note how EcoRII needs extra padding on the beginning and ending of the ! # sequence 'ccagg' to make the match since the cut must occur between ! # two nucleotides and can not occur on the very end of the sequence. ! # ! # EcoRII: ! # :blunt: "0" ! # :c2: "5" ! # :c4: "0" ! # :c1: "-1" ! # :pattern: CCWGG ! # :len: "5" ! # :name: EcoRII ! # :c3: "0" ! # :ncuts: "2" ! # ! # -1 1 2 3 4 5 ! # 5' - n^c c w g g n - 3' ! # 3' - n g g w c c^n - 5' ! # ! # (w == [at]) ! ! assert_equal(["ag", "agccagg", "cag"], Bio::Sequence::NA.new('cagagagccagg').cut_with_enzymes('ag^ag', 'EcoRII').primary ) ! assert_equal(["ag", "agccagg", "cag"], Bio::Sequence::NA.new('cagagagccagg').cut_with_enzymes('ag^ag').primary ) ! assert_equal([], Bio::Sequence::NA.new('cagagagccagg').cut_with_enzymes('EcoRII').primary ) ! ! assert_equal(["ag", "ag", "cag", "ccaggt"], Bio::Sequence::NA.new('cagagagccaggt').cut_with_enzymes('ag^ag', 'EcoRII').primary ) ! assert_equal(["ag", "agccaggt", "cag"], Bio::Sequence::NA.new('cagagagccaggt').cut_with_enzymes('ag^ag').primary ) ! assert_equal(["cagagag", "ccaggt"], Bio::Sequence::NA.new('cagagagccaggt').cut_with_enzymes('EcoRII').primary ) ! assert_equal(["a", "gtctctcggtcc"], Bio::Sequence::NA.new('cagagagccaggt').cut_with_enzymes('EcoRII').complement ) end end ! end \ No newline at end of file From trevor at dev.open-bio.org Wed Mar 28 19:45:29 2007 From: trevor at dev.open-bio.org (Trevor Wennblom) Date: Wed, 28 Mar 2007 19:45:29 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/util/restriction_enzyme analysis_basic.rb, 1.8, 1.9 double_stranded.rb, 1.7, 1.8 Message-ID: <200703281945.l2SJjTB4008160@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme In directory dev.open-bio.org:/tmp/cvs-serv8138/lib/bio/util/restriction_enzyme Modified Files: analysis_basic.rb double_stranded.rb Log Message: Bugfix Index: analysis_basic.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/analysis_basic.rb,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** analysis_basic.rb 5 Jan 2007 06:33:01 -0000 1.8 --- analysis_basic.rb 28 Mar 2007 19:45:27 -0000 1.9 *************** *** 151,155 **** enzyme = Bio::RestrictionEnzyme.new(enzyme) unless enzyme.class == Bio::RestrictionEnzyme::DoubleStranded ! find_match_locations( sequence, enzyme.primary.to_re ).each do |offset| all_enzyme_actions << enzyme.create_action_at( offset ) end --- 151,164 ---- enzyme = Bio::RestrictionEnzyme.new(enzyme) unless enzyme.class == Bio::RestrictionEnzyme::DoubleStranded ! # make sure pattern is the proper size ! # for more info see the internal documentation of ! # Bio::RestrictionEnzyme::DoubleStranded.create_action_at ! pattern = Bio::Sequence::NA.new( ! Bio::RestrictionEnzyme::DoubleStranded::AlignedStrands.align( ! enzyme.primary, enzyme.complement ! ).primary ! ).to_re ! ! find_match_locations( sequence, pattern ).each do |offset| all_enzyme_actions << enzyme.create_action_at( offset ) end *************** *** 185,193 **** all_enzyme_actions[0..-2].each_with_index do |current_enzyme_action, i| next if competition_indexes.include? i all_enzyme_actions[i+1..-1].each_with_index do |comparison_enzyme_action, j| j += (i + 1) next if competition_indexes.include? j ! if (current_enzyme_action.right <= comparison_enzyme_action.cut_ranges.min_vertical) or (current_enzyme_action.left > comparison_enzyme_action.cut_ranges.max_vertical) --- 194,204 ---- all_enzyme_actions[0..-2].each_with_index do |current_enzyme_action, i| next if competition_indexes.include? i + next if current_enzyme_action.cut_ranges.empty? # no cuts, some enzymes are like this (ex. CjuI) all_enzyme_actions[i+1..-1].each_with_index do |comparison_enzyme_action, j| j += (i + 1) next if competition_indexes.include? j ! next if comparison_enzyme_action.cut_ranges.empty? # no cuts ! if (current_enzyme_action.right <= comparison_enzyme_action.cut_ranges.min_vertical) or (current_enzyme_action.left > comparison_enzyme_action.cut_ranges.max_vertical) Index: double_stranded.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/restriction_enzyme/double_stranded.rb,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** double_stranded.rb 5 Jan 2007 06:33:01 -0000 1.7 --- double_stranded.rb 28 Mar 2007 19:45:27 -0000 1.8 *************** *** 171,179 **** # +offset+:: Numerical offset of where the enzyme action occurs on the seqeunce def create_action_at( offset ) ! #def enzyme_to_enzyme_action( restriction_enzyme, offset ) ! enzyme_action = EnzymeAction.new( offset, ! offset + @primary.size-1, ! offset, ! offset + @complement.size-1) @cut_locations.each do |cut_location_pair| --- 171,205 ---- # +offset+:: Numerical offset of where the enzyme action occurs on the seqeunce def create_action_at( offset ) ! # x is the size of the fully aligned sequence with maximum padding needed ! # to make a match on the primary and complement strand. ! # ! # For example - ! # Note how EcoRII needs extra padding on the beginning and ending of the ! # sequence 'ccagg' to make the match since the cut must occur between ! # two nucleotides and can not occur on the very end of the sequence. ! # ! # EcoRII: ! # :blunt: "0" ! # :c2: "5" ! # :c4: "0" ! # :c1: "-1" ! # :pattern: CCWGG ! # :len: "5" ! # :name: EcoRII ! # :c3: "0" ! # :ncuts: "2" ! # ! # -1 1 2 3 4 5 ! # 5' - n^c c w g g n - 3' ! # 3' - n g g w c c^n - 5' ! # ! # (w == [at]) ! ! x = aligned_strands.primary.size ! ! enzyme_action = EnzymeAction.new( offset, ! offset + x-1, ! offset, ! offset + x-1) @cut_locations.each do |cut_location_pair| From k at dev.open-bio.org Wed Mar 28 19:50:30 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 28 Mar 2007 19:50:30 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/shell/plugin das.rb,1.1,1.2 Message-ID: <200703281950.l2SJoUKm008245@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/shell/plugin In directory dev.open-bio.org:/tmp/cvs-serv8241/shell/plugin Modified Files: das.rb Log Message: * das.list method is renamed to das.list_sequences in plugin/das.rb * dna and features methods are moved to Bio::DAS module in io/das.rb from plugin/das.rb Index: das.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/plugin/das.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** das.rb 28 Mar 2007 16:52:20 -0000 1.1 --- das.rb 28 Mar 2007 19:50:28 -0000 1.2 *************** *** 12,16 **** class DAS ! def list(serv = nil) result = "" self.get_dsn.each do |dsn| --- 12,16 ---- class DAS ! def list_sequences result = "" self.get_dsn.each do |dsn| *************** *** 24,37 **** return result end - - def dna(dsn, entry_point, start, stop) - seg = Bio::DAS::SEGMENT.region(entry_point, start, stop) - self.get_dna(dsn, seg).first.sequence - end - - def features(dsn, entry_point, start, stop) - seg = Bio::DAS::SEGMENT.region(entry_point, start, stop) - self.get_features(dsn, seg) - end end --- 24,27 ---- From k at dev.open-bio.org Wed Mar 28 19:51:26 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 28 Mar 2007 19:51:26 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io das.rb,1.14,1.15 Message-ID: <200703281951.l2SJpQ8Z008288@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv8284/io Modified Files: das.rb Log Message: * dna, features methods are added for the convenience Index: das.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/das.rb,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** das.rb 28 Mar 2007 16:51:37 -0000 1.14 --- das.rb 28 Mar 2007 19:51:24 -0000 1.15 *************** *** 34,37 **** --- 34,48 ---- end + def dna(dsn, entry_point, start, stop) + seg = Bio::DAS::SEGMENT.region(entry_point, start, stop) + self.get_dna(dsn, seg).first.sequence + end + + def features(dsn, entry_point, start, stop) + seg = Bio::DAS::SEGMENT.region(entry_point, start, stop) + self.get_features(dsn, seg) + end + + # Returns an Array of Bio::DAS::DSN def get_dsn From k at dev.open-bio.org Wed Mar 28 20:14:16 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 28 Mar 2007 20:14:16 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/shell core.rb,1.22,1.23 Message-ID: <200703282014.l2SKEGBP008447@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/shell In directory dev.open-bio.org:/tmp/cvs-serv8443/shell Modified Files: core.rb Log Message: * changed to print messages to STDERR Index: core.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/core.rb,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** core.rb 24 Dec 2006 08:36:00 -0000 1.22 --- core.rb 28 Mar 2007 20:14:14 -0000 1.23 *************** *** 58,62 **** def ask_yes_or_no(message) loop do ! print "#{message}" answer = gets if answer.nil? --- 58,62 ---- def ask_yes_or_no(message) loop do ! STDERR.print "#{message}" answer = gets if answer.nil? *************** *** 98,109 **** def load_session load_object ! load_history ! opening_splash ! open_history end def save_session ! close_history ! closing_splash if create_save_dir_ask #save_history # changed to use our own... --- 98,113 ---- def load_session load_object ! unless @cache[:mode] == :script ! load_history ! opening_splash ! open_history ! end end def save_session ! unless @cache[:mode] == :script ! close_history ! closing_splash ! end if create_save_dir_ask #save_history # changed to use our own... *************** *** 111,116 **** save_config end ! puts "Leaving directory '#{@cache[:workdir]}'" ! puts "History is saved in '#{@cache[:workdir]}/#{SAVEDIR + HISTORY}'" end --- 115,120 ---- save_config end ! STDERR.puts "Leaving directory '#{@cache[:workdir]}'" ! STDERR.puts "History is saved in '#{@cache[:workdir]}/#{SAVEDIR + HISTORY}'" end *************** *** 144,150 **** unless File.directory?(dir) begin ! print "Creating directory (#{dir}) ... " FileUtils.mkdir_p(dir) ! puts "done" rescue warn "Error: Failed to create directory (#{dir}) : #{$!}" --- 148,154 ---- unless File.directory?(dir) begin ! STDERR.print "Creating directory (#{dir}) ... " FileUtils.mkdir_p(dir) ! STDERR.puts "done" rescue warn "Error: Failed to create directory (#{dir}) : #{$!}" *************** *** 180,188 **** def load_config_file(file) if File.exists?(file) ! print "Loading config (#{file}) ... " if hash = YAML.load(File.read(file)) @config.update(hash) end ! puts "done" end end --- 184,192 ---- def load_config_file(file) if File.exists?(file) ! STDERR.print "Loading config (#{file}) ... " if hash = YAML.load(File.read(file)) @config.update(hash) end ! STDERR.puts "done" end end *************** *** 194,202 **** def save_config_file(file) begin ! print "Saving config (#{file}) ... " File.open(file, "w") do |f| f.puts @config.to_yaml end ! puts "done" rescue warn "Error: Failed to save (#{file}) : #{$!}" --- 198,206 ---- def save_config_file(file) begin ! STDERR.print "Saving config (#{file}) ... " File.open(file, "w") do |f| f.puts @config.to_yaml end ! STDERR.puts "done" rescue warn "Error: Failed to save (#{file}) : #{$!}" *************** *** 206,210 **** def config_show @config.each do |k, v| ! puts "#{k}\t= #{v.inspect}" end end --- 210,214 ---- def config_show @config.each do |k, v| ! STDERR.puts "#{k}\t= #{v.inspect}" end end *************** *** 215,219 **** @config[:echo] = IRB.conf[:ECHO] = flag eval("conf.echo = #{flag}", bind) ! puts "Echo #{flag ? 'on' : 'off'}" end --- 219,223 ---- @config[:echo] = IRB.conf[:ECHO] = flag eval("conf.echo = #{flag}", bind) ! STDERR.puts "Echo #{flag ? 'on' : 'off'}" end *************** *** 238,242 **** flag = ! @config[:splash] @config[:splash] = flag ! puts "Splash #{flag ? 'on' : 'off'}" opening_splash end --- 242,246 ---- flag = ! @config[:splash] @config[:splash] = flag ! STDERR.puts "Splash #{flag ? 'on' : 'off'}" opening_splash end *************** *** 257,263 **** if File.directory?(dir) Dir.glob("#{dir}/*.rb").sort.each do |file| ! print "Loading plugin (#{file}) ... " load file ! puts "done" end end --- 261,267 ---- if File.directory?(dir) Dir.glob("#{dir}/*.rb").sort.each do |file| ! STDERR.print "Loading plugin (#{file}) ... " load file ! STDERR.puts "done" end end *************** *** 283,287 **** def load_object_file(file) if File.exists?(file) ! print "Loading object (#{file}) ... " begin bind = Bio::Shell.cache[:binding] --- 287,291 ---- def load_object_file(file) if File.exists?(file) ! STDERR.print "Loading object (#{file}) ... " begin bind = Bio::Shell.cache[:binding] *************** *** 292,296 **** eval("#{k} = Thread.current[:restore_value]", bind) rescue ! puts "Warning: object '#{k}' couldn't be loaded : #{$!}" end end --- 296,300 ---- eval("#{k} = Thread.current[:restore_value]", bind) rescue ! STDERR.puts "Warning: object '#{k}' couldn't be loaded : #{$!}" end end *************** *** 298,302 **** warn "Error: Failed to load (#{file}) : #{$!}" end ! puts "done" end end --- 302,306 ---- warn "Error: Failed to load (#{file}) : #{$!}" end ! STDERR.puts "done" end end *************** *** 308,312 **** def save_object_file(file) begin ! print "Saving object (#{file}) ... " File.rename(file, "#{file}.old") if File.exist?(file) File.open(file, "w") do |f| --- 312,316 ---- def save_object_file(file) begin ! STDERR.print "Saving object (#{file}) ... " File.rename(file, "#{file}.old") if File.exist?(file) File.open(file, "w") do |f| *************** *** 329,333 **** @config[:marshal] = MARSHAL end ! puts "done" rescue File.rename("#{file}.old", file) if File.exist?("#{file}.old") --- 333,337 ---- @config[:marshal] = MARSHAL end ! STDERR.puts "done" rescue File.rename("#{file}.old", file) if File.exist?("#{file}.old") *************** *** 360,364 **** def load_history_file(file) if File.exists?(file) ! print "Loading history (#{file}) ... " File.open(file).each do |line| unless line[/^# /] --- 364,368 ---- def load_history_file(file) if File.exists?(file) ! STDERR.print "Loading history (#{file}) ... " File.open(file).each do |line| unless line[/^# /] *************** *** 366,370 **** end end ! puts "done" end end --- 370,374 ---- end end ! STDERR.puts "done" end end *************** *** 379,387 **** def save_history_file(file) begin ! print "Saving history (#{file}) ... " File.open(file, "w") do |f| f.puts Readline::HISTORY.to_a end ! puts "done" rescue warn "Error: Failed to save (#{file}) : #{$!}" --- 383,391 ---- def save_history_file(file) begin ! STDERR.print "Saving history (#{file}) ... " File.open(file, "w") do |f| f.puts Readline::HISTORY.to_a end ! STDERR.puts "done" rescue warn "Error: Failed to save (#{file}) : #{$!}" *************** *** 413,422 **** def script_begin ! puts "-- 8< -- 8< -- 8< -- Script -- 8< -- 8< -- 8< --" @script_begin = Readline::HISTORY.size end def script_end ! puts "-- >8 -- >8 -- >8 -- Script -- >8 -- >8 -- >8 --" @script_end = Readline::HISTORY.size - 2 end --- 417,426 ---- def script_begin ! STDERR.puts "-- 8< -- 8< -- 8< -- Script -- 8< -- 8< -- 8< --" @script_begin = Readline::HISTORY.size end def script_end ! STDERR.puts "-- >8 -- >8 -- >8 -- Script -- >8 -- >8 -- >8 --" @script_end = Readline::HISTORY.size - 2 end *************** *** 432,441 **** save_script_file(SCRIPT) else ! puts " ... save aborted." end elsif @script_begin and @script_end and @script_begin - @script_end == 1 ! puts " ... script aborted." else ! puts "Error: Script range #{@script_begin}..#{@script_end} is invalid" end end --- 436,445 ---- save_script_file(SCRIPT) else ! STDERR.puts " ... save aborted." end elsif @script_begin and @script_end and @script_begin - @script_end == 1 ! STDERR.puts " ... script aborted." else ! STDERR.puts "Error: Script range #{@script_begin}..#{@script_end} is invalid" end end *************** *** 443,447 **** def save_script_file(file) begin ! print "Saving script (#{file}) ... " File.open(file, "w") do |f| f.puts "#!/usr/bin/env bioruby" --- 447,451 ---- def save_script_file(file) begin ! STDERR.print "Saving script (#{file}) ... " File.open(file, "w") do |f| f.puts "#!/usr/bin/env bioruby" *************** *** 450,454 **** f.puts end ! puts "done" rescue @script_begin = nil --- 454,458 ---- f.puts end ! STDERR.puts "done" rescue @script_begin = nil *************** *** 507,511 **** def opening_splash ! puts if @config[:splash] if @config[:color] --- 511,515 ---- def opening_splash ! STDERR.puts if @config[:splash] if @config[:color] *************** *** 516,541 **** end if @config[:color] ! print splash_message_color else ! print splash_message end ! puts ! puts ! print " Version : BioRuby #{Bio::BIORUBY_VERSION.join(".")}" ! print " / Ruby #{RUBY_VERSION}" ! puts ! puts end def closing_splash ! puts ! puts if @config[:color] ! print splash_message_color else ! print splash_message end ! puts ! puts end --- 520,545 ---- end if @config[:color] ! STDERR.print splash_message_color else ! STDERR.print splash_message end ! STDERR.puts ! STDERR.puts ! STDERR.print " Version : BioRuby #{Bio::BIORUBY_VERSION.join(".")}" ! STDERR.print " / Ruby #{RUBY_VERSION}" ! STDERR.puts ! STDERR.puts end def closing_splash ! STDERR.puts ! STDERR.puts if @config[:color] ! STDERR.print splash_message_color else ! STDERR.print splash_message end ! STDERR.puts ! STDERR.puts end From k at dev.open-bio.org Wed Mar 28 20:21:28 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 28 Mar 2007 20:21:28 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/shell setup.rb, 1.1, 1.2 script.rb, 1.1, 1.2 Message-ID: <200703282021.l2SKLSkM008526@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/shell In directory dev.open-bio.org:/tmp/cvs-serv8522/shell Modified Files: setup.rb script.rb Log Message: * enhanced to store :mode in Bio::Shell.cache * changed to execute bioruby script directly (instead of chdir to workdir etc.) and core.rb is modified to print messages to STDERR, user can capture result of the BioRuby script (STDOUT only) by % bioruby foo/bar/script.rb > result.txt however, this change also introduces possible problem that if the script depends on the serialized objects stored in shell/session/object file, user must chdir by him/her-self to the bioruby project directory so that bioruby shell can find shell/ directory in it. Index: setup.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/setup.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** setup.rb 24 Dec 2006 08:32:08 -0000 1.1 --- setup.rb 28 Mar 2007 20:21:26 -0000 1.2 *************** *** 23,34 **** # load configuration and plugins ! Dir.chdir(@workdir) Bio::Shell.configure Bio::Shell.cache[:workdir] = @workdir # set default to irb mode ! @mode ||= :irb ! case @mode when :web # setup rails server --- 23,34 ---- # load configuration and plugins ! Dir.chdir(@workdir) if @workdir Bio::Shell.configure Bio::Shell.cache[:workdir] = @workdir # set default to irb mode ! Bio::Shell.cache[:mode] = @mode || :irb ! case Bio::Shell.cache[:mode] when :web # setup rails server *************** *** 87,92 **** elsif File.file?(arg) # run file as a bioruby shell script ! @workdir = File.join(File.dirname(arg), "..") ! @script = File.basename(arg) @mode = :script else --- 87,92 ---- elsif File.file?(arg) # run file as a bioruby shell script ! @workdir = nil ! @script = arg @mode = :script else Index: script.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell/script.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** script.rb 24 Dec 2006 08:32:08 -0000 1.1 --- script.rb 28 Mar 2007 20:21:26 -0000 1.2 *************** *** 16,20 **** Bio::Shell.cache[:binding] = TOPLEVEL_BINDING Bio::Shell.load_session ! eval(File.read(File.join(Bio::Shell.script_dir, script)), TOPLEVEL_BINDING) exit end --- 16,20 ---- Bio::Shell.cache[:binding] = TOPLEVEL_BINDING Bio::Shell.load_session ! eval(File.read(script), TOPLEVEL_BINDING) exit end From k at dev.open-bio.org Wed Mar 28 20:23:41 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Wed, 28 Mar 2007 20:23:41 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio shell.rb,1.17,1.18 Message-ID: <200703282023.l2SKNfM0008588@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio In directory dev.open-bio.org:/tmp/cvs-serv8584 Modified Files: shell.rb Log Message: * added das plugin Index: shell.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/shell.rb,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** shell.rb 24 Dec 2006 08:32:08 -0000 1.17 --- shell.rb 28 Mar 2007 20:23:39 -0000 1.18 *************** *** 31,34 **** --- 31,35 ---- require 'bio/shell/plugin/flatfile' require 'bio/shell/plugin/obda' + require 'bio/shell/plugin/das' require 'bio/shell/plugin/keggapi' require 'bio/shell/plugin/emboss' From nakao at dev.open-bio.org Wed Mar 28 20:48:13 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Wed, 28 Mar 2007 20:48:13 +0000 Subject: [BioRuby-cvs] bioruby/test/functional/bio/io test_soapwsdl.rb, 1.2, 1.3 Message-ID: <200703282048.l2SKmDMf008660@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/functional/bio/io In directory dev.open-bio.org:/tmp/cvs-serv8640/test/functional/bio/io Modified Files: test_soapwsdl.rb Log Message: * Changed licence (GPL2 -> Ruby's) Index: test_soapwsdl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/functional/bio/io/test_soapwsdl.rb,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_soapwsdl.rb 20 Jan 2006 12:04:03 -0000 1.2 --- test_soapwsdl.rb 28 Mar 2007 20:48:11 -0000 1.3 *************** *** 1,20 **** # ! # test/functional/bio/io/test_soapwsdl.rb - Unit test for SOAP/WSDL ! # ! # Copyright (C) 2005 Mitsuteru Nakao ! # ! # This library is free software; you can redistribute it and/or ! # modify it under the terms of the GNU Lesser General Public ! # License as published by the Free Software Foundation; either ! # version 2 of the License, or (at your option) any later version. ! # ! # This library is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! # Lesser General Public License for more details. # ! # You should have received a copy of the GNU Lesser General Public ! # License along with this library; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # $Id$ --- 1,8 ---- # ! # test/functional/bio/io/test_soapwsdl.rb - Functional test for SOAP/WSDL # ! # Copyright:: Copyright (C) 2005,2007 ! # Mitsuteru C. Nakao ! # License:: Ruby's # # $Id$ From aerts at dev.open-bio.org Wed Mar 28 21:25:04 2007 From: aerts at dev.open-bio.org (Jan Aerts) Date: Wed, 28 Mar 2007 21:25:04 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio test_map.rb,1.3,1.4 Message-ID: <200703282125.l2SLP4VG008858@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio In directory dev.open-bio.org:/tmp/cvs-serv8838 Modified Files: test_map.rb Log Message: Trivial. Index: test_map.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/unit/bio/test_map.rb,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_map.rb 27 Jun 2006 12:37:42 -0000 1.3 --- test_map.rb 28 Mar 2007 21:25:02 -0000 1.4 *************** *** 112,116 **** end ! class CloneActsLikeMap include Bio::Map::ActsLikeMap def initialize --- 112,116 ---- end ! class CloneToActLikeMap include Bio::Map::ActsLikeMap def initialize *************** *** 122,129 **** class TestActsLikeMap < Test::Unit::TestCase def setup ! @clone = CloneActsLikeMap.new end def test_mixin ! assert_instance_of(CloneActsLikeMap, @clone) assert_respond_to(@clone, 'contains_marker?') assert_respond_to(@clone, 'add_mapping_as_map') --- 122,129 ---- class TestActsLikeMap < Test::Unit::TestCase def setup ! @clone = CloneToActLikeMap.new end def test_mixin ! assert_instance_of(CloneToActLikeMap, @clone) assert_respond_to(@clone, 'contains_marker?') assert_respond_to(@clone, 'add_mapping_as_map') *************** *** 132,136 **** end ! class CloneActsLikeMarker include Bio::Map::ActsLikeMarker def initialize --- 132,136 ---- end ! class CloneToActLikeMarker include Bio::Map::ActsLikeMarker def initialize *************** *** 142,150 **** class TestActsLikeMarker < Test::Unit::TestCase def setup ! @clone = CloneActsLikeMarker.new end def test_mixin ! assert_instance_of(CloneActsLikeMarker, @clone) assert_respond_to(@clone, 'mapped_to?') assert_respond_to(@clone, 'add_mapping_as_marker') --- 142,150 ---- class TestActsLikeMarker < Test::Unit::TestCase def setup ! @clone = CloneToActLikeMarker.new end def test_mixin ! assert_instance_of(CloneToActLikeMarker, @clone) assert_respond_to(@clone, 'mapped_to?') assert_respond_to(@clone, 'add_mapping_as_marker') *************** *** 152,156 **** end ! class CloneActsLikeMapAndMarker include Bio::Map::ActsLikeMap include Bio::Map::ActsLikeMarker --- 152,156 ---- end ! class CloneToActLikeMapAndMarker include Bio::Map::ActsLikeMap include Bio::Map::ActsLikeMarker *************** *** 164,174 **** class TestActsLikeMapAndMarker < Test::Unit::TestCase def setup ! @clone_a = CloneActsLikeMapAndMarker.new ! @clone_b = CloneActsLikeMapAndMarker.new @clone_a.add_mapping_as_map(@clone_b, nil) end def test_mixin ! assert_instance_of(CloneActsLikeMapAndMarker, @clone_a) assert_respond_to(@clone_a, 'contains_marker?') assert_respond_to(@clone_a, 'add_mapping_as_map') --- 164,174 ---- class TestActsLikeMapAndMarker < Test::Unit::TestCase def setup ! @clone_a = CloneToActLikeMapAndMarker.new ! @clone_b = CloneToActLikeMapAndMarker.new @clone_a.add_mapping_as_map(@clone_b, nil) end def test_mixin ! assert_instance_of(CloneToActLikeMapAndMarker, @clone_a) assert_respond_to(@clone_a, 'contains_marker?') assert_respond_to(@clone_a, 'add_mapping_as_map') *************** *** 182,197 **** end end - - class Clone - include Bio::Map::ActsLikeMap - include Bio::Map::ActsLikeMarker - - def initialize(name) - @name = name - @mappings_as_map = Array.new - @mappings_as_marker = Array.new - end - attr_accessor :name, :mappings_as_map, :mappings_as_marker - end - end --- 182,184 ---- From trevor at dev.open-bio.org Thu Mar 29 02:48:17 2007 From: trevor at dev.open-bio.org (Trevor Wennblom) Date: Thu, 29 Mar 2007 02:48:17 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/util/restriction_enzyme/double_stranded cut_location_pair.rb, 1.4, 1.5 Message-ID: <200703290248.l2T2mHks009375@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-serv9353/bio/util/restriction_enzyme/double_stranded Modified Files: cut_location_pair.rb Log Message: Patch for Range weirdness. 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.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** cut_location_pair.rb 2 Jan 2007 06:18:38 -0000 1.4 --- cut_location_pair.rb 29 Mar 2007 02:48:15 -0000 1.5 *************** *** 63,67 **** a,b = init_with_array( pair[0] ) ! elsif pair[0].kind_of? Range # FIXME This seems to be broken? Check tests a,b = init_with_array( [pair[0].first, pair[0].last] ) --- 63,70 ---- a,b = init_with_array( pair[0] ) ! # no idea why this barfs without the second half during test/runner.rb ! # are there two Range objects running around? ! elsif pair[0].kind_of? Range or (pair[0].class.to_s == 'Range') ! #elsif pair[0].kind_of? Range a,b = init_with_array( [pair[0].first, pair[0].last] ) *************** *** 108,110 **** end # CutLocationPair end # DoubleStranded ! end # Bio::RestrictionEnzyme \ No newline at end of file --- 111,113 ---- end # CutLocationPair end # DoubleStranded ! end # Bio::RestrictionEnzyme From trevor at dev.open-bio.org Thu Mar 29 02:48:17 2007 From: trevor at dev.open-bio.org (Trevor Wennblom) Date: Thu, 29 Mar 2007 02:48:17 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/util/restriction_enzyme/range/sequence_range calculated_cuts.rb, 1.3, 1.4 Message-ID: <200703290248.l2T2mHPu009378@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-serv9353/bio/util/restriction_enzyme/range/sequence_range Modified Files: calculated_cuts.rb Log Message: Patch for Range weirdness. 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.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** calculated_cuts.rb 6 Jan 2007 05:35:05 -0000 1.3 --- calculated_cuts.rb 29 Mar 2007 02:48:15 -0000 1.4 *************** *** 13,16 **** --- 13,17 ---- $:.unshift(libpath) unless $:.include?(libpath) + 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' *************** *** 251,253 **** end # SequenceRange end # Range ! end # Bio::RestrictionEnzyme \ No newline at end of file --- 252,254 ---- end # SequenceRange end # Range ! end # Bio::RestrictionEnzyme From trevor at dev.open-bio.org Thu Mar 29 03:18:28 2007 From: trevor at dev.open-bio.org (Trevor Wennblom) Date: Thu, 29 Mar 2007 03:18:28 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio/db test_soft.rb,1.1,1.2 Message-ID: <200703290318.l2T3ISl8009477@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio/db In directory dev.open-bio.org:/tmp/cvs-serv9457/test/unit/bio/db Modified Files: test_soft.rb Log Message: Fix path resolution for SOFT tests. Index: test_soft.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/unit/bio/db/test_soft.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_soft.rb 2 Feb 2007 06:13:10 -0000 1.1 --- test_soft.rb 29 Mar 2007 03:18:26 -0000 1.2 *************** *** 20,25 **** def setup ! @obj_series = Bio::SOFT.new( IO.readlines('../../../data/soft/GSE3457_family_partial.soft')) ! @obj_dataset = Bio::SOFT.new( IO.readlines('../../../data/soft/GDS100_partial.soft')) end --- 20,30 ---- def setup ! bioruby_root = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4)).cleanpath.to_s ! test_data_path = Pathname.new(File.join(bioruby_root, 'test', 'data', 'soft')).cleanpath.to_s ! series_filename = File.join(test_data_path, 'GSE3457_family_partial.soft') ! dataset_filename = File.join(test_data_path, 'GDS100_partial.soft') ! ! @obj_series = Bio::SOFT.new( IO.readlines(series_filename)) ! @obj_dataset = Bio::SOFT.new( IO.readlines(dataset_filename)) end *************** *** 131,133 **** end ! end \ No newline at end of file --- 136,138 ---- end ! end From nakao at dev.open-bio.org Thu Mar 29 05:24:30 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Thu, 29 Mar 2007 05:24:30 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io ensembl.rb,1.6,1.7 Message-ID: <200703290524.l2T5OUVK009721@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv9701/lib/bio/io Modified Files: ensembl.rb Log Message: * Fixed a bug in exportview argument parsing. Index: ensembl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/ensembl.rb,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ensembl.rb 28 Mar 2007 12:31:48 -0000 1.6 --- ensembl.rb 29 Mar 2007 05:24:27 -0000 1.7 *************** *** 65,70 **** --- 65,72 ---- ENSEMBL_URL = 'http://www.ensembl.org' + # Server URL (ex. 'http://www.ensembl.org') attr_reader :server + # Organism name. (ex. 'Homo_sapiens'). attr_reader :organism *************** *** 138,157 **** # def exportview(*args) - if args.first.class == Hash - options = args.first - else - options = { - :seq_region_name => args[0], - :anchor1 => args[1], - :anchor2 => args[2], - } - case args.size - when 3 then - options.update({:format => 'fasta'}) - when 4 then - options.update({:format => 'gff', :options => args[3]}) - end - end - defaults = { :type1 => 'bp', --- 140,143 ---- *************** *** 167,170 **** --- 153,170 ---- } + if args.first.class == Hash + options = args.first + options.update({:format => 'gff'}) if options[:options] and options[:format] != 'fasta' + else + options = { + :seq_region_name => args[0], + :anchor1 => args[1], + :anchor2 => args[2], + } + if args.size >= 4 + options.update({:format => 'gff', :options => args[3]}) + end + end + params = defaults.update(options) From nakao at dev.open-bio.org Thu Mar 29 05:25:02 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Thu, 29 Mar 2007 05:25:02 +0000 Subject: [BioRuby-cvs] bioruby/test/functional/bio/io test_ensembl.rb, NONE, 1.1 Message-ID: <200703290525.l2T5P2X0009749@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/functional/bio/io In directory dev.open-bio.org:/tmp/cvs-serv9729/test/functional/bio/io Added Files: test_ensembl.rb Log Message: * Added functional test for Bio::Ensembl. --- NEW FILE: test_ensembl.rb --- # # test/functional/bio/io/test_ensembl.rb - Functional test for Bio::Ensembl # # Copyright:: Copyright (C) 2007 # Mitsuteru C. Nakao # License:: Ruby's # # $Id: test_ensembl.rb,v 1.1 2007/03/29 05:24:59 nakao Exp $ # require 'pathname' libpath = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4, 'lib')).cleanpath.to_s $:.unshift(libpath) unless $:.include?(libpath) require 'test/unit' require 'bio/io/ensembl' module Bio class FuncTestEnsembl < Test::Unit::TestCase def setup @serv = Bio::Ensembl.new('Homo_sapiens') end def test_class assert_equal(Bio::Ensembl, @serv.class) end end class FuncTestEnsemblHuman < Test::Unit::TestCase def setup @serv = Bio::Ensembl.human end def test_organism assert_equal("Homo_sapiens", @serv.organism) end def test_server assert_equal("http://www.ensembl.org", @serv.server) end def test_fna_exportview seq = ">4 dna:chromosome chromosome:NCBI36:4:1149206:1149209:1\nGAGA\n" fna = @serv.exportview(4, 1149206, 1149209) assert_equal(seq, fna) end def test_fna_exportview_with_named_args seq = ">4 dna:chromosome chromosome:NCBI36:4:1149206:1149209:1\nGAGA\n" fna = @serv.exportview(:seq_region_name => 4, :anchor1 => 1149206, :anchor2 => 1149209) assert_equal(seq, fna) end def test_gff_exportview line = "chromosome:NCBI36:4:1149206:1149209:1\tEnsembl\tGene\t-839\t2747\t.\t+\t.\tgene_id=ENSG00000206158; transcript_id=ENST00000382964; exon_id=ENSE00001494097; gene_type=KNOWN_protein_coding\n" gff = @serv.exportview(4, 1149206, 1149209, ['gene']) assert_equal(line, gff) end def test_gff_exportview_with_named_args line = "chromosome:NCBI36:4:1149206:1149209:1\tEnsembl\tGene\t-839\t2747\t.\t+\t.\tgene_id=ENSG00000206158; transcript_id=ENST00000382964; exon_id=ENSE00001494097; gene_type=KNOWN_protein_coding\n" gff = @serv.exportview(:seq_region_name => 4, :anchor1 => 1149206, :anchor2 => 1149209, :options => ['gene']) assert_equal(line, gff) end end end # module Bio From nakao at dev.open-bio.org Thu Mar 29 05:50:45 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Thu, 29 Mar 2007 05:50:45 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io ensembl.rb,1.7,1.8 Message-ID: <200703290550.l2T5oj1e009846@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv9824/lib/bio/io Modified Files: ensembl.rb Log Message: * Fixed bugs in exportview argument parsing. Index: ensembl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/ensembl.rb,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ensembl.rb 29 Mar 2007 05:24:27 -0000 1.7 --- ensembl.rb 29 Mar 2007 05:50:43 -0000 1.8 *************** *** 155,159 **** if args.first.class == Hash options = args.first ! options.update({:format => 'gff'}) if options[:options] and options[:format] != 'fasta' else options = { --- 155,161 ---- if args.first.class == Hash options = args.first ! if options[:options] and options[:format] != 'fasta' and options[:format] != 'tab' ! options.update({:format => 'gff'}) ! end else options = { From nakao at dev.open-bio.org Thu Mar 29 05:50:45 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Thu, 29 Mar 2007 05:50:45 +0000 Subject: [BioRuby-cvs] bioruby/test/functional/bio/io test_ensembl.rb, 1.1, 1.2 Message-ID: <200703290550.l2T5ojwk009851@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/functional/bio/io In directory dev.open-bio.org:/tmp/cvs-serv9824/test/functional/bio/io Modified Files: test_ensembl.rb Log Message: * Fixed bugs in exportview argument parsing. Index: test_ensembl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/functional/bio/io/test_ensembl.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_ensembl.rb 29 Mar 2007 05:24:59 -0000 1.1 --- test_ensembl.rb 29 Mar 2007 05:50:43 -0000 1.2 *************** *** 71,74 **** --- 71,84 ---- end + def test_tab_exportview_with_named_args + line = "seqname\tsource\tfeature\tstart\tend\tscore\tstrand\tframe\tgene_id\ttranscript_id\texon_id\tgene_type\nchromosome:NCBI36:4:1149206:1149209:1\tEnsembl\tGene\t-839\t2747\t.\t+\t.\tENSG00000206158\tENST00000382964\tENSE00001494097\tKNOWN_protein_coding\n" + gff = @serv.exportview(:seq_region_name => 4, + :anchor1 => 1149206, + :anchor2 => 1149209, + :options => ['gene'], + :format => 'tab') + assert_equal(line, gff) + end + end From nakao at dev.open-bio.org Thu Mar 29 08:00:06 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Thu, 29 Mar 2007 08:00:06 +0000 Subject: [BioRuby-cvs] bioruby/test/functional/bio/io test_ensembl.rb, 1.2, 1.3 Message-ID: <200703290800.l2T806XF010039@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/functional/bio/io In directory dev.open-bio.org:/tmp/cvs-serv10014/test/functional/bio/io Modified Files: test_ensembl.rb Log Message: * Added tests. Index: test_ensembl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/functional/bio/io/test_ensembl.rb,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_ensembl.rb 29 Mar 2007 05:50:43 -0000 1.2 --- test_ensembl.rb 29 Mar 2007 08:00:04 -0000 1.3 *************** *** 48,51 **** --- 48,57 ---- end + def test_fasta_exportview_with_hash_4th_params + fna = @serv.exportview(4, 1149206, 1149209, :upstream => 10) + fna10 = @serv.exportview(4, 1149196, 1149209) + assert_equal(fna10, fna) + end + def test_fna_exportview_with_named_args seq = ">4 dna:chromosome chromosome:NCBI36:4:1149206:1149209:1\nGAGA\n" *************** *** 56,59 **** --- 62,76 ---- end + def test_fasta_exportview_with_named_args_and_hash_4th_params + fna = @serv.exportview(:seq_region_name => 4, + :anchor1 => 1149206, + :anchor2 => 1149209, + :upstream => 10) + fna10 = @serv.exportview(:seq_region_name => 4, + :anchor1 => 1149196, + :anchor2 => 1149209) + assert_equal(fna10, fna) + end + def test_gff_exportview line = "chromosome:NCBI36:4:1149206:1149209:1\tEnsembl\tGene\t-839\t2747\t.\t+\t.\tgene_id=ENSG00000206158; transcript_id=ENST00000382964; exon_id=ENSE00001494097; gene_type=KNOWN_protein_coding\n" *************** *** 81,84 **** --- 98,102 ---- end + end From nakao at dev.open-bio.org Thu Mar 29 08:00:06 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Thu, 29 Mar 2007 08:00:06 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io ensembl.rb,1.8,1.9 Message-ID: <200703290800.l2T806Dq010036@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv10014/lib/bio/io Modified Files: ensembl.rb Log Message: * Added tests. Index: ensembl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/ensembl.rb,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ensembl.rb 29 Mar 2007 05:50:43 -0000 1.8 --- ensembl.rb 29 Mar 2007 08:00:04 -0000 1.9 *************** *** 110,113 **** --- 110,120 ---- # 'genscan', 'variation', 'gene']) # human.exportview(1, 1149206, 1150000, ['variation', 'gene']) + # + # Feature in TAB + # human.exportview(:seq_region_name => 1, + # :anchor1 => 1149206, :anchor2 => 1150000, + # :options => ['similarity', 'repeat', + # 'genscan', 'variation', 'gene'], + # :format => 'tab') # # == Arguments *************** *** 164,169 **** :anchor2 => args[2], } ! if args.size >= 4 options.update({:format => 'gff', :options => args[3]}) end end --- 171,184 ---- :anchor2 => args[2], } ! ! case args[3] ! when Array options.update({:format => 'gff', :options => args[3]}) + when Hash + options.update(args[3]) + end + + if aqrgs[4].class == Hash + options.update(args[4]) end end From nakao at dev.open-bio.org Thu Mar 29 09:02:47 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Thu, 29 Mar 2007 09:02:47 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/appl/iprscan report.rb,1.4,1.5 Message-ID: <200703290902.l2T92lZv010653@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/appl/iprscan In directory dev.open-bio.org:/tmp/cvs-serv10633/lib/bio/appl/iprscan Modified Files: report.rb Log Message: * Fixed a bug to parse merged.txt reports. Index: report.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/iprscan/report.rb,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** report.rb 22 Feb 2007 10:15:01 -0000 1.4 --- report.rb 29 Mar 2007 09:02:44 -0000 1.5 *************** *** 193,197 **** # end def self.reports_in_ptxt(io) ! io.each(/\n\/\/\n/m) do |entry| yield self.parse_in_ptxt(entry) end --- 193,197 ---- # end def self.reports_in_ptxt(io) ! io.each("\n\/\/\n") do |entry| yield self.parse_in_ptxt(entry) end From k at dev.open-bio.org Thu Mar 29 12:14:48 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 29 Mar 2007 12:14:48 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio command.rb,1.15,1.16 Message-ID: <200703291214.l2TCEmBq010969@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio In directory dev.open-bio.org:/tmp/cvs-serv10963/lib/bio Modified Files: command.rb Log Message: * routine for generating CGI arguments is separated from post_form to make_cgi_params Index: command.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/command.rb,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** command.rb 28 Mar 2007 16:54:11 -0000 1.15 --- command.rb 29 Mar 2007 12:14:46 -0000 1.16 *************** *** 277,292 **** end ! data = "" case params when Hash data = params.map do |key, val| ! "#{URI.escape(key.to_s)}=#{URI.escape(val.to_s)}" end.join('&') when Array case params.first ! when Hash, Array data = params.map do |key, val| ! "#{URI.escape(key.to_s)}=#{URI.escape(val.to_s)}" end.join('&') when String --- 277,311 ---- end ! data = make_cgi_params(params) ! ! hash = { ! 'Content-Type' => 'application/x-www-form-urlencoded', ! 'Content-Length' => data.length.to_s ! } ! hash.update(header) ! ! start_http(uri.host, uri.port) do |http| ! http.post(uri.path, data, hash) ! end ! end + def make_cgi_params(params) + data = "" case params when Hash data = params.map do |key, val| ! make_cgi_params_key_value(key, val) end.join('&') when Array case params.first ! when Hash ! data = params.map do |hash| ! hash.map do |key, val| ! make_cgi_params_key_value(key, val) ! end ! end.join('&') ! when Array data = params.map do |key, val| ! make_cgi_params_key_value(key, val) end.join('&') when String *************** *** 298,311 **** data = URI.escape(params.strip) end ! hash = { ! 'Content-Type' => 'application/x-www-form-urlencoded', ! 'Content-Length' => data.length.to_s ! } ! hash.update(header) ! ! start_http(uri.host, uri.port) do |http| ! http.post(uri.path, data, hash) end end --- 317,334 ---- data = URI.escape(params.strip) end + return data + end ! def make_cgi_params_key_value(key, value) ! result = [] ! case value ! when Array ! value.each do |val| ! result << [key, val].map {|x| URI.escape(x.to_s) }.join('=') ! end ! else ! result << [key, value].map {|x| URI.escape(x.to_s) }.join('=') end + return result end From k at dev.open-bio.org Thu Mar 29 12:14:48 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 29 Mar 2007 12:14:48 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio test_command.rb,1.3,1.4 Message-ID: <200703291214.l2TCEmXa010972@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio In directory dev.open-bio.org:/tmp/cvs-serv10963/test/unit/bio Modified Files: test_command.rb Log Message: * routine for generating CGI arguments is separated from post_form to make_cgi_params Index: test_command.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/unit/bio/test_command.rb,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_command.rb 27 Jul 2006 03:50:36 -0000 1.3 --- test_command.rb 29 Mar 2007 12:14:46 -0000 1.4 *************** *** 131,134 **** --- 131,288 ---- end + def test_make_cgi_params_by_hash_in_symbol + ary = [ + "type1=bp", + "type2=bp", + "downstream=", + "upstream=", + "format=fasta", + "options=similarity", + "options=gene", + "action=export", + "_format=Text", + "output=txt", + "submit=Continue%20%3E%3E", + ] + hash = { + :type1 => 'bp', + :type2 => 'bp', + :downstream => '', + :upstream => '', + :format => 'fasta', + :options => ['similarity', 'gene'], + :action => 'export', + :_format => 'Text', + :output => 'txt', + :submit => 'Continue >>', + } + result = Bio::Command.make_cgi_params(hash) + ary.each do |str| + assert_match(str, result) + end + end + + def test_make_cgi_params_by_hash_in_string + ary = [ + "type1=bp", + "type2=bp", + "downstream=", + "upstream=", + "format=fasta", + "options=similarity", + "options=gene", + "action=export", + "_format=Text", + "output=txt", + "submit=Continue%20%3E%3E", + ] + hash = { + "type1" => 'bp', + "type2" => 'bp', + "downstream" => '', + "upstream" => '', + "format" => 'fasta', + "options" => ['similarity', 'gene'], + "action" => 'export', + "_format" => 'Text', + "output" => 'txt', + "submit" => 'Continue >>', + } + result = Bio::Command.make_cgi_params(hash) + ary.each do |str| + assert_match(str, result) + end + end + + def test_make_cgi_params_by_array_of_array + ary = [ + "type1=bp", + "type2=bp", + "downstream=", + "upstream=", + "format=fasta", + "options=similarity", + "options=gene", + "action=export", + "_format=Text", + "output=txt", + "submit=Continue%20%3E%3E", + ] + array_of_array = [ + ["type1", 'bp'], + ["type2", 'bp'], + ["downstream", ''], + ["upstream", ''], + ["format", 'fasta'], + ["options", ['similarity', 'gene']], + ["action", 'export'], + ["_format", 'Text'], + ["output", 'txt'], + ["submit", 'Continue >>'], + ] + result = Bio::Command.make_cgi_params(array_of_array) + ary.each do |str| + assert_match(str, result) + end + end + + def test_make_cgi_params_by_array_of_hash + ary = [ + "type1=bp", + "type2=bp", + "downstream=", + "upstream=", + "format=fasta", + "options=similarity", + "options=gene", + "action=export", + "_format=Text", + "output=txt", + "submit=Continue%20%3E%3E", + ] + array_of_hash = [ + {"type1" => 'bp'}, + {"type2" => 'bp'}, + {"downstream" => ''}, + {"upstream" => ''}, + {"format" => 'fasta'}, + {"options" => ['similarity', 'gene']}, + {"action" => 'export'}, + {"_format" => 'Text'}, + {"output" => 'txt'}, + {"submit" => 'Continue >>'}, + ] + result = Bio::Command.make_cgi_params(array_of_hash) + ary.each do |str| + assert_match(str, result) + end + end + + def test_make_cgi_params_by_array_of_string + str = "type1=bp&type2=bp&downstream=&upstream=&format=fasta&options=similarity&options=gene&action=export&_format=Text&output=txt&submit=Continue%20%3E%3E" + array_of_string = [ + "type1=bp", + "type2=bp", + "downstream=", + "upstream=", + "format=fasta", + "options=similarity", + "options=gene", + "action=export", + "_format=Text", + "output=txt", + "submit=Continue >>", + ] + result = Bio::Command.make_cgi_params(array_of_string) + assert_equal(str, result) + end + + def test_make_cgi_params_by_string + string = "type1=bp&type2=bp&downstream=&upstream=&format=fasta&options=similarity&options=gene&action=export&_format=Text&output=txt&submit=Continue%20%3E%3E" + query = " type1=bp&type2=bp&downstream=&upstream=&format=fasta&options=similarity&options=gene&action=export&_format=Text&output=txt&submit=Continue >> " + result = Bio::Command.make_cgi_params(query) + assert_equal(string, result) + end + end end From k at dev.open-bio.org Thu Mar 29 12:43:38 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 29 Mar 2007 12:43:38 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db/kegg cell.rb,1.7,NONE Message-ID: <200703291243.l2TChcSU011309@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db/kegg In directory dev.open-bio.org:/tmp/cvs-serv11287/db/kegg Removed Files: cell.rb Log Message: * KEGG CELL module is removed as the database is not publically available any more (for now) --- cell.rb DELETED --- From k at dev.open-bio.org Thu Mar 29 12:44:27 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 29 Mar 2007 12:44:27 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io fastacmd.rb,1.14,1.15 Message-ID: <200703291244.l2TCiRGT011363@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv11336/io Modified Files: fastacmd.rb Log Message: * license is changed from LGPL to Ruby's by permission of author Index: fastacmd.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/fastacmd.rb,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** fastacmd.rb 31 Dec 2006 21:54:49 -0000 1.14 --- fastacmd.rb 29 Mar 2007 12:44:25 -0000 1.15 *************** *** 7,32 **** # Mitsuteru C. Nakao , # Jan Aerts ! # License:: LGPL # # $Id$ # - #-- - # - # This library is free software; you can redistribute it and/or - # modify it under the terms of the GNU Lesser General Public - # License as published by the Free Software Foundation; either - # version 2 of the License, or (at your option) any later version. - # - # This library is distributed in the hope that it will be useful, - # but WITHOUT ANY WARRANTY; without even the implied warranty of - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - # Lesser General Public License for more details. - # - # You should have received a copy of the GNU Lesser General Public - # License along with this library; if not, write to the Free Software - # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - # - #++ - # require 'bio/db/fasta' --- 7,14 ---- # Mitsuteru C. Nakao , # Jan Aerts ! # License:: Ruby's # # $Id$ # require 'bio/db/fasta' From k at dev.open-bio.org Thu Mar 29 12:47:00 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 29 Mar 2007 12:47:00 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db transfac.rb,1.10,1.11 Message-ID: <200703291247.l2TCl0FG011482@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db In directory dev.open-bio.org:/tmp/cvs-serv11467/db Modified Files: transfac.rb Log Message: * license is changed from LGPL to Ruby's with permission from author Index: transfac.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/transfac.rb,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** transfac.rb 28 Nov 2005 04:57:33 -0000 1.10 --- transfac.rb 29 Mar 2007 12:46:58 -0000 1.11 *************** *** 1,22 **** # ! # bio/db/transfac.rb - TRANSFAC database class ! # ! # Copyright (C) 2001 KAWASHIMA Shuichi ! # ! # This library is free software; you can redistribute it and/or ! # modify it under the terms of the GNU Lesser General Public ! # License as published by the Free Software Foundation; either ! # version 2 of the License, or (at your option) any later version. ! # ! # This library is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! # Lesser General Public License for more details. # ! # You should have received a copy of the GNU Lesser General Public ! # License along with this library; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # ! # $Id$ # --- 1,10 ---- # ! # = bio/db/transfac.rb - TRANSFAC database class # ! # Copyright:: Copyright (C) 2001 ! # Shuichi Kawashima ! # License:: Ruby's # ! # $Id$ # From k at dev.open-bio.org Thu Mar 29 12:50:51 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 29 Mar 2007 12:50:51 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db pdb.rb,1.6,1.7 Message-ID: <200703291250.l2TCopdY011674@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db In directory dev.open-bio.org:/tmp/cvs-serv11658/db Modified Files: pdb.rb Log Message: * license is changed from LGPL to Ruby's with permission from authors Index: pdb.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb.rb,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pdb.rb 29 Jan 2006 06:54:13 -0000 1.6 --- pdb.rb 29 Mar 2007 12:50:49 -0000 1.7 *************** *** 1,22 **** # ! # bio/db/pdb.rb - PDB database classes ! # ! # Copyright (C) 2004 GOTO Naohisa ! # ! # This library is free software; you can redistribute it and/or ! # modify it under the terms of the GNU Lesser General Public ! # License as published by the Free Software Foundation; either ! # version 2 of the License, or (at your option) any later version. ! # ! # This library is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! # Lesser General Public License for more details. # ! # You should have received a copy of the GNU Lesser General Public ! # License along with this library; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # ! # $Id$ # --- 1,10 ---- # ! # = bio/db/pdb.rb - PDB database classes # ! # Copyright:: Copyright (C) 2004 ! # GOTO Naohisa ! # License:: Ruby's # ! # $Id$ # From k at dev.open-bio.org Thu Mar 29 12:50:51 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 29 Mar 2007 12:50:51 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/db/pdb atom.rb, 1.6, 1.7 chain.rb, 1.6, 1.7 chemicalcomponent.rb, 1.1, 1.2 model.rb, 1.7, 1.8 pdb.rb, 1.19, 1.20 residue.rb, 1.10, 1.11 utils.rb, 1.5, 1.6 Message-ID: <200703291250.l2TCopnB011679@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/db/pdb In directory dev.open-bio.org:/tmp/cvs-serv11658/db/pdb Modified Files: atom.rb chain.rb chemicalcomponent.rb model.rb pdb.rb residue.rb utils.rb Log Message: * license is changed from LGPL to Ruby's with permission from authors Index: atom.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb/atom.rb,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** atom.rb 8 Jan 2006 12:59:04 -0000 1.6 --- atom.rb 29 Mar 2007 12:50:49 -0000 1.7 *************** *** 5,27 **** # Alex Gutteridge # Naohisa Goto ! # License:: LGPL ! # ! # $Id$ ! # ! #-- ! # This library is free software; you can redistribute it and/or ! # modify it under the terms of the GNU Lesser General Public ! # License as published by the Free Software Foundation; either ! # version 2 of the License, or (at your option) any later version. ! # ! # This library is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! # Lesser General Public License for more details. # ! # You should have received a copy of the GNU Lesser General Public ! # License along with this library; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! #++ # # = Bio::PDB::Coordinate --- 5,11 ---- # Alex Gutteridge # Naohisa Goto ! # License:: Ruby's # ! # $Id$ # # = Bio::PDB::Coordinate Index: residue.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb/residue.rb,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** residue.rb 20 Jan 2006 13:54:08 -0000 1.10 --- residue.rb 29 Mar 2007 12:50:49 -0000 1.11 *************** *** 5,27 **** # Alex Gutteridge # Naohisa Goto ! # License:: LGPL ! # ! # $Id$ ! # ! #-- ! # This library is free software; you can redistribute it and/or ! # modify it under the terms of the GNU Lesser General Public ! # License as published by the Free Software Foundation; either ! # version 2 of the License, or (at your option) any later version. ! # ! # This library is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! # Lesser General Public License for more details. # ! # You should have received a copy of the GNU Lesser General Public ! # License along with this library; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! #++ # # = Bio::PDB::Residue --- 5,11 ---- # Alex Gutteridge # Naohisa Goto ! # License:: Ruby's # ! # $Id$ # # = Bio::PDB::Residue Index: model.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb/model.rb,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** model.rb 20 Jan 2006 13:54:08 -0000 1.7 --- model.rb 29 Mar 2007 12:50:49 -0000 1.8 *************** *** 5,27 **** # Alex Gutteridge # Naohisa Goto ! # License:: LGPL ! # ! # $Id$ ! # ! #-- ! # This library is free software; you can redistribute it and/or ! # modify it under the terms of the GNU Lesser General Public ! # License as published by the Free Software Foundation; either ! # version 2 of the License, or (at your option) any later version. ! # ! # This library is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! # Lesser General Public License for more details. # ! # You should have received a copy of the GNU Lesser General Public ! # License along with this library; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! #++ # # = Bio::PDB::Model --- 5,11 ---- # Alex Gutteridge # Naohisa Goto ! # License:: Ruby's # ! # $Id$ # # = Bio::PDB::Model Index: pdb.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb/pdb.rb,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** pdb.rb 28 Mar 2007 10:25:17 -0000 1.19 --- pdb.rb 29 Mar 2007 12:50:49 -0000 1.20 *************** *** 5,28 **** # GOTO Naohisa # Alex Gutteridge ! # License:: LGPL # # $Id$ # - #-- - # This library is free software; you can redistribute it and/or - # modify it under the terms of the GNU Lesser General Public - # License as published by the Free Software Foundation; either - # version 2 of the License, or (at your option) any later version. - # - # This library is distributed in the hope that it will be useful, - # but WITHOUT ANY WARRANTY; without even the implied warranty of - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - # Lesser General Public License for more details. - # - # You should have received a copy of the GNU Lesser General Public - # License along with this library; if not, write to the Free Software - # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - #++ - # # = About Bio::PDB # --- 5,12 ---- # GOTO Naohisa # Alex Gutteridge ! # License:: Ruby's # # $Id$ # # = About Bio::PDB # Index: utils.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb/utils.rb,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** utils.rb 8 Jan 2006 12:59:04 -0000 1.5 --- utils.rb 29 Mar 2007 12:50:49 -0000 1.6 *************** *** 5,27 **** # Alex Gutteridge # Naohisa Goto ! # License:: LGPL ! # ! # $Id$ ! # ! #-- ! # This library is free software; you can redistribute it and/or ! # modify it under the terms of the GNU Lesser General Public ! # License as published by the Free Software Foundation; either ! # version 2 of the License, or (at your option) any later version. ! # ! # This library is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! # Lesser General Public License for more details. # ! # You should have received a copy of the GNU Lesser General Public ! # License along with this library; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! #++ # # = Bio::PDB::Utils --- 5,11 ---- # Alex Gutteridge # Naohisa Goto ! # License:: Ruby's # ! # $Id$ # # = Bio::PDB::Utils Index: chemicalcomponent.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb/chemicalcomponent.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** chemicalcomponent.rb 29 Jan 2006 06:54:13 -0000 1.1 --- chemicalcomponent.rb 29 Mar 2007 12:50:49 -0000 1.2 *************** *** 4,26 **** # Copyright:: Copyright (C) 2006 # GOTO Naohisa ! # License:: LGPL ! # ! # $Id$ ! # ! #-- ! # This library is free software; you can redistribute it and/or ! # modify it under the terms of the GNU Lesser General Public ! # License as published by the Free Software Foundation; either ! # version 2 of the License, or (at your option) any later version. ! # ! # This library is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! # Lesser General Public License for more details. # ! # You should have received a copy of the GNU Lesser General Public ! # License along with this library; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! #++ # # = About Bio::PDB::ChemicalComponent --- 4,10 ---- # Copyright:: Copyright (C) 2006 # GOTO Naohisa ! # License:: Ruby's # ! # $Id$ # # = About Bio::PDB::ChemicalComponent Index: chain.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/db/pdb/chain.rb,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** chain.rb 20 Jan 2006 13:54:08 -0000 1.6 --- chain.rb 29 Mar 2007 12:50:49 -0000 1.7 *************** *** 5,27 **** # Alex Gutteridge # Naohisa Goto ! # License:: LGPL # ! # $Id$ ! # ! #-- ! # This library is free software; you can redistribute it and/or ! # modify it under the terms of the GNU Lesser General Public ! # License as published by the Free Software Foundation; either ! # version 2 of the License, or (at your option) any later version. ! # ! # This library is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! # Lesser General Public License for more details. ! # ! # You should have received a copy of the GNU Lesser General Public ! # License along with this library; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! #++ # # = Bio::PDB::Chain --- 5,11 ---- # Alex Gutteridge # Naohisa Goto ! # License:: Ruby's # ! # $Id$ # # = Bio::PDB::Chain From k at dev.open-bio.org Thu Mar 29 12:52:56 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Thu, 29 Mar 2007 12:52:56 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/util sirna.rb,1.9,1.10 Message-ID: <200703291252.l2TCqua5011790@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/util In directory dev.open-bio.org:/tmp/cvs-serv11770/util Modified Files: sirna.rb Log Message: * removed LGPL notice as the license of this module is changed to Ruby's Index: sirna.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/util/sirna.rb,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** sirna.rb 22 Feb 2007 17:38:41 -0000 1.9 --- sirna.rb 29 Mar 2007 12:52:54 -0000 1.10 *************** *** 39,60 **** # Nature Biotech. 2004 22: 326-330. # - #-- - # - # This library is free software; you can redistribute it and/or - # modify it under the terms of the GNU Lesser General Public - # License as published by the Free Software Foundation; either - # version 2 of the License, or (at your option) any later version. - # - # This library is distributed in the hope that it will be useful, - # but WITHOUT ANY WARRANTY; without even the implied warranty of - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - # Lesser General Public License for more details. - # - # You should have received a copy of the GNU Lesser General Public - # License along with this library; if not, write to the Free Software - # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - # - #++ - # require 'bio/sequence' --- 39,42 ---- From nakao at dev.open-bio.org Thu Mar 29 13:08:48 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Thu, 29 Mar 2007 13:08:48 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio/appl test_fasta.rb,1.1,1.2 Message-ID: <200703291308.l2TD8mY1012008@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio/appl In directory dev.open-bio.org:/tmp/cvs-serv11988/test/unit/bio/appl Modified Files: test_fasta.rb Log Message: * Changed license (GPL2 -> Ruby's). Index: test_fasta.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/unit/bio/appl/test_fasta.rb,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_fasta.rb 18 Dec 2005 16:50:20 -0000 1.1 --- test_fasta.rb 29 Mar 2007 13:08:46 -0000 1.2 *************** *** 2,20 **** # test/unit/bio/appl/test_fasta.rb - Unit test for Bio::Fasta # ! # Copyright (C) 2005 Mitsuteru Nakao ! # ! # This library is free software; you can redistribute it and/or ! # modify it under the terms of the GNU Lesser General Public ! # License as published by the Free Software Foundation; either ! # version 2 of the License, or (at your option) any later version. ! # ! # This library is distributed in the hope that it will be useful, ! # but WITHOUT ANY WARRANTY; without even the implied warranty of ! # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! # Lesser General Public License for more details. ! # ! # You should have received a copy of the GNU Lesser General Public ! # License along with this library; if not, write to the Free Software ! # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # $Id$ --- 2,8 ---- # test/unit/bio/appl/test_fasta.rb - Unit test for Bio::Fasta # ! # Copyright:: Copyright (C) 2006 ! # Mitsuteru C. Nakao ! # License:: Ruby's # # $Id$ From nakao at dev.open-bio.org Thu Mar 29 14:14:19 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Thu, 29 Mar 2007 14:14:19 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/io ensembl.rb,1.9,1.10 Message-ID: <200703291414.l2TEEJPS012260@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/io In directory dev.open-bio.org:/tmp/cvs-serv12238/lib/bio/io Modified Files: ensembl.rb Log Message: * Added backward-conpatibility classes and test codes. Index: ensembl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/io/ensembl.rb,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ensembl.rb 29 Mar 2007 08:00:04 -0000 1.9 --- ensembl.rb 29 Mar 2007 14:14:17 -0000 1.10 *************** *** 179,183 **** end ! if aqrgs[4].class == Hash options.update(args[4]) end --- 179,183 ---- end ! if args[4].class == Hash options.update(args[4]) end *************** *** 196,197 **** --- 196,229 ---- + + # Codes for backward-compatibility. + # + class Bio::Ensembl + EBIServerURI = ENSEMBL_URL + + def self.server_uri(uri = nil) + if uri + @uri = uri + else + @uri || EBIServerURI + end + end + + class Base + def self.exportview(*args) + Bio::Ensembl.new(Organism).exportview(*args) + end + end + + class Human < Base + Organism = Bio::Ensembl.human.organism + end + + class Mouse < Base + Organism = Bio::Ensembl.mouse.organism + end + end # class Bio::Ensembl + + + + From nakao at dev.open-bio.org Thu Mar 29 14:14:19 2007 From: nakao at dev.open-bio.org (Mitsuteru C. Nakao) Date: Thu, 29 Mar 2007 14:14:19 +0000 Subject: [BioRuby-cvs] bioruby/test/unit/bio/io test_ensembl.rb,1.4,1.5 Message-ID: <200703291414.l2TEEJQh012265@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/test/unit/bio/io In directory dev.open-bio.org:/tmp/cvs-serv12238/test/unit/bio/io Modified Files: test_ensembl.rb Log Message: * Added backward-conpatibility classes and test codes. Index: test_ensembl.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/test/unit/bio/io/test_ensembl.rb,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_ensembl.rb 28 Mar 2007 12:24:30 -0000 1.4 --- test_ensembl.rb 29 Mar 2007 14:14:17 -0000 1.5 *************** *** 96,97 **** --- 96,109 ---- end end + + + class TestEnsemblOldStyleClient < Test::Unit::TestCase + class Rice < Bio::Ensembl::Base + Organism = 'Oryza_sativa' + end + + def test_organism + assert_equal('Oryza_sativa', Rice::Organism) + end + end + From k at dev.open-bio.org Fri Mar 30 22:26:17 2007 From: k at dev.open-bio.org (Katayama Toshiaki) Date: Fri, 30 Mar 2007 22:26:17 +0000 Subject: [BioRuby-cvs] bioruby/lib/bio/appl/hmmer report.rb,1.11,1.12 Message-ID: <200703302226.l2UMQHT2019621@dev.open-bio.org> Update of /home/repository/bioruby/bioruby/lib/bio/appl/hmmer In directory dev.open-bio.org:/tmp/cvs-serv19607/lib/bio/appl/hmmer Modified Files: report.rb Log Message: * license is changed to Ruby's with permission from authors Index: report.rb =================================================================== RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/hmmer/report.rb,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** report.rb 31 Dec 2006 21:53:32 -0000 1.11 --- report.rb 30 Mar 2007 22:26:15 -0000 1.12 *************** *** 6,10 **** # Copyright:: Copyright (C) 2005 # Masashi Fujita ! # License:: LGPL # # $Id$ --- 6,10 ---- # Copyright:: Copyright (C) 2005 # Masashi Fujita ! # License:: Ruby's # # $Id$ *************** *** 39,60 **** # http://hmmer.wustl.edu/ # - #-- - # - # This library is free software; you can redistribute it and/or - # modify it under the terms of the GNU Lesser General Public - # License as published by the Free Software Foundation; either - # version 2 of the License, or (at your option) any later version. - # - # This library is distributed in the hope that it will be useful, - # but WITHOUT ANY WARRANTY; without even the implied warranty of - # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - # Lesser General Public License for more details. - # - # You should have received a copy of the GNU Lesser General Public - # License along with this library; if not, write to the Free Software - # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - # - #++ - # require 'bio/appl/hmmer' --- 39,42 ----