macrozhu at gmail.com
Tue Jan 25 10:17:48 UTC 2011
I totally agree that removing hetero-flag from residue ID is a big API
change. I myself hate that very much when some other libraries I use
announce such API changes. That should always be carefully planned and kept
In my opinion, what's more realistic is to add an additional mechanism to
locate residues in PDB.Residue, in which no hetero-flag is required. That
is, in this mechanism, one can use just sequence identifier + icode.
Internally, PDB.Residue will first check whether residue (' ', seqnum,
icode) exists. If not, it checks all residues with non-empty hetero-flag.
Only if no residue with the sequence identifier + icode exsits (regardless
of the hetero-flag) does it throw an exception, rather than simply throw an
exception if (' ', seqnum, icode) does not exists.
For instance, this can be realized by revising PDB.Chain._translate_id() to:
def _translate_id(self, id):
longid=(' ', id, ' ')
if not self.has_id(longid):
for r in self:
if r.id != ' ' and r.id == id and r.id == ' ':
longid = r.id
longid = id
On Tue, Jan 25, 2011 at 10:40 AM, Kristian Rother <krother at rubor.de> wrote:
> In our group, we've been discussing the PDB.Residue.id issue a couple of
> times. The current notation is fine but it is unintuitive and hard to
> learn for newbies.
> We therefore use a wrapper that allows to access residues by one-string
> ids = str(identifier + icode), like '101', '101A', '3B' etc.
> I'm sure changing ids in PDB.Residue would break a lot of scripts people
> use. I could imagine some workarounds that allow ignoring the HETERO flag
> though. Would work for me. How about you?
> Best regards,
More information about the Biopython-dev