From trevor at corevx.com Sun Nov 13 14:03:45 2005 From: trevor at corevx.com (Trevor Wennblom) Date: Sun Nov 13 14:26:24 2005 Subject: [BioRuby] bio/alignment extract_seq question Message-ID: <43778E11.10505@corevx.com> in 'bio/alignment.rb': ### def self.extract_seq(s) seq = nil if seq.is_a?(Bio::Sequence) then seq = s else for m in [ :seq, :naseq, :aaseq ] begin seq = s.send(m) rescue NameError, ArgumentError seq = nil end break if seq end seq = s unless seq end seq end ### Should 'seq.is_a?' be 's.is_a?' From trevor at corevx.com Sun Nov 13 14:53:12 2005 From: trevor at corevx.com (Trevor Wennblom) Date: Sun Nov 13 15:12:10 2005 Subject: [BioRuby] bio/alignment compact! question Message-ID: <437799A8.70400@corevx.com> in 'bio/alignment.rb': ### def compact! #(Array-like) d = [] self.each_pair do |k, s| if !s or s.empty? d << k end end d.each do |k| self.delete(d) end d.empty? ? nil : d end ### should 'self.delete(d)' be 'self.delete(k)' ? From trevor at corevx.com Mon Nov 14 17:59:21 2005 From: trevor at corevx.com (Trevor Wennblom) Date: Mon Nov 14 17:57:38 2005 Subject: [BioRuby] RestrictionEnzyme? Message-ID: <437916C9.3080607@corevx.com> Has anyone started work on a RestrictionEnzyme module like what BioPerl has? http://doc.bioperl.org/releases/bioperl-1.5.0-RC1/Bio/Tools/RestrictionEnzyme.html If no one has beat me too it yet I can tackle this one. From mmhohman at northwestern.edu Mon Nov 14 17:49:59 2005 From: mmhohman at northwestern.edu (Moses Hohman) Date: Mon Nov 14 18:05:53 2005 Subject: [BioRuby] bio/alignment compact! question In-Reply-To: <437799A8.70400@corevx.com> References: <437799A8.70400@corevx.com> Message-ID: <0AE82492-47CA-4865-9E65-08C2CF0105D4@northwestern.edu> Sure seems like it, on both counts. Moses On Nov 13, 2005, at 1:53 PM, Trevor Wennblom wrote: > in 'bio/alignment.rb': > > ### > def compact! > #(Array-like) > d = [] > self.each_pair do |k, s| > if !s or s.empty? > d << k > end > end > d.each do |k| > self.delete(d) > end > d.empty? ? nil : d > end > ### > > should 'self.delete(d)' be 'self.delete(k)' ? > _______________________________________________ > BioRuby mailing list > BioRuby@open-bio.org > http://portal.open-bio.org/mailman/listinfo/bioruby > From ktym at hgc.jp Mon Nov 14 20:14:25 2005 From: ktym at hgc.jp (Toshiaki Katayama) Date: Mon Nov 14 20:43:40 2005 Subject: [BioRuby] RestrictionEnzyme? In-Reply-To: <437916C9.3080607@corevx.com> References: <437916C9.3080607@corevx.com> Message-ID: <1D003E58-2728-4B32-BE8C-85C075280428@hgc.jp> Hi Trevor, On 2005/11/15, at 7:59, Trevor Wennblom wrote: > Has anyone started work on a RestrictionEnzyme module like what BioPerl has? > http://doc.bioperl.org/releases/bioperl-1.5.0-RC1/Bio/Tools/RestrictionEnzyme.html > > If no one has beat me too it yet I can tackle this one. I don't know anyone is working on this. Here's a sample I wrote for my ruby seminar to count just the length of each fragments (I didn't care about the circular genome). Toshiaki #!/usr/bin/env ruby require 'bio' class REnzyme Enzymes = [ ["EcoRI", /GAATTC/i, 1, 5 ], # G*AATTC ["HindIII", /AAGCTT/i, 1, 5 ], # A*AGCTT ["BamHI", /GGATCC/i, 1, 5 ], # G*GATCC ["NotI", /GCGGCCGC/i, 2, 6 ], # GC*GGCCGC ] def initialize(seq) @seq = seq Enzymes.each do |name, pattern, before, after| ary = @seq.split(pattern) print "#{name}\t" #p ary.map {|subseq| subseq.length} p adjust(ary, before, after) end end def adjust(ary, before, after) if ary.size > 1 sizes = Array.new sizes << ary.shift.length + before ary.each do |subseq| sizes << after + subseq.length + before end sizes[-1] -= before return sizes else return [ary.first.length] end end end Bio::FlatFile.auto(ARGF) do |ff| ff.each do |entry| puts ">>> #{entry.entry_id} (#{entry.nalen}bp)" REnzyme.new(entry.naseq) end end From ktym at hgc.jp Mon Nov 14 19:39:17 2005 From: ktym at hgc.jp (Toshiaki Katayama) Date: Mon Nov 14 20:43:43 2005 Subject: [BioRuby] bio/alignment compact! question In-Reply-To: <0AE82492-47CA-4865-9E65-08C2CF0105D4@northwestern.edu> References: <437799A8.70400@corevx.com> <0AE82492-47CA-4865-9E65-08C2CF0105D4@northwestern.edu> Message-ID: <7E21F660-594F-4705-BAC0-CD6BE8141173@hgc.jp> The bio/alignment seems that it has not been used widely. I heard that the maintainer is currently working on the code for improving its functionality. Thanks, Toshiaki On 2005/11/15, at 7:49, Moses Hohman wrote: > Sure seems like it, on both counts. > > Moses > > On Nov 13, 2005, at 1:53 PM, Trevor Wennblom wrote: > >> in 'bio/alignment.rb': >> >> ### >> def compact! >> #(Array-like) >> d = [] >> self.each_pair do |k, s| >> if !s or s.empty? >> d << k >> end >> end >> d.each do |k| >> self.delete(d) >> end >> d.empty? ? nil : d >> end >> ### >> >> should 'self.delete(d)' be 'self.delete(k)' ? >> _______________________________________________ >> BioRuby mailing list >> BioRuby@open-bio.org >> http://portal.open-bio.org/mailman/listinfo/bioruby >> > > _______________________________________________ > BioRuby mailing list > BioRuby@open-bio.org > http://portal.open-bio.org/mailman/listinfo/bioruby From pjotr at pckassa.com Tue Nov 15 01:50:11 2005 From: pjotr at pckassa.com (Pjotr Prins) Date: Tue Nov 15 02:15:50 2005 Subject: [BioRuby] RestrictionEnzyme? In-Reply-To: <437916C9.3080607@corevx.com> References: <437916C9.3080607@corevx.com> Message-ID: <20051115065011.GA9938@tm2.nmi-agro.nl> Hi Trevor, I wrote GenEST, not part of BioRuby, as yet, which takes a bunch of cutters from a configuration file and lists the cut fragments in a colourful way. See http://raa.ruby-lang.org/project/genest/ The one thing that is lacking is the interpretation of degenerated EST data - i.e. predicted cuts on fragments. But that is mostly an EST problem. Have a look at that code and feel free to use it for BioRuby. It has two things going for it: (1) there is some complexity with multiple enzymes being used and (2) this code has been production tested by a number of groups. Pj. On Mon, Nov 14, 2005 at 04:59:21PM -0600, Trevor Wennblom wrote: > Has anyone started work on a RestrictionEnzyme module like what BioPerl has? > http://doc.bioperl.org/releases/bioperl-1.5.0-RC1/Bio/Tools/RestrictionEnzyme.html > > If no one has beat me too it yet I can tackle this one. > > > _______________________________________________ > BioRuby mailing list > BioRuby@open-bio.org > http://portal.open-bio.org/mailman/listinfo/bioruby