#2387 closed defect (fixed)
Alt loc issues
| Reported by: | Tristan Croll | Owned by: | Eric Pettersen |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Structure Analysis | Version: | |
| Keywords: | Cc: | ||
| Blocked By: | Blocking: | ||
| Notify when closed: | Platform: | all | |
| Project: | ChimeraX |
Description
The following bug report has been submitted:
Platform: Linux-3.10.0-957.12.2.el7.x86_64-x86_64-with-centos-7.6.1810-Core
ChimeraX Version: 0.91 (2019-08-27)
Description
Not sure if this is a bug, but I'm curious why on loading 6akn some atoms with multiple altlocs have the 'A' altloc shown, while others have the 'B' one shown? If m is the model:
from chimerax.atomic import Atoms
aatoms = Atoms([a for a in m.atoms if len(a.alt_locs)>1)]
aatoms.alt_locs
array(['A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A',
'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A',
'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A',
'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A',
'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A',
'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A',
'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A',
'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A',
'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A',
'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A',
'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A',
'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A',
'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A',
'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A',
'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A',
'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A',
'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A',
'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A',
'A', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B',
'B', 'B', 'B', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A',
'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'B', 'B', 'B', 'B', 'B',
'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B', 'B',
'B', 'B', 'B', 'B'], dtype=object)
aatoms[-1].alt_locs
['A', 'B']
Does it have to do with the order they appear in the file? In any case, I don't think this is the best approach. Would be better to start with all atoms in their lowest alphabetical altloc, in my opinion.
Side note: this model has 15 atoms with physically-impossible anisotropic B-factors (with zero or negative determinant) which causes Clipper to generate NaNs in its structure factor calculations. I've just finished adding a sanity check on these (run the first time the model is loaded, and on any aniso_u changes thereafter) that nulls out the offending entries reverting the atoms to isotropic B-factors only. While the check can be done in a single straightforward Numpy method for the aniso_us of all current altlocs, I can't see any straightforward way to check the remaining altlocs except to loop over those atoms individually, switch to each altloc and check, then switch back to the current one. Not a huge issue in this case since the code is still quite simple and won't have to run very often, but it feels a bit clunky. It'll fire off a more-or-less spurious REASON_ALT_LOC each time, and it tends to lead to some duplicated logic (fast array form for the current atoms, singular for each altloc atom). Similar issues arise when wanting to move or copy a whole chain. Not really sure how it would be implemented, but it would be fantastic to have an Atoms-like array that includes each individual altloc of an atom as a separate entity.
Log:
UCSF ChimeraX version: 0.91 (2019-08-27)
© 2016-2019 Regents of the University of California. All rights reserved.
How to cite UCSF ChimeraX
> open 6akn structureFactors true
Summary of feedback from opening 6akn fetched from pdb
---
warnings | Atom H1 is not in the residue template for ALA #1 in chain A
Atom H1 is not in the residue template for ALA #1 in chain B
The following atoms were found to have physically impossible anisotropic
B-factor (ANISOU) entries. These have been removed in favour of their
isotropic B-factors.
A27: N
A73: CG2
A84: CB
B66: CB
A355: O
A438: O
A442: O
A464: O
A477: O
A499: O
B308: O
B439: O
B451: O
B456: O
B514: O
B521: O
B554: O
A73: CG2 altloc B
A84: CE altloc B
B60: CG2 altloc B
B73: CG1 altloc B
notes | Resolution: 1.186000967134541
6akn title:
X-ray Crystal Structure of Pseudoazurin Met16Leu Variant [more info...]
Chain information for 6akn
---
Chain | Description
1.3/A 1.3/B | Pseudoazurin
Non-standard residues in 6akn #1.3
---
CU — copper (II) ion
6akn mmCIF Assemblies
---
1| author_defined_assembly
2| author_defined_assembly
> toolshed show Shell
/opt/UCSF/ChimeraX-daily/lib/python3.7/site-
packages/IPython/core/history.py:226: UserWarning: IPython History requires
SQLite, your history will not be saved
warn("IPython History requires SQLite, your history will not be saved")
OpenGL version: 3.3.0 NVIDIA 415.27
OpenGL renderer: TITAN Xp/PCIe/SSE2
OpenGL vendor: NVIDIA Corporation
Change History (5)
comment:1 by , 6 years ago
| Platform: | → all |
|---|---|
| Project: | → ChimeraX |
comment:2 by , 6 years ago
| Component: | Unassigned → Structure Analysis |
|---|---|
| Owner: | set to |
| Status: | new → accepted |
| Summary: | ChimeraX bug report submission → Alt loc issues |
comment:3 by , 6 years ago
| Resolution: | → fixed |
|---|---|
| Status: | accepted → closed |
ChimeraX chooses alt locs by looking at connected groups of alt locs and choosing the alt loc with the highest average occupancy. If that's tied it chooses the one with the lowest average bfactor. If that's tied then it uses the first alphabetically.
Of some help with the side note, you can use:
with atom.suppress_alt_loc_change_notifications():
...code that switches between alt locs for 'atom'...
To switch between alt locs for an atom without generating REASON_ALT_LOC notifications, and the atom will be returned to its original alt loc when the context manager exits.
I have now added the Atoms.num_alt_locs property you requested.
comment:4 by , 6 years ago
6akn has other issues as well. Many of the waters have exactly _one_ alt loc! For instance, HOH 303 in chain A only has a 'B' alt loc!
follow-up: 5 comment:5 by , 6 years ago
I guess that’s a reasonable strategy for choosing the altlocs to show in existing structures. Something I’m keen on doing once I finally get around to supporting altlocs in ISOLDE is to make sure all altlocs are self-consistent - that is, choosing all ‘A’ gets an energy-minimised model with similar occupancies, ‘B’ does the same, etc.. Something that’s not done at all well right now. I also noticed the “single-altloc” atoms. I figure they came about from adding alternates, then later deciding all but one were unjustified. It’s endlessly fascinating just how many such ways there are for models to be subtly wrong!
Also, an
Atoms.num_alt_locsproperty would be really handy for filtering purposes.