From ngoto at gen-info.osaka-u.ac.jp Tue Apr 1 06:59:24 2008 From: ngoto at gen-info.osaka-u.ac.jp (Naohisa GOTO) Date: Tue, 1 Apr 2008 19:59:24 +0900 Subject: [BioRuby] Bio::PDB parsing problem (1B2M) In-Reply-To: <47F19A16.1000004@gmail.com> References: <47ED7EEB.2080607@gmail.com> <47F19A16.1000004@gmail.com> Message-ID: <20080401105925.188FA1CBC593@idnmail.gen-info.osaka-u.ac.jp> Hi Semin, Thank you for reporting bugs and patches. The patch chain.diff seems good. I changed only to capture ArgumentError and committed into CVS. In addition, Bio::PDB#seqres is also changed because the Bio::AminoAcid.three2one is also used in the method. The patch pdb.diff would work in most cases, but might break things in some rare cases. I inserted "cResidue = nil" and "cLigand = nil" in the place after the cChain have been changed, and committed into CVS. Please see changes in below CVS commit mail. http://lists.open-bio.org/pipermail/bioruby-cvs/2008-April/001606.html Cheers, Naohisa Goto ngoto at gen-info.osaka-u.ac.jp / ng at bioruby.org On Tue, 01 Apr 2008 03:12:38 +0100 Semin Lee wrote: > Hi AlexG, > > Please find attached two patch files. I don't think those patches are > ideal solution, but it seems working fine. As for the 'aaseq' method of > Chain class, I think it would be nice to have more abstracted method > like 'seq', so it works for any kinds of polymers in PDB. > > Cheers, > Semin > > > Alex Gutteridge wrote: > > Hi Semin, > > > > Definately a parser error - the combined HETATM/ATOM chains are > > confusing it, but they shouldn't. If you have the time and the > > inclination then patches are very welcome. If not, I can try and take > > a look next week. > > > > AlexG > > > > On 28 Mar 2008, at 23:27, Semin Lee wrote: > >> Hi guys, > >> > >> I've got some problems when parsing 1B2M PDB file using Bio::PDB. It > >> doesn't seem to parse chain C to E properly. I'm currently using > >> BioRuby gem ver. 1.2.1 and Ruby 1.8.6 on Mac OS X Leopard. > >> > >> >> require "bio" > >> => true > >> >> require "open-uri" > >> => true > >> >> pdb = > >> Bio::PDB.new(open("http://www.rcsb.org/pdb/files/1b2m.pdb").read) > >> => # > >> >> p pdb.models.first.chains > >> ArgumentError: ArgumentError > >> from > >> /opt/local/lib/ruby/gems/1.8/gems/bio-1.2.1/lib/bio/data/aa.rb:184:in > >> `three2one' > >> from > >> /opt/local/lib/ruby/gems/1.8/gems/bio-1.2.1/lib/bio/db/pdb/chain.rb:192:in > >> `aaseq' > >> from > >> /opt/local/lib/ruby/gems/1.8/gems/bio-1.2.1/lib/bio/db/pdb/chain.rb:186:in > >> `each' > >> from > >> /opt/local/lib/ruby/gems/1.8/gems/bio-1.2.1/lib/bio/db/pdb/chain.rb:186:in > >> `aaseq' > >> from > >> /opt/local/lib/ruby/gems/1.8/gems/bio-1.2.1/lib/bio/db/pdb/chain.rb:178:in > >> `inspect' > >> from (irb):4:in `p' > >> from (irb):4 > >> >> > >> > >> a strange error occurred, but I just overrided(?) 'aaseq' method to > >> see what happens, > >> > >> >> module Bio > >> >> class PDB > >> >> class Chain > >> >> def aaseq > >> >> "" > >> >> end > >> >> end > >> >> end > >> >> end > >> => nil > >> >> pp pdb.models.first.chains > >> [# >> heterogens.size=0 aaseq="">, > >> # >> heterogens.size=0 aaseq="">, > >> # >> heterogens.size=1 aaseq="">, > >> # >> heterogens.size=0 aaseq="">, > >> # >> heterogens.size=0 aaseq="">, > >> # >> heterogens.size=92 aaseq="">] > >> => nil > >> >> > >> > >> Now it doesn't complain, but Bio::PDB::Chain for chain D and E have > >> wrong number of residues and heterogens. In the 1B2M PDB file, each > >> chain D and E also has a RNA residue and a heterogen, U34, just like > >> chain C. However, Bio::PDB::Chain for chain D and E have no residues > >> and heterogens. Does anyone have any ideas? Or, am I missing something? > >> > >> Cheers, > >> Semin > >> > >> _______________________________________________ > >> BioRuby mailing list > >> BioRuby at lists.open-bio.org > >> http://lists.open-bio.org/mailman/listinfo/bioruby > >> > > > > From pathoquest at gmail.com Sun Apr 6 13:54:49 2008 From: pathoquest at gmail.com (bio scientist) Date: Sun, 6 Apr 2008 10:54:49 -0700 Subject: [BioRuby] getting started with BioRuby Message-ID: <8d4642290804061054t1b45d37ay54a556abedf75936@mail.gmail.com> Dear All, This is my first mail to the group. YARN (yet another ruby nuby). :-) Ever since Ruby has taken over the programming world, an increasing number of biologists have also adapted Ruby as a language of their choice. Among these is a generation of biologists whose first programming language is Ruby: the so-called 'people-who-don't-know -the-pain-of-programming-in-Java/Perl'. I belong to this category and am trying to learn Ruby, BioRuby and Rails for my work. I wish to learn more by interacting with the BioRuby Gurus and give back to the community what I have learnt. That prologue was to make the point that my questions are of the basic kind, while most posts here seem to be coming from and for coders. So, please bear with me and have the patience to clear my doubts. Thanks a ton to Katayama, Goto and Prins for the tutorials. --------------------------------------------------------------------------------------------------------------- I have installed Ruby 1.8.6 and followed the instructions to install 'bio' and 'bioruby' via gems. Now, I can see the '*bioruby>*' prompt and am able to do the simple examples like translation, complement, GC% etc. However, I am unable to work with a saved program as in the example copy -pasted below from http://dev.bioruby.org/wiki/en/?Tutorial.rd: In most cases, sequences are read from files or retrieved from databases. For example: require 'bio' input_seq = ARGF.read # reads all files in arguments my_naseq = Bio::Sequence::NA.new(input_seq) my_aaseq = my_naseq.translate puts my_aaseq Save the program as na2aa.rb. Prepare a nucleic acid sequence described below and saves it as my_naseq.txt: gtggcgatctttccgaaagcgatgactggagcgaagaaccaaagcagtgacatttgtctg atgccgcacgtaggcctgataagacgcggacagcgtcgcatcaggcatcttgtgcaaatg tcggatgcggcgtga na2aa.rb translates a nucleic acid sequence to a protein sequence. For example, translates my_naseq.txt: % ruby na2aa.rb my_naseq.txt --------------------------------------------------------------------------------------------------------- I saved the files as per the example, but when I try to open the file using bioruby>na2aa.rb, it gives me an error message saying '* undefined local variable or method'na2aa'* for main:Object. Can you please tell me what I should do? -------------------------------------------------------------------------------------------------------- Also, could you please throw some more light on saving .seq sequences from NCBI's ftp site? This is in reference to the Parsing example in the tutorial : Parsing GenBank data (Bio::GenBank class) We assume that you already have some GenBank data files. (If you don't, download some .seq files from ftp://ftp.ncbi.nih.gov/genbank/).As an example we fetch the ID, definition and sequence of each entry from the GenBank format and convert it to FASTA. This is also an example script in the BioRuby distribution. A first attempt could be to use the Bio::GenBank class for reading in the data: #!/usr/bin/env ruby require 'bio' # Read all lines from STDIN split by the GenBank delimiter while entry = gets(Bio::GenBank::DELIMITER) gb = Bio::GenBank.new(entry) # creates GenBank object print ">#{gb.accession} " # Accession puts gb.definition # Definition puts gb.naseq # Nucleic acid sequence # (Bio::Sequence::NA object) end ---------------------------------------------------------------------------------------------------------- Thanks in advance, KK From pjotr2008 at thebird.nl Sun Apr 6 17:21:19 2008 From: pjotr2008 at thebird.nl (Pjotr Prins) Date: Sun, 6 Apr 2008 23:21:19 +0200 Subject: [BioRuby] getting started with BioRuby In-Reply-To: <8d4642290804061054t1b45d37ay54a556abedf75936@mail.gmail.com> References: <8d4642290804061054t1b45d37ay54a556abedf75936@mail.gmail.com> Message-ID: <20080406212119.GA13586@thebird.nl> On Sun, Apr 06, 2008 at 10:54:49AM -0700, bio scientist wrote: > the basic kind, while most posts here seem to be coming from and for coders. > So, please bear with me and have the patience to clear my doubts. What doubts ;-). There should be no doubts - there is only one true gospel. > Thanks a ton to Katayama, Goto and Prins for the tutorials. Well, we do what we can... and perhaps, we could do a little more! > --------------------------------------------------------------------------------------------------------------- > I have installed Ruby 1.8.6 and followed the instructions to install 'bio' > and 'bioruby' via gems. Now, I can see the '*bioruby>*' prompt and am able > to do the simple examples like translation, complement, GC% etc. However, I > am unable to work with a saved program as in the example copy -pasted below > from http://dev.bioruby.org/wiki/en/?Tutorial.rd: > > > In most cases, sequences are read from files or retrieved from databases. > For example: > > require 'bio' > > input_seq = ARGF.read # reads all files in arguments > > my_naseq = Bio::Sequence::NA.new(input_seq) > my_aaseq = my_naseq.translate > > puts my_aaseq > > Save the program as na2aa.rb. Prepare a nucleic acid sequence described > below and saves it as my_naseq.txt: > > gtggcgatctttccgaaagcgatgactggagcgaagaaccaaagcagtgacatttgtctg > atgccgcacgtaggcctgataagacgcggacagcgtcgcatcaggcatcttgtgcaaatg > tcggatgcggcgtga > > na2aa.rb translates a nucleic acid sequence to a protein sequence. For > example, translates my_naseq.txt: > > % ruby na2aa.rb my_naseq.txt > > --------------------------------------------------------------------------------------------------------- > I saved the files as per the example, but when I try to open the file using > bioruby>na2aa.rb, it gives me an error message saying '* undefined local > variable or method'na2aa'* for main:Object. The bioruby shell is correct. You are trying something that is not ruby, or Ruby shell, but rather a shell command. That may sound weird, and I guess we should make the Tutorial more accurate. You can run Ruby from the command line - and feed it na2aa.rb as a command. So not from within the Ruby shell, but from the Unix (or cygwin) command prompt. > Can you please tell me what I should do? > -------------------------------------------------------------------------------------------------------- > > Also, could you please throw some more light on saving .seq sequences from > NCBI's ftp site? This is in reference to the Parsing example in the tutorial > : > Parsing GenBank data (Bio::GenBank class) > > We assume that you already have some GenBank data files. (If you don't, > download some .seq files from ftp://ftp.ncbi.nih.gov/genbank/).As an example > we fetch the ID, definition and sequence of each entry from the GenBank > format and convert it to FASTA. This is also an example script in the > BioRuby distribution. > > A first attempt could be to use the Bio::GenBank class for reading in the > data: > > #!/usr/bin/env ruby > > require 'bio' > > # Read all lines from STDIN split by the GenBank delimiter > while entry = gets(Bio::GenBank::DELIMITER) > gb = Bio::GenBank.new(entry) # creates GenBank object > > print ">#{gb.accession} " # Accession > puts gb.definition # Definition > puts gb.naseq # Nucleic acid sequence > # (Bio::Sequence::NA object) > end > ---------------------------------------------------------------------------------------------------------- > Thanks in advance, > KK again, this is a shell thing. When you have .seq files on your file system you can parse them with these commands. Download .seq files from NCBI - maybe someone has a link - and run the Ruby program from the command line. The command line is king - there is a tutorial here: http://www.linuxcommand.org/learning_the_shell.php you can run Ruby from the command line - that is the missing link. Pj (aka prins) > _______________________________________________ > BioRuby mailing list > BioRuby at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/bioruby From pathoquest at gmail.com Wed Apr 9 15:50:25 2008 From: pathoquest at gmail.com (bio scientist) Date: Wed, 9 Apr 2008 12:50:25 -0700 Subject: [BioRuby] getting started with BioRuby Message-ID: <8d4642290804091250g68780427w77c2c9d4bf15fda6@mail.gmail.com> Thanks a lot for the encouragement and responses! And for helping me to get started. So, I was making the mistake of running the examples from within the shell. Once I changed that to doing it from command line, it works fine. Also, thanks Jan. I was able to get to GenBank and get the .seq files, so I was able to do those examples as well. Wow, it feels so good to actually see things working and the ATGC's scrolling past! With the permission of the authors of the tutorial, I would like to incorporate and show those examples in my blog. As I learn each new thing, I would want to try and put them online for other programming newbies to understand. (Just an observation: I tried the examples on Windows. Where Ruby is installed independently, things work fine, but no so with Instant Rails. Maybe I am missing something, but wanted to share anyway) KK From pjotr2008 at thebird.nl Thu Apr 10 02:42:04 2008 From: pjotr2008 at thebird.nl (Pjotr Prins) Date: Thu, 10 Apr 2008 08:42:04 +0200 Subject: [BioRuby] getting started with BioRuby In-Reply-To: <8d4642290804091250g68780427w77c2c9d4bf15fda6@mail.gmail.com> References: <8d4642290804091250g68780427w77c2c9d4bf15fda6@mail.gmail.com> Message-ID: <20080410064204.GA22995@thebird.nl> Sure, you can post to your blog! In fact, if you think there are things that can be improved in the tutorial just mail them to me - I'll try and update. Pj. On Wed, Apr 09, 2008 at 12:50:25PM -0700, bio scientist wrote: > Thanks a lot for the encouragement and responses! And for helping me to get > started. So, I was making the mistake of running the examples from within > the shell. Once I changed that to doing it from command line, it works fine. > > Also, thanks Jan. I was able to get to GenBank and get the .seq files, so I > was able to do those examples as well. > > Wow, it feels so good to actually see things working and the ATGC's > scrolling past! > > With the permission of the authors of the tutorial, I would like to > incorporate and show those examples in my blog. As I learn each new thing, I > would want to try and put them online for other programming newbies to > understand. > > (Just an observation: I tried the examples on Windows. Where Ruby is > installed independently, things work fine, but no so with Instant Rails. > Maybe I am missing something, but wanted to share anyway) > > KK > _______________________________________________ > BioRuby mailing list > BioRuby at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/bioruby From shameer at ncbs.res.in Thu Apr 10 02:32:04 2008 From: shameer at ncbs.res.in (K. Shameer) Date: Thu, 10 Apr 2008 12:02:04 +0530 (IST) Subject: [BioRuby] How to renumber a PDB file using BioRuby ? Message-ID: <38921.192.168.1.1.1207809124.squirrel@mail.ncbs.res.in> Dear All, I have a pdb file ( in perfect pdb format, no hetatm, no solvent, single chain file). I need to renumber the whole pdb file, for example if my input file is 1CRN.pdb and it starts with residue number 1, I need to renumber them so that first resiude number will be 12, next 13, 14... like that. I want to know if I can specifically access the residue number and increment it from first residue using my new number (here it will be residue_number + 12)and regenerate the file. Anybody had tried this before, Thanks in advance for any help, K. Shameer From yjchen at reciprocallattice.com Thu Apr 10 04:14:57 2008 From: yjchen at reciprocallattice.com (Yen-Ju Chen) Date: Thu, 10 Apr 2008 16:14:57 +0800 Subject: [BioRuby] How to renumber a PDB file using BioRuby ? In-Reply-To: <38921.192.168.1.1.1207809124.squirrel@mail.ncbs.res.in> References: <38921.192.168.1.1.1207809124.squirrel@mail.ncbs.res.in> Message-ID: This is how I do it for atom number. You probably can find a way for residues. require 'bio' file = File.new('a.pdb').gets(nil) structure = Bio::PDB.new(file) structure.each do |model| model.each do |chain| chain.each do |residue| residue.each do |atom| atom.resSeq += 400 end end end end File.open('x.pdb', 'w') do |file| file << structure.to_s end Yen-Ju On Thu, Apr 10, 2008 at 2:32 PM, K. Shameer wrote: > Dear All, > > I have a pdb file ( in perfect pdb format, no hetatm, no solvent, single > chain file). I need to renumber the whole pdb file, for example if my > input file is 1CRN.pdb and it starts with residue number 1, I need to > renumber them so that first resiude number will be 12, next 13, 14... like > that. I want to know if I can specifically access the residue number and > increment it from first residue using my new number (here it will be > residue_number + 12)and regenerate the file. > > Anybody had tried this before, > > Thanks in advance for any help, > K. Shameer > > _______________________________________________ > BioRuby mailing list > BioRuby at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/bioruby > From alexg at ruggedtextile.com Thu Apr 10 04:29:07 2008 From: alexg at ruggedtextile.com (Alex Gutteridge) Date: Thu, 10 Apr 2008 09:29:07 +0100 Subject: [BioRuby] How to renumber a PDB file using BioRuby ? In-Reply-To: <38921.192.168.1.1.1207809124.squirrel@mail.ncbs.res.in> References: <38921.192.168.1.1.1207809124.squirrel@mail.ncbs.res.in> Message-ID: <5737E29D-6ABE-4474-BCD2-A75AE8AB3AEE@ruggedtextile.com> On 10 Apr 2008, at 07:32, K. Shameer wrote: > Dear All, > > I have a pdb file ( in perfect pdb format, no hetatm, no solvent, > single > chain file). I need to renumber the whole pdb file, for example if my > input file is 1CRN.pdb and it starts with residue number 1, I need to > renumber them so that first resiude number will be 12, next 13, > 14... like > that. I want to know if I can specifically access the residue number > and > increment it from first residue using my new number (here it will be > residue_number + 12)and regenerate the file. > > Anybody had tried this before, > > Thanks in advance for any help, > K. Shameer > > _______________________________________________ > BioRuby mailing list > BioRuby at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/bioruby > hi, You have to alter the number by atom rather than by residue. Altering the residue object directly used to work, but has been broken recently. Anyway, this seems to work for your purpose: require 'bio' pdb = Bio::PDB.new(File.read(ARGV[0])) pdb.each_atom do |atom| atom.resSeq += 12 end puts pdb It would be good (IMHO) to have: require 'bio' pdb = Bio::PDB.new(File.read(ARGV[0])) pdb.each_residue do |residue| residue.resSeq += 10 end puts pdb Do the same thing, but currently changes to residue objects don't propagate back down to the atoms they contain so the above code doesn't do anything useful. Alex Gutteridge Department of Biochemistry University of Cambridge From alexg at ruggedtextile.com Thu Apr 10 04:13:59 2008 From: alexg at ruggedtextile.com (Alex Gutteridge) Date: Thu, 10 Apr 2008 09:13:59 +0100 Subject: [BioRuby] How to renumber a PDB file using BioRuby ? In-Reply-To: <38921.192.168.1.1.1207809124.squirrel@mail.ncbs.res.in> References: <38921.192.168.1.1.1207809124.squirrel@mail.ncbs.res.in> Message-ID: <1D75B4AC-0AEB-4F11-BDCF-0235D075C810@ruggedtextile.com> On 10 Apr 2008, at 07:32, K. Shameer wrote: > Dear All, > > I have a pdb file ( in perfect pdb format, no hetatm, no solvent, > single > chain file). I need to renumber the whole pdb file, for example if my > input file is 1CRN.pdb and it starts with residue number 1, I need to > renumber them so that first resiude number will be 12, next 13, > 14... like > that. I want to know if I can specifically access the residue number > and > increment it from first residue using my new number (here it will be > residue_number + 12)and regenerate the file. > > Anybody had tried this before, > > Thanks in advance for any help, > K. Shameer hi, You have to alter the number by atom rather than by residue. Altering the residue object directly used to work, but has been broken. Anyway, this seems to work for your purpose: require 'bio' pdb = Bio::PDB.new(File.read(ARGV[0])) pdb.each_atom do |atom| atom.resSeq += 12 end puts pdb It would be good (IMHO) to have: require 'bio' pdb = Bio::PDB.new(File.read(ARGV[0])) pdb.each_residue do |residue| residue.resSeq += 10 end puts pdb Do the same thing, but currently changes to residue objects don't propagate back down to the atoms so the above code doesn't do anything useful. Alex Gutteridge Department of Biochemistry University of Cambridge From shameer at ncbs.res.in Thu Apr 10 04:17:49 2008 From: shameer at ncbs.res.in (K. Shameer) Date: Thu, 10 Apr 2008 13:47:49 +0530 (IST) Subject: [BioRuby] How to renumber a PDB file using BioRuby ? In-Reply-To: <1D75B4AC-0AEB-4F11-BDCF-0235D075C810@ruggedtextile.com> References: <38921.192.168.1.1.1207809124.squirrel@mail.ncbs.res.in> <1D75B4AC-0AEB-4F11-BDCF-0235D075C810@ruggedtextile.com> Message-ID: <42113.192.168.1.1.1207815469.squirrel@mail.ncbs.res.in> Dear Alex, Thanks for your help > You have to alter the number by atom rather than by residue. Altering > the residue object directly used to work, but has been broken. Anyway, > this seems to work for your purpose: > > require 'bio' > > pdb = Bio::PDB.new(File.read(ARGV[0])) > > pdb.each_atom do |atom| > atom.resSeq += 12 > end > puts pdb Sorry, this is exactly I want to do, I want to apply it in a whole atom level, not residue level - this works well for me ! Once again Thank you Alex and Chen for quick and great help, K. Shameer > > It would be good (IMHO) to have: > > require 'bio' > > pdb = Bio::PDB.new(File.read(ARGV[0])) > > pdb.each_residue do |residue| > residue.resSeq += 10 > end > > puts pdb > > Do the same thing, but currently changes to residue objects don't > propagate back down to the atoms so the above code doesn't do anything > useful. > > Alex Gutteridge > > Department of Biochemistry > University of Cambridge From shameer at ncbs.res.in Thu Apr 10 04:49:11 2008 From: shameer at ncbs.res.in (K. Shameer) Date: Thu, 10 Apr 2008 14:19:11 +0530 (IST) Subject: [BioRuby] How to renumber a PDB file using BioRuby ? In-Reply-To: <1D75B4AC-0AEB-4F11-BDCF-0235D075C810@ruggedtextile.com> References: <38921.192.168.1.1.1207809124.squirrel@mail.ncbs.res.in> <1D75B4AC-0AEB-4F11-BDCF-0235D075C810@ruggedtextile.com> Message-ID: <57721.192.168.1.1.1207817351.squirrel@mail.ncbs.res.in> Hi, I automated Alex's (thanks a lot, alex) script and finished my renumbering job :) > ruby renumber.rb xxxx.pdb step_size __START__ require 'bio' pdb = Bio::PDB.new(File.read(ARGV[0])) step_size = ARGV[1] pdb.each_atom do |atom| atom.resSeq += step_size.to_i end puts pdb __END__ K. Shameer From sgujja at broad.mit.edu Thu Apr 10 14:20:26 2008 From: sgujja at broad.mit.edu (Sharvari Gujja) Date: Thu, 10 Apr 2008 14:20:26 -0400 Subject: [BioRuby] CDART BioRuby Message-ID: <47FE5A6A.7020202@broad.mit.edu> Hi, I am trying to use NCBI CDART( Conserved Domain Architecture Retreival Tool ) to analyze multiple protein sequences in fasta format. CDART assigns domains based on RPS Blast so this is what I intend to do in bioruby: 1. Take the input protein sequences file in fasta format . 2. Do RPS Blast for each sequence using Bio::Blast class - I still have to look into it. 3. From the output get the pssm/cd id to efetch the cdd page from ncbi. -This is where I need help.Is there a class in Bioruby which I can use to retrieve the cdd page? You can try an example : cd00066 to see how the output looks like ( search under Conserved Domain Database) Appreciate any help. Thanks S From sgujja at broad.mit.edu Thu Apr 10 15:34:29 2008 From: sgujja at broad.mit.edu (Sharvari Gujja) Date: Thu, 10 Apr 2008 15:34:29 -0400 Subject: [BioRuby] RPS Blast using Bioruby... Message-ID: <47FE6BC5.3010207@broad.mit.edu> Hi all, This is in reference to my earlier email on how to fetch CDD output from NCBI. Like I said I am also trying to do RPS Blast on CDD database using Bio::Blast. This is what I am trying to do: #!/usr/bin/env ruby require 'bio' program = 'blastp' db = 'nr-aa' fasta = File.open("input1" , "r+") blast = Bio::Blast.remote(program,db,'-e 1e-10') report = blast.query(fasta.read) report.each do |hit| puts hit.target_id end How can I do rps blast on cdd? Thanks S From email2ants at gmail.com Fri Apr 11 07:25:08 2008 From: email2ants at gmail.com (Anthony Underwood) Date: Fri, 11 Apr 2008 12:25:08 +0100 Subject: [BioRuby] Sequence format conversion Message-ID: <3576D7DD-F878-45F4-84D8-BF344D0E113C@gmail.com> Hi Noahisa, Hi all I have recently run into the lack of functionality in reading in a sequence in one format and converting to another. The ouput(:format) method does not seem to be available to a Bio::Sequence::NA object made from reading in a Genbank flat-file and calling the seq method. Is there any way I can contribute to this since IMHO it is one of the basics of bioinformatics. Jan informed me that a CVS branch was made at the biohakathon and suggested that I drop a line to you Noahisa and to the list. Perhaps I can help with new branch? All the best Anthony From sgujja at broad.mit.edu Fri Apr 11 15:20:17 2008 From: sgujja at broad.mit.edu (Sharvari Gujja) Date: Fri, 11 Apr 2008 15:20:17 -0400 Subject: [BioRuby] RPS Blast using Bioruby... In-Reply-To: <47FE6BC5.3010207@broad.mit.edu> References: <47FE6BC5.3010207@broad.mit.edu> Message-ID: <47FFB9F1.4090901@broad.mit.edu> Sharvari Gujja wrote: > Hi all, > > This is in reference to my earlier email on how to fetch CDD output > from NCBI. > > Like I said I am also trying to do RPS Blast on CDD database using > Bio::Blast. > > This is what I am trying to do: > > #!/usr/bin/env ruby > require 'bio' > program = 'blastp' > db = 'nr-aa' > fasta = File.open("input1" , "r+") > blast = Bio::Blast.remote(program,db,'-e 1e-10') > report = blast.query(fasta.read) > report.each do |hit| > puts hit.target_id > end > > How can I do rps blast on cdd? > > Thanks > S > > _______________________________________________ > BioRuby mailing list > BioRuby at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/bioruby Hi, I have tried a bunch of things to run RPS Blast using Bioruby.Alas, no success yet! I know that this can be done in Bioperl ( from a friend of mine) and this is the first time I could not do something in BioRuby.Can someone please tell me if this can be done in Bioruby. Please help. Thanks Sharvari From jdudley at stanford.edu Fri Apr 11 18:18:41 2008 From: jdudley at stanford.edu (Joel Dudley) Date: Fri, 11 Apr 2008 15:18:41 -0700 Subject: [BioRuby] Looking for projects to highlight Message-ID: <22C84AC4-A1D2-4E7A-98A0-2E88F6B843FB@stanford.edu> Hello BioRuby list. I'm going to be speaking at the upcoming Third Annual Silicon Valley Ruby Conference in San Jose, CA on April 19th and I am looking for some biology and medicine related projects to highlight. http://www.sdforum.org/Ruby The title of my talk is: "Gems and Genomics: Ruby at the Edge of Biology and Medicine in the Genomic Era" and I'm looking to highlight some projects other than my own that are using Ruby to do some interesting and/or big-scale biological research. If you are doing anything interesting with Ruby in this area please drop me a note so I can highlight it in my talk. The conference will be well-attended so it could be a great opportunity to get your project's name out. I'm going to be speaking along side a bunch of IT people so I really want to use this opportunity to raise awareness about Ruby in Science. Cheers, Joel Dudley From ngoto at gen-info.osaka-u.ac.jp Mon Apr 14 08:51:42 2008 From: ngoto at gen-info.osaka-u.ac.jp (Naohisa GOTO) Date: Mon, 14 Apr 2008 21:51:42 +0900 Subject: [BioRuby] RPS Blast using Bioruby... In-Reply-To: <47FE6BC5.3010207@broad.mit.edu> References: <47FE6BC5.3010207@broad.mit.edu> Message-ID: <20080414125143.601A11CBC4A1@idnmail.gen-info.osaka-u.ac.jp> Hi, Currently, RPS-Blast is not suppoted in BioRuby. In addition, currently, Bio::Blast in BioRuby does not support remote BLAST on NCBI. It supports GenomeNet or stand-alone BLAST. Thanks, Naohisa Goto ngoto at gen-info.osaka-u.ac.jp / ng at bioruby.org On Thu, 10 Apr 2008 15:34:29 -0400 Sharvari Gujja wrote: > Hi all, > > This is in reference to my earlier email on how to fetch CDD output from > NCBI. > > Like I said I am also trying to do RPS Blast on CDD database using > Bio::Blast. > > This is what I am trying to do: > > #!/usr/bin/env ruby > require 'bio' > program = 'blastp' > db = 'nr-aa' > fasta = File.open("input1" , "r+") > blast = Bio::Blast.remote(program,db,'-e 1e-10') > report = blast.query(fasta.read) > report.each do |hit| > puts hit.target_id > end > > How can I do rps blast on cdd? > > Thanks > S > From ngoto at gen-info.osaka-u.ac.jp Tue Apr 15 09:59:06 2008 From: ngoto at gen-info.osaka-u.ac.jp (Naohisa GOTO) Date: Tue, 15 Apr 2008 22:59:06 +0900 Subject: [BioRuby] RPS Blast using Bioruby... In-Reply-To: <20080414125143.601A11CBC4A1@idnmail.gen-info.osaka-u.ac.jp> References: <47FE6BC5.3010207@broad.mit.edu> <20080414125143.601A11CBC4A1@idnmail.gen-info.osaka-u.ac.jp> Message-ID: <20080415135908.107871CBC575@idnmail.gen-info.osaka-u.ac.jp> Hi, RPS Blast output parser is now added into CVS HEAD. 0. Database preparation You can download formatted databases from NCBI. Be careful that formatted databases are architecture-dependent. For little-endian machines, you can download from ftp://ftp.ncbi.nih.gov/pub/mmdb/cdd/little_endian For big-endian machines, ftp://ftp.ncbi.nih.gov/pub/mmdb/cdd/big_endian If you want to create database from scratch, please see the document "Using RPS-BLAST with Biopython" http://www2.warwick.ac.uk/fac/sci/moac/currentstudents/peter_cock/python/rpsblast/ This is useful not only for Biopython users but also for RPS-BLAST newbies. 1. Runs rpsblast command % rpsblast -i test.fst -d Pfam -o test.rpsblast 2. Parses the result The usage of Bio::Blast::RPSBlast::Report is almost the same as Bio::Blast::Default::Report, except for multi-query output supports and some methods (see RDoc in the class). Below is a sample script. require 'bio' filename = 'test.rpsblast' Bio::FlatFile.open(Bio::Blast::RPSBlast::Report, filename) do |ff| ff.each do |e| i = 0 e.each_iteration do |result| i += 1 print "Query\##{i} = ", result.query_def, "\n" j = 0 result.each do |hit| j += 1 print "Query\##{i}/Hit\##{j} = ", hit.target_def, "\n" k = 0 hit.each do |hsp| k += 1 print "Query\##{i}/Hit\##{j}/Hsp\##{k} = ", "evalue=#{hsp.evalue}, ", "Positions #{hsp.query_from}..#{hsp.query_to}:", "#{hsp.hit_from}..#{hsp.hit_to}\n" print "Query : #{hsp.qseq}\n" print " #{hsp.midline}\n" print "Hit : #{hsp.hseq}\n" end end end end end 3. References Using RPS-BLAST with Biopython http://www2.warwick.ac.uk/fac/sci/moac/currentstudents/peter_cock/python/rpsblast/ Regards, Naohisa Goto ngoto at gen-info.osaka-u.ac.jp / ng at bioruby.org On Mon, 14 Apr 2008 21:51:42 +0900 Naohisa GOTO wrote: > Hi, > > Currently, RPS-Blast is not suppoted in BioRuby. > > In addition, currently, Bio::Blast in BioRuby does not support > remote BLAST on NCBI. It supports GenomeNet or stand-alone BLAST. > > Thanks, > > Naohisa Goto > ngoto at gen-info.osaka-u.ac.jp / ng at bioruby.org > > On Thu, 10 Apr 2008 15:34:29 -0400 > Sharvari Gujja wrote: > > > Hi all, > > > > This is in reference to my earlier email on how to fetch CDD output from > > NCBI. > > > > Like I said I am also trying to do RPS Blast on CDD database using > > Bio::Blast. > > > > This is what I am trying to do: > > > > #!/usr/bin/env ruby > > require 'bio' > > program = 'blastp' > > db = 'nr-aa' > > fasta = File.open("input1" , "r+") > > blast = Bio::Blast.remote(program,db,'-e 1e-10') > > report = blast.query(fasta.read) > > report.each do |hit| > > puts hit.target_id > > end > > > > How can I do rps blast on cdd? > > > > Thanks > > S > > > _______________________________________________ > BioRuby mailing list > BioRuby at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/bioruby From mail at michaelbarton.me.uk Thu Apr 17 11:21:18 2008 From: mail at michaelbarton.me.uk (Michael Barton) Date: Thu, 17 Apr 2008 16:21:18 +0100 Subject: [BioRuby] BioRuby on github + lighthouse Message-ID: <0A349FF7-51BD-4546-8744-B342C4EA8950@michaelbarton.me.uk> Hi, I wondered if the BioRuby developers had considered moving from SVN hosting to git hosting, specifically on github. I think using git and github could lower the barrier to people contributing code. Github offers free hosting for open source projects. Similarly Lighthouse offers free issue tracking to open source projects and integrates well with github. https://github.com http://www.lighthouseapp.com I've written a bit more about why this could be useful on my blog http://tinyurl.com/4yxm7u Thanks Mike From adamnkraut at gmail.com Thu Apr 17 12:50:24 2008 From: adamnkraut at gmail.com (Adam Kraut) Date: Thu, 17 Apr 2008 12:50:24 -0400 Subject: [BioRuby] BioRuby on github + lighthouse In-Reply-To: <0A349FF7-51BD-4546-8744-B342C4EA8950@michaelbarton.me.uk> References: <0A349FF7-51BD-4546-8744-B342C4EA8950@michaelbarton.me.uk> Message-ID: <134ede0b0804170950w7624e8b9u97ae8c285717d891@mail.gmail.com> git+=1 I have switched over several of our internal comp bio/chem projects to Git and so far it is working out wonderfully. I don't think I understand everything Git is capable of yet but I am already seeing some huge benefits in how I approach development. Having broken my teeth for so long on CVS I would welcome the change for something like BioRuby. BioPerl is *just* now moving to subversion, I vote for BioRuby to leapfrog them and test the waters with Git. I've never contributed back to BioRuby and I feel that Git could indeed lower that barrier for myself and others. Github itself is a Ruby (Rails?/Merb?) application and it seems like the greater Ruby community is switching rapidly. Is there anything stopping someone from putting BioRuby up on Github right now just to play around with? Regards, Adam On Thu, Apr 17, 2008 at 11:21 AM, Michael Barton wrote: > Hi, > > I wondered if the BioRuby developers had considered moving from SVN > hosting to git hosting, specifically on github. I think using git and github > could lower the barrier to people contributing code. Github offers free > hosting for open source projects. Similarly Lighthouse offers free issue > tracking to open source projects and integrates well with github. > > https://github.com > http://www.lighthouseapp.com > > I've written a bit more about why this could be useful on my blog > http://tinyurl.com/4yxm7u > > Thanks > > Mike > > _______________________________________________ > BioRuby mailing list > BioRuby at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/bioruby > From mail at michaelbarton.me.uk Thu Apr 17 13:41:57 2008 From: mail at michaelbarton.me.uk (Michael Barton) Date: Thu, 17 Apr 2008 18:41:57 +0100 Subject: [BioRuby] BioRuby on github + lighthouse In-Reply-To: <134ede0b0804170950w7624e8b9u97ae8c285717d891@mail.gmail.com> References: <0A349FF7-51BD-4546-8744-B342C4EA8950@michaelbarton.me.uk> <134ede0b0804170950w7624e8b9u97ae8c285717d891@mail.gmail.com> Message-ID: <9454D2A5-EB57-44AA-BE27-16371150535A@michaelbarton.me.uk> I definitely agree with your statement about leap frogging SVN straight to git, and it is also true that many ruby applications are switching to github too. However forking BioRuby on github whilst still actively maintaining the CVS/SVN version could generate confusion based on two differing versions. My suggestion would be to freeze CVS development of BioRuby at the next release, then move development over to github. On 17 Apr 2008, at 17:50, Adam Kraut wrote: > git+=1 > > I have switched over several of our internal comp bio/chem projects > to Git and so far it is working out wonderfully. I don't think I > understand everything Git is capable of yet but I am already seeing > some huge benefits in how I approach development. Having broken my > teeth for so long on CVS I would welcome the change for something > like BioRuby. BioPerl is *just* now moving to subversion, I vote > for BioRuby to leapfrog them and test the waters with Git. I've > never contributed back to BioRuby and I feel that Git could indeed > lower that barrier for myself and others. Github itself is a Ruby > (Rails?/Merb?) application and it seems like the greater Ruby > community is switching rapidly. Is there anything stopping someone > from putting BioRuby up on Github right now just to play around with? > > Regards, > > Adam > > On Thu, Apr 17, 2008 at 11:21 AM, Michael Barton > wrote: > Hi, > > I wondered if the BioRuby developers had considered moving from SVN > hosting to git hosting, specifically on github. I think using git > and github could lower the barrier to people contributing code. > Github offers free hosting for open source projects. Similarly > Lighthouse offers free issue tracking to open source projects and > integrates well with github. > > https://github.com > http://www.lighthouseapp.com > > I've written a bit more about why this could be useful on my blog > http://tinyurl.com/4yxm7u > > Thanks > > Mike > > _______________________________________________ > BioRuby mailing list > BioRuby at lists.open-bio.org > http://lists.open-bio.org/mailman/listinfo/bioruby > From timmcilveen at talktalk.net Thu Apr 17 17:41:26 2008 From: timmcilveen at talktalk.net (Tim) Date: Thu, 17 Apr 2008 22:41:26 +0100 Subject: [BioRuby] bioruby tutorials Message-ID: <4807C406.9070003@talktalk.net> Hi, I'm new to Ruby and Bioruby. Can you tell me if the tutorials at http://bioruby.open-bio.org/ are the only ones available, or are there other tutorials elsewhere online? I have found lots of biopython resources online, such as the excellent Pasteur Biopython course, but can't find a lot on ruby at the moment. I would prefer to learn bioruby, but I guess this will be depend on what I can find online. Any help would be great ! Thanks for any help, Tim p.s. sorry if this is the second time you are receiving this email. The first one didn't arrive in my inbox, so I assume there was an error sending it. From georgkam at gmail.com Thu Apr 17 18:41:10 2008 From: georgkam at gmail.com (George Githinji) Date: Fri, 18 Apr 2008 01:41:10 +0300 Subject: [BioRuby] BioRuby Digest, Vol 32, Issue 3 In-Reply-To: References: Message-ID: <55915f820804171541x3da21665w671c745b33dfd99f@mail.gmail.com> Hi Tim, check tutorials and bioruby related materials on these blogs: http://www.biorelated.wordpress.com http://www.bioinformaticszen.com/ http://saaientist.blogspot.com/ http://bioinforuby.blogspot.com/ http://rubyonwindows.blogspot.com/ http://bioruby.g.hatena.ne.jp/nakao_mitsuteru/ From marc.hoeppner at molbio.su.se Thu Apr 24 08:08:00 2008 From: marc.hoeppner at molbio.su.se (Marc Hoeppner) Date: Thu, 24 Apr 2008 14:08:00 +0200 Subject: [BioRuby] BLAST hit, which strand Message-ID: <48107820.6030906@molbio.su.se> Hi, I have a question concerning BLAST::RESULT objects in BioRuby. I followed the tutorial and available documentation to integrate blast into my application, but I noticed that pretty much everything is returned from BLAST except the strand a particular hit or hsp was identified on. It is available for objects of the class Bio::Blast::Default::Report::HSP (according to the API documentation anyway) - but what I get back when I run BLAST according to the tutorial is an object of the class Bio::Blast::Report::HSP - which does not return the 'hit_strand'. Is it me, am I missing something or is this a problem with BioRuby? Cheers, Marc -- Marc P. Hoeppner PhD student Department of Molecular Biology and Functional Genomics Stockholm University, 10691 Stockholm, Sweden marc.hoeppner at molbio.su.se Tel: +46 (0)8 - 164195 From georgkam at gmail.com Thu Apr 24 17:31:00 2008 From: georgkam at gmail.com (George Githinji) Date: Fri, 25 Apr 2008 00:31:00 +0300 Subject: [BioRuby] predicting epitopes Message-ID: <55915f820804241431g6f5f725ao19f64d79df8911e5@mail.gmail.com> Hi, Please is there some one who has a script for predicting possible epitopes in a protein sequence using ruby? or a wrapper library to some epitope prediction server? Thank you -- --------------- Sincerely George Skype: george_g2 Website: http://biorelated.wordpress.com/ From ngoto at gen-info.osaka-u.ac.jp Fri Apr 25 02:23:23 2008 From: ngoto at gen-info.osaka-u.ac.jp (Naohisa GOTO) Date: Fri, 25 Apr 2008 15:23:23 +0900 Subject: [BioRuby] BLAST hit, which strand In-Reply-To: <48107820.6030906@molbio.su.se> References: <48107820.6030906@molbio.su.se> Message-ID: <20080425062324.CAE921CBC4ED@idnmail.gen-info.osaka-u.ac.jp> Hi, Perhaps your BLAST result is XML (with -m 7 option). You can use query_frame and hit_frame methods. In most case, the start and end positions of query and hit can also be used to distinguish strands. Unlike default format, NCBI BLAST XML does not clearly show query-/hit- strand information. That's why we have no query_strand and hit_strand methods in BLAST XML output parser. In addition, it is confusable that the alignment shown in NCBI BLAST XML is often opposite from that of default output. For example, below are the results with same query and database. (blastall 2.2.15 in debian etch). The query sequence: >query cgatcgatcgatagctaggcgactagcatatctaacatcgtacacatactggcat The hit sequence in database: >test nnnnnnnnnnnnnnnnnnnn atgccagtatgtgtacgatgttagatatgctagtcgcctagctatcgatcgatcg default output: --------------------------------------------------------------------- Score = 109 bits (55), Expect = 4e-30 Identities = 55/55 (100%) Strand = Plus / Minus Query: 1 cgatcgatcgatagctaggcgactagcatatctaacatcgtacacatactggcat 55 ||||||||||||||||||||||||||||||||||||||||||||||||||||||| Sbjct: 75 cgatcgatcgatagctaggcgactagcatatctaacatcgtacacatactggcat 21 --------------------------------------------------------------------- XML output: --------------------------------------------------------------------- 1 109.522 55 3.75451e-30 55 1 21 75 1 -1 55 55 55 ATGCCAGTATGTGTACGATGTTAGATATGCTAGTCGCCTAGCTATCGATCGATCG ATGCCAGTATGTGTACGATGTTAGATATGCTAGTCGCCTAGCTATCGATCGATCG ||||||||||||||||||||||||||||||||||||||||||||||||||||||| --------------------------------------------------------------------- Both and are reverse-complement of those of default output, and the is reverse-compement of the query sequence. The XML shows = 1 and = -1, and I think these are opposite from our feeling. It might be a problem of NCBI BLAST. Regards, Naohisa Goto ngoto at gen-info.osaka-u.ac.jp / ng at bioruby.org On Thu, 24 Apr 2008 14:08:00 +0200 Marc Hoeppner wrote: > Hi, > > I have a question concerning BLAST::RESULT objects in BioRuby. > I followed the tutorial and available documentation to integrate blast > into my application, but I noticed that pretty much everything is > returned from BLAST except the strand a particular hit or hsp was > identified on. > It is available for objects of the class > Bio::Blast::Default::Report::HSP (according to the API documentation > anyway) - but what I get back when I run BLAST according to the tutorial > is an object of the class Bio::Blast::Report::HSP - which does not > return the 'hit_strand'. > > Is it me, am I missing something or is this a problem with BioRuby? > > Cheers, > Marc > > -- > > Marc P. Hoeppner > PhD student > Department of Molecular Biology and Functional Genomics > Stockholm University, 10691 Stockholm, Sweden > > marc.hoeppner at molbio.su.se > Tel: +46 (0)8 - 164195 > From pathoquest at gmail.com Sat Apr 26 21:48:02 2008 From: pathoquest at gmail.com (bio scientist) Date: Sat, 26 Apr 2008 18:48:02 -0700 Subject: [BioRuby] parsing Prosite data Message-ID: <8d4642290804261848y798736fawde54f0f4d5c0188e@mail.gmail.com> How can we parse Prosite data using Bioruby? I am looking for a way to populate a database table with Prosite patterns and their IDs that correspond to a set of genes. For example:* **GeneID GeneName PrositeID PrositePattern Consensus** * 1234 xyzA PSxxxxx KDEL [KRHQSA]-[DENQ]-E-L I have not yet fully grasped how parsing works. So any help and links to resources will go a long way. Thanks. From mail at michaelbarton.me.uk Wed Apr 30 08:49:08 2008 From: mail at michaelbarton.me.uk (Michael Barton) Date: Wed, 30 Apr 2008 13:49:08 +0100 Subject: [BioRuby] BioRuby on github + lighthouse In-Reply-To: <9454D2A5-EB57-44AA-BE27-16371150535A@michaelbarton.me.uk> References: <0A349FF7-51BD-4546-8744-B342C4EA8950@michaelbarton.me.uk> <134ede0b0804170950w7624e8b9u97ae8c285717d891@mail.gmail.com> <9454D2A5-EB57-44AA-BE27-16371150535A@michaelbarton.me.uk> Message-ID: <6773F437-607A-48A0-A60C-46B6994E70C6@michaelbarton.me.uk> Can I just bump this discussion. I wonder if anyone has had any further thoughts about the practicality and usefulness of porting BioRuby over to git and github? Mike On 17 Apr 2008, at 18:41, Michael Barton wrote: > I definitely agree with your statement about leap frogging SVN > straight to git, and it is also true that many ruby applications are > switching to github too. > > However forking BioRuby on github whilst still actively maintaining > the CVS/SVN version could generate confusion based on two differing > versions. My suggestion would be to freeze CVS development of > BioRuby at the next release, then move development over to github. > > > On 17 Apr 2008, at 17:50, Adam Kraut wrote: >> git+=1 >> >> I have switched over several of our internal comp bio/chem projects >> to Git and so far it is working out wonderfully. I don't think I >> understand everything Git is capable of yet but I am already seeing >> some huge benefits in how I approach development. Having broken my >> teeth for so long on CVS I would welcome the change for something >> like BioRuby. BioPerl is *just* now moving to subversion, I vote >> for BioRuby to leapfrog them and test the waters with Git. I've >> never contributed back to BioRuby and I feel that Git could indeed >> lower that barrier for myself and others. Github itself is a Ruby >> (Rails?/Merb?) application and it seems like the greater Ruby >> community is switching rapidly. Is there anything stopping someone >> from putting BioRuby up on Github right now just to play around with? >> >> Regards, >> >> Adam >> >> On Thu, Apr 17, 2008 at 11:21 AM, Michael Barton > > wrote: >> Hi, >> >> I wondered if the BioRuby developers had considered moving from SVN >> hosting to git hosting, specifically on github. I think using git >> and github could lower the barrier to people contributing code. >> Github offers free hosting for open source projects. Similarly >> Lighthouse offers free issue tracking to open source projects and >> integrates well with github. >> >> https://github.com >> http://www.lighthouseapp.com >> >> I've written a bit more about why this could be useful on my blog >> http://tinyurl.com/4yxm7u >> >> Thanks >> >> Mike >> >> _______________________________________________ >> BioRuby mailing list >> BioRuby at lists.open-bio.org >> http://lists.open-bio.org/mailman/listinfo/bioruby >> >