Opened 5 years ago

Closed 5 years ago

#3425 closed defect (duplicate)

RFE: command to add C-terminal oxygens

Reported by: Tristan Croll Owned by: Eric Pettersen
Priority: normal Milestone:
Component: Structure Editing Version:
Keywords: Cc: Elaine Meng
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

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.0 (2020-06-04 23:15:07 UTC)
Description
I just put this together as a script to go in the ChimeraX presets directory, to help Dirk Fahrenkamp who was asking about how to add C-terminal OXT atoms to chains in his (very large) model. I know AddH will do this when it knows from the provided sequence that a residue is actually C-terminal, but as far as I'm aware there's no existing tool to do it manually. Anyway, it might be nice to implement something like this as a command?

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

> open 3io0 format mmcif fromDatabase pdb

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  
  

> preset custom "add oxt"

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

No atoms selected!  

> show

> hide cartoons

> select /A:303@CA

1 atom, 1 model selected  

> preset custom "add oxt"

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

Selection must be from a single model!  

> preset custom "add oxt"

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

Traceback (most recent call last):  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-packages/chimerax/ui/gui.py", line
1027, in <lambda>  
run(ses, "preset %s%s" % (cat, StringArg.unparse(name.lower()))))  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/core/commands/run.py", line 31, in run  
results = command.run(text, log=log)  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/core/commands/cli.py", line 2805, in run  
result = ci.function(session, **kw_args)  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/preset_mgr/cmd.py", line 49, in preset_cmd  
session.presets.preset_function(cat, matches[0])()  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/preset_mgr/manager.py", line 89, in <lambda>  
name: lambda p=preset: self.execute(p)  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/preset_mgr/manager.py", line 68, in execute  
preset()  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/preset_mgr/manager.py", line 109, in <lambda>  
run=run, ses=self.session: run(ses, "open " + p, log=False)  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/core/commands/run.py", line 31, in run  
results = command.run(text, log=log)  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/core/commands/cli.py", line 2805, in run  
result = ci.function(session, **kw_args)  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/open_command/cmd.py", line 101, in cmd_open  
Command(session, registry=registry).run(provider_cmd_text, log=log)  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/core/commands/cli.py", line 2805, in run  
result = ci.function(session, **kw_args)  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/open_command/cmd.py", line 152, in provider_open  
name or model_name_from_path(fi.file_name)), provider_kw)  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/open_command/cmd.py", line 365, in collated_open  
return func(*func_args, **func_kw)  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/core_formats/__init__.py", line 48, in open  
return open_python_script(session, data, file_name)  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/core/scripting.py", line 82, in open_python_script  
_exec_python(session, code, argv)  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/core/scripting.py", line 59, in _exec_python  
exec(code, sandbox.__dict__)  
File "add_oxt.py", line 25, in <module>  
NameError: name 'add_oxt' is not defined  
  
NameError: name 'add_oxt' is not defined  
  
File "add_oxt.py", line 25, in  
  
See log for complete Python traceback.  
  

> preset custom "add oxt"

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

Traceback (most recent call last):  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-packages/chimerax/ui/gui.py", line
1027, in <lambda>  
run(ses, "preset %s%s" % (cat, StringArg.unparse(name.lower()))))  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/core/commands/run.py", line 31, in run  
results = command.run(text, log=log)  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/core/commands/cli.py", line 2805, in run  
result = ci.function(session, **kw_args)  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/preset_mgr/cmd.py", line 49, in preset_cmd  
session.presets.preset_function(cat, matches[0])()  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/preset_mgr/manager.py", line 89, in <lambda>  
name: lambda p=preset: self.execute(p)  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/preset_mgr/manager.py", line 68, in execute  
preset()  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/preset_mgr/manager.py", line 109, in <lambda>  
run=run, ses=self.session: run(ses, "open " + p, log=False)  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/core/commands/run.py", line 31, in run  
results = command.run(text, log=log)  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/core/commands/cli.py", line 2805, in run  
result = ci.function(session, **kw_args)  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/open_command/cmd.py", line 101, in cmd_open  
Command(session, registry=registry).run(provider_cmd_text, log=log)  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/core/commands/cli.py", line 2805, in run  
result = ci.function(session, **kw_args)  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/open_command/cmd.py", line 152, in provider_open  
name or model_name_from_path(fi.file_name)), provider_kw)  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/open_command/cmd.py", line 365, in collated_open  
return func(*func_args, **func_kw)  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/core_formats/__init__.py", line 48, in open  
return open_python_script(session, data, file_name)  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/core/scripting.py", line 82, in open_python_script  
_exec_python(session, code, argv)  
File "/opt/UCSF/ChimeraX/lib/python3.7/site-
packages/chimerax/core/scripting.py", line 59, in _exec_python  
exec(code, sandbox.__dict__)  
File "add_oxt.py", line 49, in <module>  
File "add_oxt.py", line 24, in add_oxt  
AttributeError: 'str' object has no attribute 'chain_id'  
  
