Opened 6 years ago
Closed 4 years ago
#2236 closed enhancement (fixed)
Port Chimera's copy/combine
| Reported by: | Owned by: | Eric Pettersen | |
|---|---|---|---|
| Priority: | moderate | Milestone: | |
| Component: | Structure Editing | Version: | |
| Keywords: | Cc: | Tristan Croll, phil.cruz@…, zhangrui@… | |
| Blocked By: | Blocking: | ||
| Notify when closed: | Platform: | all | |
| Project: | ChimeraX |
Description
As per summary
Change History (10)
comment:1 by , 6 years ago
| Cc: | added |
|---|
comment:2 by , 6 years ago
Note that various metadata should be maintained when editing. For example, if a whole chain is copied and its sequence is authoritative (ie., chain.from_seqres is True), then the sequence and the fact that it is authoritative should be copied too. For residues, there is a mmcif_chain_id attribute that should be set/cleared as appropriate. There are probably other examples.
follow-ups: 4 9 comment:4 by , 6 years ago
Making some improvements to my implementation of this (namely making sure that fragments internal to a chain get inserted in the right place rather than simply appended to the end of the residue list). One thing that might be worth making happen automagically: if I insert a fragment into a chain break but don't connect it at either end (that is, effectively creating two new smaller chain breaks), then the missing-structure pseudobonds don't update on their own. Alternatively, if pdb_connect::find_missing_structure_bonds() were exposed to the Python layer I could just have my method clear all the existing missing-structure pseudobonds and call that. On 2020-04-15 16:55, ChimeraX wrote:
follow-up: 5 comment:5 by , 6 years ago
Went ahead and added some logic to my code to update the
missing-structure pseudobonds (for protein, at least... will extend to
nucleic acids later). By the way, I *love* the new presets feature - a
great way to put in quick little snippets of test code when building a
new method! The below test seems to be working fine, with one caveat: it
still messes up the sequence viewer a bit. Doesn't crash it, but the
deleted residues appear as missing and their replacements appear as a
sequence appended to the end of the chain (despite the fact that they're
inserted in the right place using the `precedes` argument of
`new_residue()`).
{{{
from chimerax.core.commands import open as cxopen
mlist = cxopen.open(session, '1pmx')[0].child_models()
m0 = mlist[0]
m1 = mlist[1]
m2 = mlist[2]
m3 = mlist[3]
m1.display=False
m3.display=False
session.models.close(mlist[4:])
m0.residues[10:25].delete()
m2.residues[26:43].delete()
from chimerax.isolde.atomic.building.merge import merge_fragment
merge_fragment(m0, m1.residues[10:25], anchor_n = m0.residues[9],
anchor_c=m0.residues[10])
merge_fragment(m2, m3.residues[27:42], update_style=False)
}}}
Seems to be working nicely, with the caveat that it still messes up the
sequence viewer a bit. Doesn't crash it
On 2020-04-20 18:34, ChimeraX wrote:
comment:6 by , 6 years ago
If the other scenarios correctly update the missing-structure pseudobonds, it would be disappointing (and mildly useless) if the inserted-but-disconnected fragment scenario didn't. May take me a few days to get to it.
Glad you're liking the sneaky use of presets. :-)
Not shocked the sequence viewer got discombobulated, but nonetheless it shouldn't. Will open a ticket.
--Eric
comment:7 by , 5 years ago
| Cc: | added |
|---|
comment:8 by , 5 years ago
| Cc: | added |
|---|
comment:9 by , 4 years ago
Replying to Tristan Croll:
Making some improvements to my implementation of this (namely making sure that fragments internal to a chain get inserted in the right place rather than simply appended to the end of the residue list). One thing that might be worth making happen automagically: if I insert a fragment into a chain break but don't connect it at either end (that is, effectively creating two new smaller chain breaks), then the missing-structure pseudobonds don't update on their own. Alternatively, if pdb_connect::find_missing_structure_bonds() were exposed to the Python layer I could just have my method clear all the existing missing-structure pseudobonds and call that. On 2020-04-15 16:55, ChimeraX wrote:
Tristan, this is a port of Chimera's "copy/combine" functionality, for copying or combining entire structure models -- so not really a replacement for "Isolde merge". Though I suppose you can sort of fake it by deleting large parts of one structure before the combine, with probably mixed results.
comment:10 by , 4 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
'combine' command available in tomorrow's build.
Adding myself to CC - this should be really useful for ISOLDE.