Skip to content

Commit

Permalink
PDB 3NH3 HIS:244 breaks parser with occupancy of -1.0. Changed initia…
Browse files Browse the repository at this point in the history
…l last_occupancy of DisorderedAtom to -99.
  • Loading branch information
João Rodrigues committed May 12, 2011
1 parent 40298a6 commit c177210
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Bio/PDB/Atom.py
Expand Up @@ -301,7 +301,7 @@ def __init__(self, id):
Arguments: Arguments:
o id - string, atom name o id - string, atom name
""" """
self.last_occupancy=-1 self.last_occupancy=-99
DisorderedEntityWrapper.__init__(self, id) DisorderedEntityWrapper.__init__(self, id)


# Special methods # Special methods
Expand Down

2 comments on commit c177210

@etal
Copy link

@etal etal commented on c177210 May 12, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is a magic number now? Can you add a comment to make that clear?

Also consider these alternatives (for choosing the highest-occupancy atom in disordered_add, if I'm reading that correctly):

float("-Inf")
-inf
max(None, -1)
-1
max(float("-Inf"), None)
-inf

@JoaoRodrigues
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-1 was a magic number already, which apparently didn't work for this case. I never saw a negative occupancy, but apparently they might exist (under some very dubious pretense though..). I chose -99 because I doubt that that will be a valid number, since occupancy is (usually) between 0 and 1. Peter however, suggested to use None and I agree. It seems a safer option indeed.

Please sign in to comment.