AttributeError: 'str' object has no attribute 'chain_id'  
  
File "add_oxt.py", line 24, in add_oxt  
  
See log for complete Python traceback.  
  

> preset custom "add oxt"

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

Added a C-terminal OXT to chain A  
executed add_oxt.py  
Preset implemented in Python; no expansion to individual ChimeraX commands
available.  

> close

> open 3io0 format mmcif fromDatabase pdb

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 atoms

> hide cartoons

> select /A:304@N

1 atom, 1 model selected  

> preset custom "add oxt"

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

Added a C-terminal OXT to chain A  
executed add_oxt.py  
Preset implemented in Python; no expansion to individual ChimeraX commands
available.  

> select /A:304@OXT

1 atom, 1 model selected  

> delete sel

> show cartoons

> hide cartoons

> cofr centerOfView showPivot true

> select /A:303@C

1 atom, 1 model selected  

> show sel cartoons

> select clear

> show cartoons

> hide cartoons

> select /A:304@C

1 atom, 1 model selected  

> preset custom "add oxt"

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

Added a C-terminal OXT to chain A  
executed add_oxt.py  
Preset implemented in Python; no expansion to individual ChimeraX commands
available.  




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        3.5G         50G         99M        8.9G         58G
	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: add_oxt.py

add_oxt.py

Attachments (1)

add_oxt.py (1.8 KB ) - added by Tristan Croll 5 years ago.
Added by email2trac

Download all attachments as: .zip

Change History (7)

by Tristan Croll, 5 years ago

Attachment: add_oxt.py added

Added by email2trac

comment:1 by Eric Pettersen, 5 years ago

Cc: Elaine Meng added
Component: UnassignedStructure Editing
Owner: set to Eric Pettersen
Platform: all
Project: ChimeraX
Status: newaccepted
Summary: ChimeraX bug report submissionRFE: command to add C-terminal oxygens

comment:2 by Eric Pettersen, 5 years ago

Status: acceptedfeedback

So is the idea that you are unwilling to add hydrogens to this model for some reason?

in reply to:  4 comment:3 by Tristan Croll, 5 years ago

Not exactly. The user (Dirk) had already run AddH, but it didn't add 
OXTs because it didn't know which C-termini were real (in an enormous 
model with many chains). In general it wouldn't be a good idea to do a 
blanket "add OXT to all chains", so having a more precise "add OXT to 
*these* chains" would be useful.

On 2020-06-22 17:50, ChimeraX wrote:

comment:4 by Eric Pettersen, 5 years ago

This kind of sounds vaguely like an AddH problem, but I'm still confused as to how AddH wouldn't "know which C-termini were real". Possible scenarios are:

1) SEQRES records (or equivalent) are correct. Actual termini should get OXT.

2) No SEQRES-equivalent information. All termini will be treated as real and get OXT.

3) Incorrect SEQRES info.

a) Completely incorrect and does not match chain sequence. Info will be discarded and work the same as (2)
b) Sequence matches but is incorrect. Only in this case could some real termini not get OXT.

But you don't seem to have scenario 3b since in that case the final residues of the problematic chains would be None and the code you supplied would fail.

So I guess I need clarification about AddH not knowing which C-termini were real.

in reply to:  6 comment:5 by Tristan Croll, 5 years ago

Hmm - actually, sounds like it might be my understanding that’s faulty. The problem is, this isn’t my model (and I’ve never actually seen it) so I can’t say exactly what’s going on. 

He’s happy with the script I sent him, so there’s no urgency. Perhaps this could simply boil down to the existing RFE ticket to allow fine-grained application of AddH to a specific selection of residues. Kill two birds with one stone. ;)
 

 


comment:6 by Eric Pettersen, 5 years ago

Resolution: duplicate
Status: feedbackclosed

Hmm, okay. Restricting AddH to a selection is ticket #2310.

Note: See TracTickets for help on using tickets.