Opened 6 years ago

Closed 6 years ago

#1916 closed defect (fixed)

KeyError saving mmCIF

Reported by: c.sachse@… Owned by: Greg Couch
Priority: normal Milestone:
Component: Input/Output Version:
Keywords: Cc: pett
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

The following bug report has been submitted:
Platform:        Darwin-18.5.0-x86_64-i386-64bit
ChimeraX Version: 0.9 (2019-05-05)
Description
Problem saving of helical assembly TMV in mmcif format.

assembly was expanded according to BIOMT matrix from PDB code 4udv 


(Describe the actions that caused this problem to occur here)

Log:
UCSF ChimeraX version: 0.9 (2019-05-05)  
© 2016-2019 Regents of the University of California. All rights reserved.  
How to cite UCSF ChimeraX  

> open /Users/sachse/sciebo/Shared/temp_shared/kkaspary/tmv_49x.pdb

tmv_49x.pdb title:  
Cryo-em structure of TMV At 3.35 A resolution [more info...]  
  
Chain information for tmv_49x.pdb  
---  
Chain | Description  
1.1/A | capsid protein  
1.2/A 1.3/A 1.4/A 1.5/A 1.6/A 1.7/A 1.8/A 1.9/A 1.10/A 1.11/A 1.12/A 1.13/A
1.14/A 1.15/A 1.16/A 1.17/A 1.18/A 1.19/A 1.20/A 1.21/A 1.22/A 1.23/A 1.24/A
1.25/A 1.26/A 1.27/A 1.28/A 1.29/A 1.30/A 1.31/A 1.32/A 1.33/A 1.34/A 1.35/A
1.36/A 1.37/A 1.38/A 1.39/A 1.40/A 1.41/A 1.42/A 1.43/A 1.44/A 1.45/A 1.46/A
1.47/A 1.48/A 1.49/A | capsid protein  
1.1/R 1.2/R 1.3/R 1.4/R 1.5/R 1.6/R 1.7/R 1.8/R 1.9/R 1.10/R 1.11/R 1.12/R
1.13/R 1.14/R 1.15/R 1.16/R 1.17/R 1.18/R 1.19/R 1.20/R 1.21/R 1.22/R 1.23/R
1.24/R 1.25/R 1.26/R 1.27/R 1.28/R 1.29/R 1.30/R 1.31/R 1.32/R 1.33/R 1.34/R
1.35/R 1.36/R 1.37/R 1.38/R 1.39/R 1.40/R 1.41/R 1.42/R 1.43/R 1.44/R 1.45/R
1.46/R 1.47/R 1.48/R 1.49/R | 5'-D(*GP*ap*ap)-3'  
  

> save /Users/sachse/sciebo/Shared/temp_shared/kkaspary/tmv_49x.mmcif

Traceback (most recent call last):  
File
"/Applications/Science/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/toolbar/tool.py", line 140, in <lambda>  
lambda e, what=what, self=self: self.handle_scheme(what),  
File
"/Applications/Science/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/toolbar/tool.py", line 96, in handle_scheme  
run(self.session, f'{value}')  
File
"/Applications/Science/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/core/commands/run.py", line 31, in run  
results = command.run(text, log=log)  
File
"/Applications/Science/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/core/commands/cli.py", line 2631, in run  
result = ci.function(session, **kw_args)  
File
"/Applications/Science/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/core/commands/save.py", line 61, in save  
fmt.export(session, filename, fmt.nicknames[0], **kw)  
File
"/Applications/Science/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/core/io.py", line 213, in export  
result = self.export_func(session, path, **kw)  
File
"/Applications/Science/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/atomic/mmcif/__init__.py", line 61, in save_file  
return mmcif_write.write_mmcif(session, path, models=models)  
File
"/Applications/Science/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/atomic/mmcif/mmcif_write.py", line 108, in write_mmcif  
save_structure(session, f, models, used_data_names)  
File
"/Applications/Science/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/atomic/mmcif/mmcif_write.py", line 508, in save_structure  
asym_id, entity_id = asym_info[(chain_id, chars)]  
KeyError: ('A',
'SYSITTPSQFVFLSSAWADPIELINLCTNALGNQFQTQQARTVVQRQFSEVWKPSPQVTVRFPDSDFKVYRYNAVLDPLVTALLGAFDTRNRIIEVENQANPTTAETLDATRRVDDATVAIRSAINNLIVELIRGTGSYNRSSFESSSGLVWTSGPAT')  
  
