Opened 6 years ago
Last modified 5 years ago
#2919 feedback defect
"sequence chain" fails after chain lengthened
| Reported by: | Owned by: | Eric Pettersen | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Sequence | Version: | |
| Keywords: | Cc: | Tristan Croll | |
| Blocked By: | Blocking: | ||
| Notify when closed: | Platform: | all | |
| Project: | ChimeraX |
Description
The following bug report has been submitted:
Platform: Linux-3.10.0-1062.4.1.el7.x86_64-x86_64-with-centos-7.7.1908-Core
ChimeraX Version: 0.91 (2019-12-17)
Description
I added a few aminoacids whist opening isolde. The sequence viewer was open by the time I added the amino acids. Then I closed the sequece viewer and tried to open the sequence again. The error message is attached. I couldn't save the ChimeraX session neither after that. Could you please have a look?
Log:
UCSF ChimeraX version: 0.91 (2019-12-17)
© 2016-2019 Regents of the University of California. All rights reserved.
How to cite UCSF ChimeraX
> select up
Nothing selected
> select up
Nothing selected
> open
> /nfs4/suffolk/WorkComplexID/ym337/Para_SC_Biochem_16Inga19/PostProcess/job879/isolde/isolde_N_module_session_4.cxs
> format session
Summary of feedback from opening
/nfs4/suffolk/WorkComplexID/ym337/Para_SC_Biochem_16Inga19/PostProcess/job879/isolde/isolde_N_module_session_4.cxs
---
warning | restore_snapshot for "RotamerRestraintMgr" returned None
opened ChimeraX session
> sequence chain /N
Alignment identifier is 1.1.N
Traceback (most recent call last):
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/core/toolshed/info.py", line 454, in run_provider
return api._api_caller.run_provider(api, session, name, mgr, **kw)
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/core/toolshed/__init__.py", line 1632, in run_provider
return cls._get_func(api, "run_provider")(session, name, mgr, **kw)
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seq-view/__init__.py", line 40, in run_provider
return _start_seq_viewer(session, "Sequence Viewer", alignment)
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seq-view/tool.py", line 684, in _start_seq_viewer
return SequenceViewer(session, tool_name, alignment)
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seq-view/tool.py", line 55, in __init__
self._finalize_init(alignment)
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seq-view/tool.py", line 174, in _finalize_init
self.seq_canvas = SeqCanvas(parent, self, self.alignment)
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seq-view/seq_canvas.py", line 184, in __init__
self.layout_alignment()
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seq-view/seq_canvas.py", line 780, in layout_alignment
self.label_width, self.font_pixels, self.numbering_widths, self.letter_gaps())
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seq-view/seq_canvas.py", line 1602, in __init__
self.layout_lines(alignment.seqs, self.normal_label_color)
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seq-view/seq_canvas.py", line 2244, in layout_lines
self._layout_line(line, label_color, bli, end)
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seq-view/seq_canvas.py", line 2237, in _layout_line
numberings[numbering] = self._make_numbering(line, numbering)
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seq-view/seq_canvas.py", line 2329, in _make_numbering
x, y = self.item_aux_info[line][-1]
IndexError: list index out of range
Traceback (most recent call last):
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/core/toolshed/info.py", line 454, in run_provider
return api._api_caller.run_provider(api, session, name, mgr, **kw)
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/core/toolshed/__init__.py", line 1632, in run_provider
return cls._get_func(api, "run_provider")(session, name, mgr, **kw)
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seq-view/__init__.py", line 40, in run_provider
return _start_seq_viewer(session, "Sequence Viewer", alignment)
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seq-view/tool.py", line 684, in _start_seq_viewer
return SequenceViewer(session, tool_name, alignment)
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seq-view/tool.py", line 55, in __init__
self._finalize_init(alignment)
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seq-view/tool.py", line 174, in _finalize_init
self.seq_canvas = SeqCanvas(parent, self, self.alignment)
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seq-view/seq_canvas.py", line 184, in __init__
self.layout_alignment()
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seq-view/seq_canvas.py", line 780, in layout_alignment
self.label_width, self.font_pixels, self.numbering_widths, self.letter_gaps())
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seq-view/seq_canvas.py", line 1602, in __init__
self.layout_lines(alignment.seqs, self.normal_label_color)
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seq-view/seq_canvas.py", line 2244, in layout_lines
self._layout_line(line, label_color, bli, end)
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seq-view/seq_canvas.py", line 2237, in _layout_line
numberings[numbering] = self._make_numbering(line, numbering)
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seq-view/seq_canvas.py", line 2329, in _make_numbering
x, y = self.item_aux_info[line][-1]
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/cmd_line/tool.py", line 258, in execute
cmd.run(cmd_text)
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/core/commands/cli.py", line 2837, in run
result = ci.function(session, **kw_args)
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seqalign/cmd.py", line 141, in seqalign_chain
auto_associate=None, intrinsic=True)
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seqalign/manager.py", line 244, in new_alignment
alignment=alignment)
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/core/toolshed/info.py", line 459, in run_provider
"run_provider() failed in bundle %s:\n%s" % (self.name, str(e)))
chimerax.core.toolshed.ToolshedError: run_provider() failed in bundle
ChimeraX-SeqView:
list index out of range
chimerax.core.toolshed.ToolshedError: run_provider() failed in bundle
ChimeraX-SeqView:
list index out of range
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/core/toolshed/info.py", line 459, in run_provider
"run_provider() failed in bundle %s:\n%s" % (self.name, str(e)))
See log for complete Python traceback.
> sequence chain /A
Alignment identifier is 1.1.A
> sequence chain /N
Destroying pre-existing alignment with identifier 1.1.N
Traceback (most recent call last):
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/cmd_line/tool.py", line 258, in execute
cmd.run(cmd_text)
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/core/commands/cli.py", line 2837, in run
result = ci.function(session, **kw_args)
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seqalign/cmd.py", line 141, in seqalign_chain
auto_associate=None, intrinsic=True)
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seqalign/manager.py", line 220, in new_alignment
self.destroy_alignment(self._alignments[identify_as])
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seqalign/manager.py", line 109, in destroy_alignment
alignment._destroy()
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seqalign/alignment.py", line 501, in _destroy
self._notify_observers("destroyed", None)
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seqalign/alignment.py", line 541, in _notify_observers
recipient.alignment_notification(note_name, note_data)
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seq-view/tool.py", line 459, in alignment_notification
self.delete()
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seq-view/tool.py", line 489, in delete
self.region_browser.destroy()
AttributeError: 'SequenceViewer' object has no attribute 'region_browser'
AttributeError: 'SequenceViewer' object has no attribute 'region_browser'
File "/usr/mbu/software/chimerax/chimerax-2019.12.17/lib/python3.7/site-
packages/chimerax/seq-view/tool.py", line 489, in delete
self.region_browser.destroy()
See log for complete Python traceback.
OpenGL version: 3.3.0 NVIDIA 418.87.01
OpenGL renderer: GeForce GTX 1080/PCIe/SSE2
OpenGL vendor: NVIDIA Corporation
File attachment: 89422800_196038681466979_538118797567983616_n.jpg
Attachments (2)
Change History (21)
by , 6 years ago
| Attachment: | 89422800_196038681466979_538118797567983616_n.jpg added |
|---|
comment:1 by , 6 years ago
| Component: | Unassigned → Sequence |
|---|---|
| Owner: | set to |
| Platform: | → all |
| Project: | → ChimeraX |
| Status: | new → accepted |
| Summary: | ChimeraX bug report submission → "sequence chain" fails after chain lengthened |
comment:2 by , 6 years ago
| Cc: | added |
|---|
I've been trying to reproduce this on my Mac (using ChimeraX 0.92 release version) and so far failing. Will see if I have better luck using Yaikhomba's own model.
comment:3 by , 6 years ago
OK, I can reproduce. The bug arises specifically when you add a residue to the N-terminus of an existing chain (see below). The code for add_amino_acid_residue() is at https://github.com/tristanic/isolde/blob/977cf367d0e036305e1880f73466f01d7763c3b2/isolde/src/atomic/building/build_utils.py#L110.
from chimerax.core.commands import open as cxopen
m = cxopen.open(session, '3io0')[0]
from chimerax.isolde.atomic.building.build_utils import add_amino_acid_residue
add_amino_acid_residue(m, 'ALA', next_res=m.residues[0])
Out[4]: <chimerax.atomic.molobject.Residue at 0x1253fa8c0>
from chimerax.core.commands import run
run(session, 'sequence chain /A')
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-6-f4f907142508> in <module>
----> 1 run(session, 'sequence chain /A')
/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/core/commands/run.py in run(session, text, log, downgrade_errors)
29 command = Command(session)
30 try:
---> 31 results = command.run(text, log=log)
32 except UserError as err:
33 if downgrade_errors:
/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/core/commands/cli.py in run(self, text, log, log_only, _used_aliases)
2843 if not isinstance(ci.function, Alias):
2844 if not log_only:
-> 2845 result = ci.function(session, **kw_args)
2846 results.append(result)
2847 else:
/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/seqalign/cmd.py in seqalign_chain(session, chains)
139 ident = ".".join([str(part) for part in chain.structure.id]) + "." + chain.chain_id
140 alignment = session.alignments.new_alignment([chain], ident, seq_viewer="sv",
--> 141 auto_associate=None, intrinsic=True)
142 else:
143 # all chains have to have the same sequence, and they will all be associated with
/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/seqalign/manager.py in new_alignment(self, seqs, identify_as, attrs, markups, auto_destroy, align_viewer, seq_viewer, auto_associate, name, intrinsic)
242 if viewer_text:
243 self._installed_viewers[viewer_name].run_provider(self.session, viewer_name, self,
--> 244 alignment=alignment)
245 self.triggers.activate_trigger("new alignment", alignment)
246 return alignment
/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/core/toolshed/info.py in run_provider(self, session, name, mgr, **kw)
451 """Supported API. Called by manager to invoke bundle provider."""
452 api = self._get_api(session.logger)
--> 453 return api._api_caller.run_provider(api, session, name, mgr, **kw)
454
455 def finish(self, session):
/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/core/toolshed/__init__.py in run_provider(cls, api, session, name, mgr, **kw)
1630 @classmethod
1631 def run_provider(cls, api, session, name, mgr, **kw):
-> 1632 return cls._get_func(api, "run_provider")(session, name, mgr, **kw)
1633
1634 @classmethod
/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/seq-view/__init__.py in run_provider(session, name, manager, alignment)
38 """Register sequence viewer with alignments manager"""
39 from .tool import _start_seq_viewer
---> 40 return _start_seq_viewer(session, "Sequence Viewer", alignment)
41
42
/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/seq-view/tool.py in _start_seq_viewer(session, tool_name, alignment)
691
692 def _start_seq_viewer(session, tool_name, alignment):
--> 693 return SequenceViewer(session, tool_name, alignment)
694
/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/seq-view/tool.py in __init__(self, session, tool_name, alignment)
53 if alignment is None:
54 return
---> 55 self._finalize_init(alignment)
56
57 def _finalize_init(self, alignment):
/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/seq-view/tool.py in _finalize_init(self, alignment)
172 """
173 from .seq_canvas import SeqCanvas
--> 174 self.seq_canvas = SeqCanvas(parent, self, self.alignment)
175 if self.alignment.associations:
176 # There are pre-existing associations, show them
/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/seq-view/seq_canvas.py in __init__(self, parent, sv, alignment)
182 #self._vdivider.hide()
183 self.main_view.show()
--> 184 self.layout_alignment()
185 """TODO
186 self.mainCanvas.grid(row=1, column=2, sticky='nsew')
/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/seq-view/seq_canvas.py in layout_alignment(self)
778 {}, lambda *args, **kw: self.sv.status(secondary=True, *args, **kw),
779 self.show_ruler, None, self.show_numberings, self.sv.settings,
--> 780 self.label_width, self.font_pixels, self.numbering_widths, self.letter_gaps())
781
782 def letter_gaps(self):
/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/seq-view/seq_canvas.py in __init__(self, label_scene, main_scene, prev_block, font, emphasis_font, seq_offset, headers, alignment, line_width, label_bindings, status_func, show_ruler, tree_balloon, show_numberings, settings, label_width, font_pixels, numbering_widths, letter_gaps)
1600 self.layout_ruler()
1601 self.layout_lines(headers, self.header_label_color)
-> 1602 self.layout_lines(alignment.seqs, self.normal_label_color)
1603
1604 if seq_offset + line_width >= len(alignment.seqs[0]):
/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/seq-view/seq_canvas.py in layout_lines(self, lines, label_color)
2242 bli = self.base_layout_info()
2243 for line in lines:
-> 2244 self._layout_line(line, label_color, bli, end)
2245
2246 """TODO
/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/seq-view/seq_canvas.py in _layout_line(self, line, label_color, base_layout_info, end, line_index, adding)
2235 for numbering in range(2):
2236 if self.show_numberings[numbering]:
-> 2237 numberings[numbering] = self._make_numbering(line, numbering)
2238 self.numbering_texts[line] = numberings
2239
/Applications/ChimeraX.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/seq-view/seq_canvas.py in _make_numbering(self, line, numbering)
2327 fmt = "%d " if numbering == 0 else " %d"
2328 item = self.main_scene.addSimpleText(fmt % n, font=self.font)
-> 2329 x, y = self.item_aux_info[line][-1]
2330 rect = item.sceneBoundingRect()
2331 if numbering == 0:
IndexError: list index out of range
comment:4 by , 6 years ago
Some more digging into this: the deeper (not necessarily the deep*est*) cause of the traceback is that for the affected chains, chain.characters now returns an empty string. This also appears to be messing up saving/loading in mmCIF format: all such chains get the same entity_id, and a bunch of residues simply get skipped when opening the file.
comment:5 by , 6 years ago
Surprisingly, chain.ungapped() still returns the correct sequence. If I do chain.characters = chain.ungapped()` then I can successfully save what looks to be a fully-valid mmCIF. The sequence viewer also no longer crashes, but it's still a bit borked for these chains: the residue letters aren't linked to the residues in the model, and for some reason the numbering up the left is reversed. But, if I save and reload the mmCIF then it looks to be back to fully operational.
comment:6 by , 6 years ago
Hi Yaikhomba, This looks to be back in working order. You'll see from the emails on the ChimeraX bug tracker that this is a bona fide bug in ChimeraX - triggered when you add a residue to the N-terminus of a chain. I'm afraid at this stage the best thing for you to do will be to start a new session with the attached mmCIF (compressed with 7-zip) - I know that this may be a bit of a pain given all your restraints, but I don't see there's much that can be done about it. The 'isolde restrain torsions' command has to be done chain-by-chain when restraining to a template. That is, each call should specify residues from exactly one chain for target, and one chain for template. For 'isolde restrain distances' you need to make sure that the order of chains in the target list is the same as the order in the template list, otherwise you'll get strange results. Let me know how you get on. Best regards, Tristan On 2020-03-13 17:17, ChimeraX wrote:
follow-up: 6 comment:7 by , 6 years ago
Argh! Responded to the wrong email. Eric, that attachment is an unpublished model belonging to Yaikhomba, so would you mind deleting it when you see this? Doesn't look like I have the permissions. On 2020-03-13 17:25, ChimeraX wrote:
comment:8 by , 6 years ago
Okay, deleted the attachment. The code to update sequences/chains in the face of residue additions is (perhaps obviously) untested since ChimeraX itself has no capability yet to add residues to existing chains. Thanks for the detective work. I will look into fixing it soon.
--Eric
follow-up: 7 comment:9 by , 6 years ago
Would be good to know if there’s a short term workaround - e.g. would loading the full sequences of all chains from FASTA prior to editing help?
follow-up: 9 comment:10 by , 6 years ago
No idea what a workaround might be since I haven't reproduced the problem!
I will be working on it today. Wish me luck. :-)
comment:12 by , 6 years ago
I've fixed one problem. The sequence viewer now shows the sequence, but with no associations, as per your "a bit borked" comment above. Pushing out this fix and will work on tracking that one down...
comment:13 by , 6 years ago
Okay, that's fixed too. Fixes in tomorrow's build. Unfortunately, ISOLDE doesn't yet work with 0.93, right?
You may be able to workaround it with, after you prepend a residue:
chain.bulk_set(chain.residues[int(len(chain.ungapped())):], chain.ungapped())
Of course, you would only want to do this for versions of ChimeraX that have the bug, so you might want to only execute that if:
len(chain.characters) == 0
comment:14 by , 6 years ago
| Resolution: | → fixed |
|---|---|
| Status: | accepted → closed |
comment:15 by , 6 years ago
Thanks! Yep - not quite caught up to 0.93 yet. Want to get an “official” release to match the 0.92 release first. Early next week, I think.
follow-up: 15 comment:16 by , 6 years ago
Just trying this out in ChimeraX 0.93. I'm afraid it still fails if the added residue is inside a chain break (same symptoms: chain.characters returns an empty string). On 2020-03-13 21:17, ChimeraX wrote:
follow-up: 16 comment:17 by , 6 years ago
| Resolution: | fixed |
|---|---|
| Status: | closed → reopened |
Well, you did say "the bug arises specifically when you add a residue to the N-terminus of an existing chain" so that's what I tested. I will investigate the inside-a-chain-break case as time permits.
comment:18 by , 6 years ago
I know. Sorry for not testing that scenario previously. On 2020-04-03 16:37, ChimeraX wrote:
follow-up: 18 comment:19 by , 5 years ago
| Status: | reopened → feedback |
|---|
Hi Tristan,
I cannot replicate the add-residue-into-interior-gap being a problem (anymore). I've attached to this ticket the script I used to add a residue to the interior gap of 3fhr. I had to close and reopen the sequence viewer, but the reopened sequence viewer showed he new residue (and the rest of the sequence normally. Let me know if you can still replicate it, and if so give me a recipe.
--Eric
Added by email2trac