[Biopython-dev] Features of the GSOC branch ready to be merged

Eric Talevich eric.talevich at gmail.com
Mon Dec 13 18:39:49 UTC 2010


Hey folks,

1. For stand-alone functions that don't seem to fit anywhere else, I suggest
creating a file called _utils.py (rather than Utils.py or Misc.py) -- this
means it's protected, i.e. users know they're not supposed to access it
directly -- then import it to the top level in __init__.py:

from Bio.PDB._utils import renumber_residues, center_of_mass, ...

Then you're allowed to move the functions in that module somewhere else
later without going through the usual deprecation process.


2. For renumber_residues in particular, adding a keyword argument like
"chain=None" would solve the immediate problem. Would anyone want to select
a model for renumbering? We might as well make it possible.

So the three sensible ways to do that are:
(a) Add a "model=None" keyword, too, and select the appropriate
chain(s)/model(s) based on the combination of those two arguments. I think
this isn't so bad.
(b) Move the method from Structure to Entity. Then Residue inherits the
method, too, and I guess it's a trivial operation there.
(c) Turn the method into a separate function, accessible as
Bio.PDB.renumber_residues().

Does this method make sense on RNA or DNA structures? Do RNA people call
bases "residues" sometimes?
 - If so: keeping the method on PDB.Structure is good
 - If not: When Bio.Struct lands, the method might need to move to
Bio.Struct.Protein

I think the best route is (a), leaving it on PDB.Structure. The three cases
of Structure, Model and Chain cover everything in Bio.PDB that you'd want to
renumber, and two optional keyword arguments aren't so bad. Also, most of
the other functionality in Bio.PDB is accessed through the Structure or
Entity objects, rather than through top-level functions. I.e., you do "from
Bio.PDB import stuff_i_need" rather than "from Bio import PDB" usually.

Let's also leave out renumbering specified residue ranges, at least for this
merge -- having both "start" and "first" as keyword arguments could be
really confusing. Maybe post it as a cookbook entry first?


Cheers,
Eric



On Mon, Dec 13, 2010 at 10:32 AM, João Rodrigues <anaryin at gmail.com> wrote:

> Hey Kristian, all,
>
> What about this: creating a new file under Bio.PDB called Misc.py or
> Utilities.py that contains functions like renumber_residues. I'm thinking on
> other functions like joining PDB files, extracting chains from PDB files,
> renaming chains etc.
>
> These are all operations that one can easily do programatically using
> Bio.PDB, however they do require coding (10 lines each I'd say). This
> "collection" of useful snippets could be included in a separate file and
> even provide an interface to the command line. This was one of Eric's ideas
> for GSOC I didn't pursue in my project.
>
> Regarding renumber_residues explicitly, this would allow using it
> structure-wide or chain-wide without duplicating code (Right now it sits on
> Structure.py). I can also keep it as is now and just add chain, from_id, and
> to_id arguments.
>
> Let me know of your opinions,
>
> Cheers
>
>
> João [...] Rodrigues
> http://doeidoei.wordpress.com
>
>
>
> On Mon, Dec 13, 2010 at 4:13 PM, Kristian Rother <krother at rubor.de> wrote:
>
>>
>> Hi Joao,
>>
>> I agree with Eric that renumbering residues should be possible chain-wise.
>>
>> In my daily work, I am frequently using an interface similar to
>>
>> renumber( chain, start_id )
>>
>> rather than
>>
>> renumber( structure, start_id )
>>
>> But having these two in BioPython would be quite cool. We also do
>> numbering of portions
>>
>> renumber (chain, start_id, from_id, to_id)
>>
>> and using insertion codes --> 1A, 1B, 1C, 1D...
>> But I agree these are not so important.
>>
>> Best regards,
>>    Kristian
>>
>>
>>
>>
>>
>> > Hello Eric,
>> >
>> > Regarding renumber_residues, I could add the following arguments to make
>> > it
>> > more flexible:
>> > - *first *and *last*: to allow renumbering of specific sections of the
>> > structure
>> > - *chain* : to limit the renumbering to one chain only.
>> >
>> > As for the biological units I'll have to look at them again... to be
>> > honest
>> > I really need to retest them :x
>> >
>> > Thanks for the comments :)
>> >
>> > Best!
>> >
>> > João
>> >
>> > _______________________________________________
>> > Biopython-dev mailing list
>> > Biopython-dev at lists.open-bio.org
>> > http://lists.open-bio.org/mailman/listinfo/biopython-dev
>> >
>>
>>
>




More information about the Biopython-dev mailing list