﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking	notify_on_close	platform	project
3327	mmCIF output problem for inserted residues	Tristan Croll	Eric Pettersen	"{{{
The following bug report has been submitted:
Platform:        Linux-3.10.0-1062.9.1.el7.x86_64-x86_64-with-centos-7.7.1908-Core
ChimeraX Version: 1.0rc202005270557 (2020-05-27 05:57:28 UTC)
Description
Residues inserted into the middle of a protein chain are appended to the *end* of the chain when writing to mmCIF, causing the model to be messed up on reloading. If I take 3io0, delete residue 299, then add it back using the method at 

https://github.com/tristanic/isolde/blob/0d72c4cbd0a12cfce7671d618d62b115eb96220f/isolde/src/atomic/building/build_utils.py#L110

...  using residue 298 as the ""prev_res"" argument and then adding the bond, then:

{{{
m = session.models.list()[0]
from chimerax.atomic import selected_residues

m.residues.numbers # Lists the residue numbers in the correct order

# With all atoms selected
selected_residues(session).numbers # puts the new residue at the end
}}}

I've attached a session containing the model before and after saving to mmCIF and reopening (ignore the terrible geometry - didn't bother to energy minimise) - on re-opening the bonding to the preceding and following residues is correct, but there's a spurious bond from the C-terminus back to the N atom of the new residue, and a missing-structure pseudobond from the preceding to following residue (it wasn't there in the model before saving). 

Log:
UCSF ChimeraX version: 1.0rc202005270557 (2020-05-27)  
© 2016-2020 Regents of the University of California. All rights reserved.  
How to cite UCSF ChimeraX  

> open 3io0

3io0 title:  
Crystal structure of EtuB from Clostridium kluyveri [more info...]  
  
Chain information for 3io0 #1  
---  
Chain | Description  
A | EtuB protein  
  
3io0 mmCIF Assemblies  
---  
1| author_and_software_defined_assembly  
  

> show

> hide cartoons

> select /A:299@CA

1 atom, 1 model selected  

> select up

8 atoms, 7 bonds, 1 model selected  

> delete /A:299

> select /A:300@N

1 atom, 1 model selected  

> ui tool show Shell

/opt/UCSF/ChimeraX/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"")  

> select /A:298@C

1 atom, 1 model selected  

> color sel bychain

> color sel byhetero

> color sel bychain

> color sel byhetero

> select /A:299@C

1 atom, 1 model selected  

> preset custom ""make bond""

> open /home/tic20/chimerax_presets/make_bond.py

executed make_bond.py  
Preset implemented in Python; no expansion to individual ChimeraX commands
available.  

> select #1

1667 atoms, 1689 bonds, 1 model selected  

> pwd

Current working directory is: /home/tic20  

> save build_test.cif #1

> select clear

> hide #1 models

> open build_test.cif

Chain information for build_test.cif #2  
---  
Chain | Description  
A | EtuB protein  
  
build_test.cif mmCIF Assemblies  
---  
1| author_and_software_defined_assembly  
  

> show

> style #!2 stick

Changed 1667 atom styles  

> hide #!2 cartoons

> hide #!2 models

> show #1 models

> show #!2 models

> save building_bug.cxs




OpenGL version: 3.3.0 NVIDIA 440.33.01
OpenGL renderer: TITAN Xp/PCIe/SSE2
OpenGL vendor: NVIDIA Corporation
Manufacturer: Dell Inc.
Model: Precision T5600
OS: CentOS Linux 7 Core
Architecture: 64bit ELF
CPU: 32 Intel(R) Xeon(R) CPU E5-2687W 0 @ 3.10GHz
Cache Size: 20480 KB
Memory:
	              total        used        free      shared  buff/cache   available
	Mem:            62G        5.3G         40G        433M         16G         56G
	Swap:          4.9G          0B        4.9G

Graphics:
	03:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP102 [TITAN Xp] [10de:1b02] (rev a1)	
	Subsystem: NVIDIA Corporation Device [10de:11df]	
	Kernel driver in use: nvidia
PyQt version: 5.12.3
Compiled Qt version: 5.12.4
Runtime Qt version: 5.12.8
File attachment: building_bug.cxs

}}}

[attachment:""building_bug.cxs""]
"	defect	closed	normal		Input/Output		fixed		Greg Couch				all	ChimeraX
