From alexg at ebi.ac.uk Thu Feb 12 10:53:40 2004 From: alexg at ebi.ac.uk (Alex Gutteridge) Date: Thu Feb 12 10:59:35 2004 Subject: [BioRuby] BioRuby PDB Classes Message-ID: Hi, I'm a structural bioinformatics graduate student at the EBI. I have very little Ruby experience (< a month), but do have some experience with Perl, BioPerl and PDB parsing. I checked BioRuby to see if it had a PDB parsing module and found that it did, but with some caveats: The current module is excellent at parsing the annotation records, but doesn't provide any easy way to get at the co-ordinate data (which is the real meat of the PDB). So, with this in mind, I have written a new PDB parsing module which builds on the (excellent) parsing framework that's already there. Essentially it adds a series of classes to represent the different levels of structure within a PDB file - models, chains, residues and atoms. I've also added some utility methods for calculating distances, centre of gravity, searching etc... I've also added (a lot!) of comments to the current code which might be useful to people. My question(s) to the list are: 1. Am I treading on other peoples toes here? Is someone else actively developing the pdb.rb module? Naohisa Goto? 2. If not, should I post the code to the mailing list, or somewhere else? I'm sure it needs some tidying up and bioruby-fication. It would be great if someone more experienced than I could give some comments/criticisms. Thanks for your time. Alex Gutteridge European Bioinformatics Institute Cambridge CB10 1SD UK Tel: 01223 492550 Email: alexg@ebi.ac.uk From ktym at hgc.jp Thu Feb 12 21:08:13 2004 From: ktym at hgc.jp (Toshiaki Katayama) Date: Thu Feb 12 21:14:23 2004 Subject: [BioRuby] BioRuby PDB Classes In-Reply-To: References: Message-ID: <7ABDFF59-5DC9-11D8-88B9-000A9599C910@hgc.jp> Hi Alex, Sounds great! You can post your codes here so that everyone can try your module and committers can discuss how to migrate your efforts. (Note that this list is configured to restrict binary attachments.) I think current PDB code is maintained by N. Goto and he will join the discussion. P.S. It's also nice to hear that Ruby is used in EBI. :) Thanks, -- Toshiaki Katayama ktym@hgc.jp, k@bioruby.org tel://+81-3-5449-5614 Human Genome Center, Institute of Medical Science fax://+81-3-5449-5434 University of Tokyo http://bioruby.org/~k/ 4-6-1 Shirokanedai, Minato-ku, Tokyo 108-8639, Japan On 2004/02/13, at 0:53, Alex Gutteridge wrote: > Hi, > > I'm a structural bioinformatics graduate student at the EBI. I have > very little Ruby experience (< a month), but do have some experience > with Perl, BioPerl and PDB parsing. I checked BioRuby to see if it had > a PDB parsing module and found that it did, but with some caveats: The > current module is excellent at parsing the annotation records, but > doesn't provide any easy way to get at the co-ordinate data (which is > the real meat of the PDB). > > So, with this in mind, I have written a new PDB parsing module which > builds on the (excellent) parsing framework that's already there. > Essentially it adds a series of classes to represent the different > levels of structure within a PDB file - models, chains, residues and > atoms. I've also added some utility methods for calculating distances, > centre of gravity, searching etc... > I've also added (a lot!) of comments to the current code which might > be useful to people. > > My question(s) to the list are: > > 1. Am I treading on other peoples toes here? Is someone else actively > developing the pdb.rb module? Naohisa Goto? > 2. If not, should I post the code to the mailing list, or somewhere > else? I'm sure it needs some tidying up and bioruby-fication. It would > be great if someone more experienced than I could give some > comments/criticisms. > > Thanks for your time. > > Alex Gutteridge > European Bioinformatics Institute > Cambridge CB10 1SD > UK > > Tel: 01223 492550 > Email: alexg@ebi.ac.uk > > _______________________________________________ > BioRuby mailing list > BioRuby@open-bio.org > http://portal.open-bio.org/mailman/listinfo/bioruby From ngoto at gen-info.osaka-u.ac.jp Fri Feb 13 00:29:11 2004 From: ngoto at gen-info.osaka-u.ac.jp (GOTO Naohisa) Date: Fri Feb 13 00:35:08 2004 Subject: [BioRuby] BioRuby PDB Classes In-Reply-To: References: Message-ID: Hi, On Thu, 12 Feb 2004 15:53:40 +0000 Alex Gutteridge wrote: > I'm a structural bioinformatics graduate student at the EBI. I have > very little Ruby experience (< a month), but do have some experience > with Perl, BioPerl and PDB parsing. I checked BioRuby to see if it had > a PDB parsing module and found that it did, but with some caveats: The > current module is excellent at parsing the annotation records, but > doesn't provide any easy way to get at the co-ordinate data (which is > the real meat of the PDB). As you said, currently, Bio::PDB in BioRuby is literally a parser, processing texts. Co-ordinate data is provided only as a sets of numbers. Some higher-level classes for molecular structures are needed, but not written yet. > So, with this in mind, I have written a new PDB parsing module which > builds on the (excellent) parsing framework that's already there. > Essentially it adds a series of classes to represent the different > levels of structure within a PDB file - models, chains, residues and > atoms. I've also added some utility methods for calculating distances, > centre of gravity, searching etc... > I've also added (a lot!) of comments to the current code which might be > useful to people. Great! In addition, some template or abstract classes might be needed, because there are mmCIF and other data formats for molecular structure. > My question(s) to the list are: > > 1. Am I treading on other peoples toes here? Is someone else actively > developing the pdb.rb module? Naohisa Goto? I'm Naohisa Goto, but I'm not actively developing the pdb.rb now, and no one (except you) are doing, as far as I know. So, you can freely modify the pdb.rb. If you want to change existing class/method's name, or massively change existing class/method's specification or definition, please tell us. > 2. If not, should I post the code to the mailing list, or somewhere > else? I'm sure it needs some tidying up and bioruby-fication. It would > be great if someone more experienced than I could give some > comments/criticisms. If the code is short, please post to the mailing list. For long codes, please send to staff@bioruby.org, or you can use the BioRuby Project Wiki page (http://wiki.bioruby.org/English/). Regards, -- Naohisa GOTO ngoto@gen-info.osaka-u.ac.jp Genome Information Research Center, Osaka University, Japan From alexg at ebi.ac.uk Fri Feb 13 04:51:37 2004 From: alexg at ebi.ac.uk (Alex Gutteridge) Date: Fri Feb 13 04:57:28 2004 Subject: [BioRuby] Re: BioRuby PDB Classes Message-ID: <371B90E2-5E0A-11D8-B0EA-000A957E44DC@ebi.ac.uk> >> My question(s) to the list are: >> >> 1. Am I treading on other peoples toes here? Is someone else actively >> developing the pdb.rb module? Naohisa Goto? > > I'm Naohisa Goto, but I'm not actively developing the pdb.rb now, > and no one (except you) are doing, as far as I know. > So, you can freely modify the pdb.rb. > > If you want to change existing class/method's name, or massively change > existing class/method's specification or definition, please tell us. I've left the main PDB class alone except for: - I've changed the seqres method to return Bio::Seq objects rather than just strings - I've removed the old model parsing section and replaced it with mine >> 2. If not, should I post the code to the mailing list, or somewhere >> else? I'm sure it needs some tidying up and bioruby-fication. It would >> be great if someone more experienced than I could give some >> comments/criticisms. > > If the code is short, please post to the mailing list. > For long codes, please send to staff@bioruby.org, or you can use > the BioRuby Project Wiki page (http://wiki.bioruby.org/English/). pdb.rb is now ~2000 lines, so I won't post it to the list! I'll post it to staff@bioruby.org (the wiki seems to be broken at the moment). pdb.rb probably needs splitting up into separate files, but like I said, I'm not sure what the BioRuby conventions are for doing this (would it need a new bio/db/pdb directory?). Currently it looks like this: module bio #This module provides some generic mixin methods that all classes use module PDBUtils [snip!] end #There are several *Finder mixins which provide some of the searching methods module AtomFinder [snip!] end #This is the main PDB class that was here originally - I've only added methods #so all the old interface is still here (apart from .seqres and .model) class PDB #There are a few modules and classes here used for the old style parsing class FieldDef [snip!] end class Record < Hash [snip!] end [snip!] #My new classes for atoms, residues, chains and modules go here class Atom [snip!] end class Residue [snip!] end class Chain [snip!] end class Model [snip!] end end #class PDB end #module Bio Perhaps the PDBUtils and Finder modules should go inside the PDB class? Or a separate file for each class and the mixins? Alex Gutteridge European Bioinformatics Institute Cambridge CB10 1SD UK Tel: 01223 492550 Email: alexg@ebi.ac.uk