You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In many mmCIF files, atoms exist equally in two locations, each with an occupancy of 0.5. For example, this screenshot from PDB ID 1adl:
Currently, when calling get_structure() with altloc=occupancy, there's some instability present in which altloc is chosen for a given residue in such situations. Sometimes the A conformation is chosen; sometimes the B conformation. From what I can tell, the lack of determinism may arise from the use of a set to store altlocs within the filter_highest_occupancy_altloc function here.
Although either choice is theoretically correct, such instability makes results much more challenging to debug.
Proposed solution:
Change the implementation of filter_highest_occupancy_altloc to be deterministic when two altlocs have equal occupancy; e.g., use a sorted list() rather than a set. Given the length of typical altloc sets, there will be minimal to no performance impact.
The text was updated successfully, but these errors were encountered:
Hi, thanks for pinpointing the problem. I think your analysis is correct. If I remember correctly, the set ensures that each altloc ID only appears once, but there is no reason to not enveloping the set with sorted().
Yes, we definitely need the set() since we're storing one altloc ID per atom, and thus have duplicates within a residue. Enveloping with sorted() should be a quick fix. I'll make a PR shortly! Thanks for your quick response!
Problem description:
In many mmCIF files, atoms exist equally in two locations, each with an occupancy of 0.5. For example, this screenshot from PDB ID
![image](https://private-user-images.githubusercontent.com/8575391/332988052-ea0f24da-473f-4b62-9c9d-0ca0730d6789.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ2MDA2MTksIm5iZiI6MTcyNDYwMDMxOSwicGF0aCI6Ii84NTc1MzkxLzMzMjk4ODA1Mi1lYTBmMjRkYS00NzNmLTRiNjItOWM5ZC0wY2EwNzMwZDY3ODkucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDgyNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA4MjVUMTUzODM5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YTA1MWE1NzMyYmY1ZTRjYjhkOGViNzQ2OWM0ZmU5NzJiNmEzNzczYWJkOWFlZDMwNmIzNDA0NDgxNzhhMTllMyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.niC_UWia5i7N9uUKRVqCbkrV14W76h3US2rmtHCjhvQ)
1adl
:Currently, when calling
get_structure()
withaltloc=occupancy
, there's some instability present in whichaltloc
is chosen for a given residue in such situations. Sometimes theA
conformation is chosen; sometimes theB
conformation. From what I can tell, the lack of determinism may arise from the use of aset
to storealtlocs
within thefilter_highest_occupancy_altloc
function here.Although either choice is theoretically correct, such instability makes results much more challenging to debug.
Proposed solution:
Change the implementation of
filter_highest_occupancy_altloc
to be deterministic when twoaltlocs
have equal occupancy; e.g., use a sortedlist()
rather than a set. Given the length of typicalaltloc
sets, there will be minimal to no performance impact.The text was updated successfully, but these errors were encountered: