[Biopython-dev] Module reorganization for upcoming Bio.PDB enhancements

João Rodrigues anaryin at gmail.com
Thu Jun 10 23:45:02 UTC 2010


Hello all,

I'm having some issues dealing with this :x

I created a module Bio.Struct that has the following contents:

__init__.py
Protein.py
WWW/

The __init__.py file has a read() method that calls PDBParser and returns a
Structure object. So far so good I think. Then I added a method to
Bio.PDB.Structure more or less like this:

    def as_protein(self):
        from Bio.Struct.Protein import Protein
        prot = Protein(self)
        return prot

so when you call it you get a new object. Protein is a class that inherits
from Structure and that has the search_ss_bonds function.

I can make the new object get all the methods from Structure AND from
Protein, but when I try to execute search_ss_bonds, it fails because
child_list, a Structure method, comes empty.. In fact, the whole SMCRA
object comes empty..

How do I effectively do the inheritance on the Protein class?

from Bio.PDB.Structure import Structure

class Protein(Structure):

    def __init__(self, protein):

        self = protein

This is what I last tried and doesn't work.. I've tried Structure.__init__,
and several other things but to no avail. I'm sure this is simple OOP but I
really can't understand that well how to do it ...

Care to give a hand to a friend in need? :)

Thanks in advance! By the way, I assume that if I got no comments on
anything else on the GSOC thread that I'm doing a perfect job :P Thanks for
that too :D

Best!

João [...] Rodrigues




More information about the Biopython-dev mailing list