#1487 closed defect (fixed)
Matrix reuse (optimization) problem
Reported by: | Elaine Meng | Owned by: | Tom Goddard |
---|---|---|---|
Priority: | blocker | Milestone: | 0.8 |
Component: | Core | Version: | |
Keywords: | Cc: | Eric Pettersen | |
Blocked By: | Blocking: | ||
Notify when closed: | Platform: | all | |
Project: | ChimeraX |
Description
This problem screws up saving moved structures to PDB files, and possibly other things. Basically, structure.scene_position.matrix is the same matrix object for different structures, so code that thinks it's saving a position matrix will be surprised to find that the value of the matrix has changed when some other structure's position matrix gets accessed.
To reproduce:
open 1gcn twice
move x models #2
in the Python shell:
m1, m2 = session.models
x = m1.scene_position.matrix
x (shows identity matrix)
m2.scene_position.matrix (shows matrix with translation)
x (now shows matrix with translation)
Attachments (3)
Change History (7)
comment:1 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:2 by , 7 years ago
It is still messed up whether or not I say “rel #1” in the PDB-saving command. Opening in ChimeraX current daily build shows correct disposition of models. The central thing shown as surfaces is #1, and #2-4 are IGG copies hand-placed and/or matched in different locations. Model #1 also has a Fab fragment (2 chains currently hidden) that were used to place one of the IGG copies using matchmaker. The other two copies of the IGG were hand-placed based on knowledge of the epitopes.
I opened the attached session in ChimeraX and then
save botb-fab-3iggs-rel1.pdb rel #1
save botb-fab-3iggs.pdb
Then I looked at the PDBs in Chimera, where they are #0.1-#0.4. Apparently both files have the 3 IGGs all on top of each other, although in the “rel” case they might be in one of the correct locations… not sure about that, but clearly PDB-saving when structures have been moved is still buggy.
by , 7 years ago
Attachment: | botb-2.cxs added |
---|
by , 7 years ago
Attachment: | botb-fab-3iggs-rel1.pdb added |
---|
by , 7 years ago
Attachment: | botb-fab-3iggs.pdb added |
---|
comment:3 by , 7 years ago
Oops! It appears I forgot to git push my fix for this yesterday. Sorry about that -- was a busy day of 3.5 hours of demos. Let's check tomorrow's build.
comment:4 by , 7 years ago
Tested saving your session to a PDB file in last nights build and it is working now.
Fixed.
Problem is that Place instances are reused. So holding a reference to a Place matrix (numpy array) after the Place is no longer used was allowing that numpy array to be reused. Changed code so Place.matrix return a copy of the matrix.