KeyError: ('A',
'SYSITTPSQFVFLSSAWADPIELINLCTNALGNQFQTQQARTVVQRQFSEVWKPSPQVTVRFPDSDFKVYRYNAVLDPLVTALLGAFDTRNRIIEVENQANPTTAETLDATRRVDDATVAIRSAINNLIVELIRGTGSYNRSSFESSSGLVWTSGPAT')  
  
File
"/Applications/Science/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-
packages/chimerax/atomic/mmcif/mmcif_write.py", line 508, in save_structure  
asym_id, entity_id = asym_info[(chain_id, chars)]  
  
See log for complete Python traceback.  
  




OpenGL version: 4.1 INTEL-12.8.38
OpenGL renderer: Intel(R) Iris(TM) Plus Graphics 655
OpenGL vendor: Intel Inc.

Attachments (2)

4udv-multimer.pdb (4.8 MB ) - added by pett 6 years ago.
PDB of expanded multimer generated by Chimera
smime.p7s (5.1 KB ) - added by c.sachse@… 6 years ago.
Added by email2trac

Change History (10)

by pett, 6 years ago

Attachment: 4udv-multimer.pdb added

PDB of expanded multimer generated by Chimera

comment:1 by pett, 6 years ago

Cc: pett added
Component: UnassignedInput/Output
Owner: set to Greg Couch
Platform: all
Project: ChimeraX
Status: newassigned
Summary: ChimeraX bug report submissionKeyError saving mmCIF

Error saving mmCIF of assembly that originated as PDB file generated by Chimera. Not sure if it's an mmCIF-saving bug or a PDB-reading bug, but since the first error is in the mmCIF-saving code, starting with that.

Reported by Carsten Sachse.

comment:2 by Greg Couch, 6 years ago

That structure is not an NMR structure, yet it is using PDB MODEL records. Isn't that illegal? Anyway the mmCIF writing code needs to know the models are not an ensemble. Eric, how easy it that to detect? Right now, it detects NMR ensembles, as opposed to IHM assemblies, by seeing that the model names are all the same. Ideally, all of the models would have been combined into one model in chimera before trying to use it in ChimeraX.

in reply to:  4 comment:3 by c.sachse@…, 6 years ago

Dear Greg,

Remember the MODEL record was generated by Chimera after multiple copy creation via BIOMT matrix. In any case, ChimeraX should also properly handle multiple models from NMR, shouldn’t it? 

This problem may reoccur in the handling of other symmetric assemblies.

Best wishes,


Carsten

smime.p7s

by c.sachse@…, 6 years ago

Attachment: smime.p7s added

Added by email2trac

comment:4 by pett, 6 years ago

Illegal? Dunno, but in practical terms MODEL records are used extensively in non-NMR situations, e.g. for representing MD output as a PDB file. Basically any situation where each model is a different conformer of the same set of atoms. ChimeraX needs to handle these very common non-NMR situations.

Why does the mmCIF code need to know that these are "not an ensemble"? It the same set of atoms in each model. What makes this "not an ensemble"?

--Eric

comment:5 by Greg Couch, 6 years ago

Status: assignedaccepted

comment:6 by Greg Couch, 6 years ago

Looking into this now. Opening NMR ensembles from mmCIF files has been fixed. Tried opening 4udv in ChimeraX (the mmCIF file) and generating the "representative helical assembly", and then saving it as a mmcif file. That appeared to work, but was not reopened successfully. Will work on that first.

comment:7 by Greg Couch, 6 years ago

Part of the problem is that the chain information is not copied when structures are copied, see #2263.

comment:8 by Greg Couch, 6 years ago

Resolution: fixed
Status: acceptedclosed

Improved detected of NMR ensembles when writing mmCIF files, so this doesn't get written as an NMR ensemble and consequently does not generate a traceback.

Note: See TracTickets for help on using tickets.