Opened 7 years ago

Closed 7 years ago

#1548 closed defect (fixed)

KeyError while writing mmCIF

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

Description

The following bug report has been submitted:
Platform:        Darwin-17.7.0-x86_64-i386-64bit
ChimeraX Version: 0.8 (2018-12-15)
Description
Open the attached file and then save it in mmCIF format.

Log:
Startup Messages  
---  
notes | FYI: command is replacing existing command: "volume"  
FYI: command is replacing existing command: "color"  
  
UCSF ChimeraX version: 0.8 (2018-12-15)  
How to cite UCSF ChimeraX  

> open /Users/pett/rm/1f8p_assembly.cif

Summary of feedback from opening /Users/pett/rm/1f8p_assembly.cif  
---  
warnings | Missing entity_poly_seq table. Inferring polymer connectivity.  
Atom H1 is not in the residue template for TYR #1 in chain A  
for chain A is incomplete. Ignoring input sequence records as basis for
sequence.  
for chain A is incomplete. Ignoring input sequence records as basis for
sequence.  
for chain A is incomplete. Ignoring input sequence records as basis for
sequence.  
for chain A is incomplete. Ignoring input sequence records as basis for
sequence.  
for chain A is incomplete. Ignoring input sequence records as basis for
sequence.  
11 messages similar to the above omitted  
  
Chain information for 1f8p_assembly.cif  
---  
Chain | Description  
1.1/A | neuropeptide Y (PNPY)  
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 | neuropeptide Y (PNPY)  
  

> save ~/rm/1f8p-test.cif

Traceback (most recent call last):  
File
"/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-
packages/chimerax/cmd_line/tool.py", line 229, in execute  
cmd.run(cmd_text)  
File
"/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-
packages/chimerax/core/commands/cli.py", line 2587, in run  
result = ci.function(session, **kw_args)  
File
"/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-
packages/chimerax/core/commands/save.py", line 61, in save  
fmt.export(session, filename, fmt.nicknames[0], **kw)  
File
"/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-
packages/chimerax/core/io.py", line 198, in export  
result = self.export_func(session, path, **kw)  
File
"/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-
packages/chimerax/atomic/mmcif/__init__.py", line 61, in save_file  
return mmcif_write.write_mmcif(session, path, models=models)  
File
"/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-
packages/chimerax/atomic/mmcif/mmcif_write.py", line 108, in write_mmcif  
save_structure(session, f, models, used_data_names)  
File
"/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-
packages/chimerax/atomic/mmcif/mmcif_write.py", line 508, in save_structure  
asym_id, entity_id = asym_info[(chain_id, chars)]  
KeyError: ('A', 'YPSKPDNPGEDAPAEDLARYYSALRHYINLITRQRYX')  
  
KeyError: ('A', 'YPSKPDNPGEDAPAEDLARYYSALRHYINLITRQRYX')  
  
File
"/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/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 NVIDIA-10.32.0 355.11.10.10.40.102
OpenGL renderer: NVIDIA GeForce GTX 675MX OpenGL Engine
OpenGL vendor: NVIDIA Corporation
File attachment: 1f8p_assembly.cif

1f8p_assembly.cif

Attachments (1)

1f8p_assembly.cif (710.1 KB ) - added by lpravda@… 7 years ago.
Added by email2trac

Download all attachments as: .zip

Change History (8)

by lpravda@…, 7 years ago

Attachment: 1f8p_assembly.cif added

Added by email2trac

comment:1 by Eric Pettersen, 7 years ago

Cc: Eric Pettersen added
Component: UnassignedInput/Output
Owner: set to Greg Couch
Platform: all
Project: ChimeraX
Status: newassigned
Summary: ChimeraX bug report submissionKeyError while writing mmCIF

comment:2 by Greg Couch, 7 years ago

Status: assignedaccepted

I'm looking into this. I am worried about the missing entity_poly_seq table. But that might be a red herring.

comment:3 by Greg Couch, 7 years ago

Bug is due to (at least) one of the models in the ensemble not having the same sequence as the others (missing the trailing NH2). Bug is in the mmCIF reading code, because all of the ensembles should have the same sequence, even if the sequence is guessed.

comment:4 by Greg Couch, 7 years ago

Resolution: fixed
Status: acceptedclosed

So this one is fixed. Out of curiosity, where are these NMR mmCIF files coming from? I'd like to know what software package is failing to add the entity_poly_seq table.

in reply to:  6 comment:5 by lpravda@…, 7 years ago

So this is the Litemol software (more specifically coordinate server) which is being developed by one of our collaborators for serving 3D data for fast streaming of coordinates to the web-based molecular viewer. We have also a density server which can serve arbitrary chunks of electron densities. Both of the packages are open source, so I think you will find them really useful, just have a look (https://github.com/dsehnal).

Both of tools sit on the top of the archive with coordinates and electron maps and serves whatever is required.

CoordinateServer: https://www.ebi.ac.uk/pdbe/coordinates/index.html 
DensityServer: https://www.ebi.ac.uk/pdbe/densities/index.html
Paper: http://rdcu.be/z0Hf 

You can also have a look at the BinaryCIF, which is a compressed version of the mmcif format so save some bandwith and speed up parsing.

I'm in touch with the main developer to fix the missing bits soon. Should you have any questions don’t hesitate to ask.

Cheers,
Lukas

On 01/02/2019, 02:16, "ChimeraX" <ChimeraX-bugs-admin@cgl.ucsf.edu> wrote:

    #1548: KeyError while writing mmCIF
    -----------------------------------+--------------------
              Reporter:  lpravda@…     |      Owner:  gregc
                  Type:  defect        |     Status:  closed
              Priority:  normal        |  Milestone:
             Component:  Input/Output  |    Version:
            Resolution:  fixed         |   Keywords:
            Blocked By:                |   Blocking:
    Notify when closed:                |   Platform:  all
               Project:  ChimeraX      |
    -----------------------------------+--------------------
    Changes (by gregc):
    
     * status:  accepted => closed
     * resolution:   => fixed
    
    
    Comment:
    
     So this one is fixed.  Out of curiosity, where are these NMR mmCIF files
     coming from?  I'd like to know what software package is failing to add the
     entity_poly_seq table.
    
    --
    Ticket URL: <https://plato.cgl.ucsf.edu/trac/ChimeraX/ticket/1548#comment:4>
    ChimeraX <http://www.rbvi.ucsf.edu/chimerax/>
    ChimeraX Issue Tracker
    


comment:6 by Greg Couch, 7 years ago

Resolution: fixed
Status: closedreopened

Fix broken other parts of ChimeraX.

comment:7 by Greg Couch, 7 years ago

Resolution: fixed
Status: reopenedclosed

Bug was due to code that guessed the polymer sequence. The last residue in the chain is of type "non-polymer", so it was not included in the sequence when reading the atom_site table. But it is connected via the struct_conn table. So the sequence checking code in the chain making code noticed that the actual chain was longer that the sequence the mmCIF code provided, and failed with "Ignoring input sequence records as basis for sequence.", and didn't finish doing the rest of its processing.

The fix is to just use the guessed sequence for connectivity, but let the chain making code figure out the chains on its own.

Note: See TracTickets for help on using tickets.