﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking	notify_on_close	platform	project
2926	Adding coord sets	tony.schaefer@…	Tom Goddard	"{{{
The following bug report has been submitted:
Platform:        Windows-10-10.0.17763
ChimeraX Version: 0.92 (2020-03-03)
Description
I'm not sure if this is a bug or if I need to add something to my code. I've had issues adding coordsets to molecules. When I open 'freq.out', I'm adding coordsets to it using `mdl.add_coordsets`. I'm doing the same thing in my tool to reset the coordinate sets (again using `mdl.add_coordsets`). Each time I set the coordsets, I print the coordset array to the reply log. It looks the same both times. The issue is that the second time I add the coordsets, it doesn't seem to work. I can open the shell and grab the coordsets (using `mdl.coordsets(1).xyzs`). However, the atom coordinates do not match the coordset (`mdl.atoms[i].coord`). The molecule also appears very different. 

The only thing I've gotten to work to overwrite coordsets with my tool is 
```
mdl.remove_coordsets()
for i, coordset in enumerate(coordsets):
    mdl.add_coordset(i+1, coordsets)
    mdl.active_coordset_id = i + 1
    for atom, coord in zip(mdl.atoms, coordset):
        atom.coord = coord
```
where mdl is the model and coordsets in the coordset array (equal to the one I used when opening the molecule). 

Like I said, I've tried using `mdl.add_coordsets` here. I've also tried just looping over the coordset array and doing `mdl.add_coordset`. I've tried both of these with and without mdl.remove_coordsets(). Without the `for atom, coord` loop, the coordinate sets don't do what I expect. The atom coordinates seem to all get set to zero, but never updated to what's in coordsets. I'm not sure why I wouldn't be able to just use mdl.add_coordsets(x, replace=True). 

I've attached a session with two models: a freshly-opened 'freq.out', and a 'freq.out' where I've tried to overwrite the coordsets with mdl.add_coordsets. 

Log:
> cd ""C:\Users\Tony Schaefer/Desktop""

Current working directory is: C:\Users\Tony Schaefer\Desktop  
UCSF ChimeraX version: 0.92 (2020-03-03)  
© 2016-2020 Regents of the University of California. All rights reserved.  
How to cite UCSF ChimeraX  
Successfully installed 'ChimAARON-0.1-py3-none-any.whl'  
Looking in indexes: https://pypi.org/simple,
https://cxtoolshed.rbvi.ucsf.edu/pypi/  
Processing c:\users\tony
schaefer\appdata\local\ucsf\chimerax\cache\0.92\installers\chimaaron-0.1-py3-none-
any.whl  
Requirement already satisfied, skipping upgrade: ChimeraX-Core>=0.1 in
d:\chimerax\bin\lib\site-packages (from ChimAARON==0.1) (0.92)  
Requirement already satisfied, skipping upgrade: scipy in
d:\chimerax\bin\lib\site-packages (from ChimAARON==0.1) (1.4.1)  
Requirement already satisfied, skipping upgrade: numpy in
d:\chimerax\bin\lib\site-packages (from ChimAARON==0.1) (1.17.4+mkl)  
Installing collected packages: ChimAARON  
Attempting uninstall: ChimAARON  
Found existing installation: ChimAARON 0.1  
Uninstalling ChimAARON-0.1:  
Successfully uninstalled ChimAARON-0.1  
Successfully installed ChimAARON-0.1  
Lock 2950636499272 acquired on C:\Users\Tony
Schaefer\AppData\Local\UCSF\ChimeraX\Cache\0.92\toolshed\bundle_info.cache.lock  
Lock 2950636499272 released on C:\Users\Tony
Schaefer\AppData\Local\UCSF\ChimeraX\Cache\0.92\toolshed\bundle_info.cache.lock  
  

> open ""C:\Users\Tony Schaefer\Desktop\freq.out""

Summary of feedback from opening C:\Users\Tony Schaefer\Desktop\freq.out  
---  
notes | there are 5 coordsets  
0 float64  
[[ 0. 0. 0.68769]  
[ 0. 0. -0.53966]  
[ 0. 0.93947 -1.1318 ]  
[ 0. -0.93947 -1.1318 ]]  
1 float64  
[[ 0. -0. 0.672927]  
[-0. 0. -0.532651]  
[ 0. 0.945975 -1.127923]  
[ 0. -0.945975 -1.127923]]  
2 float64  
[[ 0. 0. 0.670659]  
[-0. 0. -0.528855]  
[ 0. 0.947362 -1.128687]  
[ 0. -0.947362 -1.128687]]  
3 float64  
[[ 0. -0. 0.671777]  
[-0. -0. -0.527821]  
[ 0. 0.946536 -1.129763]  
[ 0. -0.946536 -1.129763]]  
4 float64  
[[-0. 0. 0.673041]  
[ 0. 0. -0.526642]  
[-0. 0.945072 -1.130984]  
[-0. -0.945072 -1.130984]]  
  
Opened C:\Users\Tony Schaefer\Desktop\freq.out as a out file  

> toolshed show ""Managed Models""

there are 5 coordsets  
0 float64  
[[ 0. 0. 0.68769]  
[ 0. 0. -0.53966]  
[ 0. 0.93947 -1.1318 ]  
[ 0. -0.93947 -1.1318 ]]  
1 float64  
[[ 0. -0. 0.672927]  
[-0. 0. -0.532651]  
[ 0. 0.945975 -1.127923]  
[ 0. -0.945975 -1.127923]]  
2 float64  
[[ 0. 0. 0.670659]  
[-0. 0. -0.528855]  
[ 0. 0.947362 -1.128687]  
[ 0. -0.947362 -1.128687]]  
3 float64  
[[ 0. -0. 0.671777]  
[-0. -0. -0.527821]  
[ 0. 0.946536 -1.129763]  
[ 0. -0.946536 -1.129763]]  
4 float64  
[[-0. 0. 0.673041]  
[ 0. 0. -0.526642]  
[-0. 0.945072 -1.130984]  
[-0. -0.945072 -1.130984]]  

> toolshed show Shell




OpenGL version: 3.3.0 NVIDIA 441.87
OpenGL renderer: GeForce RTX 2070/PCIe/SSE2
OpenGL vendor: NVIDIA Corporation
File attachment: coordsets.cxs

}}}

[attachment:""coordsets.cxs""]
"	defect	closed	normal		MD/Ensemble Analysis		not a bug		Eric Pettersen				all	ChimeraX
