Skip to content

Commit dedcd4e

Browse files
committed
Merge branch 'develop' of github.com:RBVI/ChimeraX into develop
2 parents d7a9e1a + 6c07b35 commit dedcd4e

20 files changed

Lines changed: 110 additions & 41 deletions

File tree

docs/user/commands/cartoon.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ <h3 class="usage"><a href="usageconventions.html">Usage</a>:
304304
<a href="#hmode"><b>cylinder</b> mode</a>,
305305
a constant <b>radius</b> <i>r</i> can be specified, otherwise
306306
(<b>auto</b>, default) a radius will be determined separately for each helix
307-
according to the average distance of the &alpha;-carbons to the tube midline,
307+
according to the average distance of the &alpha;-carbons to the midline,
308308
capped at a maximum of 2.5 &Aring;.
309309
Where a displayed &alpha;-carbon is offset from the tube surface,
310310
a <a href="#tether">tether</a> will be drawn.

docs/user/commands/matchmaker.html

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,19 @@ <h3>Options</h3>
228228
</td></tr></tbody></table>
229229
</blockquote>
230230
</blockquote>
231+
<blockquote>
232+
<a name="rmsd"><b>rmsd</b> &nbsp;true&nbsp;|&nbsp;<b>false</b></a>
233+
<br>
234+
With <a href="#show"><b>showAlignment</b></a> <b>false</b>, the
235+
<a href="../tools/sequenceviewer.html"><b>Sequence Viewer</b></a> window
236+
is not shown, and the
237+
<a href="../tools/sequenceviewer.html#headers">alignment-header attributes</a>
238+
<b>seq_rmsd</b> and <b>seq_conservation</b> are not automatically assigned.
239+
Specifying <b>rmsd true</b> forces calculating and assigning these attributes
240+
even though the pairwise sequence alignment is not displayed.
241+
If <a href="#show"><b>showAlignment</b></a> is <b>true</b>, the <b>rmsd</b>
242+
option is unnecessary and ignored.
243+
</blockquote>
231244
<blockquote>
232245
<a name="cutoffDistance"><b>cutoffDistance</b>
233246
&nbsp;<i>cutoff</i>&nbsp;|&nbsp;none</a>
@@ -459,6 +472,6 @@ <h3>Sequence-Alignment Scoring Options</h3>
459472

460473
<hr>
461474
<address>UCSF Resource for Biocomputing, Visualization, and Informatics /
462-
March 2025</address>
475+
April 2026</address>
463476

464-
</body></html>
477+
</body></html>

src/bundles/atomic/atomic_cpp/molc.cpp

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4156,6 +4156,47 @@ extern "C" EXPORT void structure_combine(void *combination, void *s, void *pos,
41564156
}
41574157
}
41584158

4159+
extern "C" EXPORT void *structure_break_triangle_waters(void *mol)
4160+
{
4161+
Structure *m = static_cast<Structure *>(mol);
4162+
try {
4163+
for (auto r: m->residues()) {
4164+
auto& atoms = r->atoms();
4165+
if (atoms.size() != 3)
4166+
continue;
4167+
Atom* o = nullptr;
4168+
Atom* h1 = nullptr;
4169+
Atom* h2 = nullptr;
4170+
for (auto a: atoms) {
4171+
if (a->element() == Element::O) {
4172+
if (o == nullptr)
4173+
o = a;
4174+
else
4175+
break;
4176+
} else if (a->element() == Element::H) {
4177+
if (h1 == nullptr)
4178+
h1 = a;
4179+
else if (h2 == nullptr)
4180+
h2 = a;
4181+
else
4182+
break;
4183+
} else
4184+
break;
4185+
}
4186+
if (o != nullptr && h1 != nullptr && h2 != nullptr) {
4187+
for (auto& b: h1->bonds())
4188+
if (b->other_atom(h1) == h2) {
4189+
m->delete_bond(b);
4190+
break;
4191+
}
4192+
}
4193+
}
4194+
} catch (...) {
4195+
molc_error();
4196+
}
4197+
return nullptr;
4198+
}
4199+
41594200
extern "C" EXPORT void *structure_copy(void *mol)
41604201
{
41614202
Structure *m = static_cast<Structure *>(mol);

src/bundles/atomic/bundle_info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!-- Edit bundle_info.xml.in, not bundle_info.xml; then run make_selectors.py -->
2-
<BundleInfo name="ChimeraX-Atomic" version="1.66"
2+
<BundleInfo name="ChimeraX-Atomic" version="1.67"
33
package="chimerax.atomic"
44
purePython="false"
55
customInit="true"

src/bundles/atomic/bundle_info.xml.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!-- Edit bundle_info.xml.in, not bundle_info.xml; then run make_selectors.py -->
2-
<BundleInfo name="ChimeraX-Atomic" version="1.66"
2+
<BundleInfo name="ChimeraX-Atomic" version="1.67"
33
package="chimerax.atomic"
44
purePython="false"
55
customInit="true"

src/bundles/atomic/src/molobject.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,6 +1737,11 @@ def bonded_groups(self, *, consider_missing_structure=True):
17371737
import numpy
17381738
return [Atoms(numpy.array(x, numpy.uintp)) for x in f(self._c_pointer, consider_missing_structure)]
17391739

1740+
def break_triangle_waters(self):
1741+
'''For waters with an H-H bond, break that bond'''
1742+
f = c_function('structure_break_triangle_waters', args = (ctypes.c_void_p,), ret = ctypes.c_void_p)
1743+
p = f(self._c_pointer)
1744+
17401745
def chain_trace_atoms(self):
17411746
'''
17421747
Find pairs of atoms that should be connected in a chain trace.

src/bundles/atomic/src/structure.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class Structure(Model, StructureData):
6161
'ribbon_tether_opacity', 'ribbon_tether_scale', 'worm_radii'])
6262

6363
def __init__(self, session, *, name = "structure", c_pointer = None, restore_data = None,
64-
auto_style = True, log_info = True):
64+
auto_style = True, log_info = True, break_triangle_waters = True):
6565
from .molarray import Residues
6666
from numpy import array
6767
from .ribbon import XSectionManager
@@ -83,6 +83,7 @@ def __init__(self, session, *, name = "structure", c_pointer = None, restore_dat
8383
Model.__init__(self, name, session)
8484
self._auto_style = auto_style
8585
self._log_info = log_info
86+
self._break_triangle_waters = break_triangle_waters
8687

8788
# for now, restore attrs to default initial values even for sessions...
8889
self._atoms_drawing = None
@@ -202,6 +203,8 @@ def added_to_session(self, session):
202203
# but that is only certain to be correct if this is the first time the structure
203204
# has been added to the session, so always set it. [#18427]
204205
self._cpp_notify_position(self.scene_position)
206+
if self._break_triangle_waters:
207+
self.break_triangle_waters()
205208
if self._auto_style:
206209
self.apply_auto_styling(set_lighting = self._is_only_model())
207210
self._start_change_tracking(session.change_tracker)

src/bundles/match_maker/bundle_info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<BundleInfo name="ChimeraX-MatchMaker" version="2.2.2"
1+
<BundleInfo name="ChimeraX-MatchMaker" version="2.3"
22
package="chimerax.match_maker"
33
minSessionVersion="1" maxSessionVersion="1">
44

src/bundles/match_maker/src/match.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def ss_let(r):
194194

195195
def match(session, chain_pairing, match_items, matrix, alg, gap_open, gap_extend, *, cutoff_distance=None,
196196
show_alignment=defaults['show_alignment'], align=align, domain_residues=(None, None), bring=None,
197-
verbose=defaults['verbose_logging'], always_raise_errors=False, report_matrix=False,
197+
verbose=defaults['verbose_logging'], always_raise_errors=False, report_matrix=False, rmsd=False,
198198
log_parameters=defaults['log_parameters'],
199199
**align_kw):
200200
"""Superimpose structures based on sequence alignment
@@ -554,7 +554,7 @@ def match(session, chain_pairing, match_items, matrix, alg, gap_open, gap_extend
554554
s1.name, s1.structure.id_string, s2.name,
555555
s2.structure.id_string, score), log=(verbose is not None))
556556
skip = set()
557-
if show_alignment:
557+
if show_alignment or rmsd:
558558
for s in [s1,s2]:
559559
if hasattr(s, '_dm_rebuild_info'):
560560
residues = s.residues
@@ -578,7 +578,7 @@ def match(session, chain_pairing, match_items, matrix, alg, gap_open, gap_extend
578578
s.bulk_set(residues, characters)
579579
with show_context():
580580
alignment = session.alignments.new_alignment([s1,s2], None, auto_associate=None,
581-
name="MatchMaker alignment")
581+
name="MatchMaker alignment", viewer=show_alignment)
582582
alignment.auto_associate = True
583583
for hdr in alignment.headers:
584584
hdr.shown = hdr.ident == "rmsd"
@@ -690,7 +690,7 @@ def cmd_match(session, match_atoms, to=None, pairing=defaults["chain_pairing"],
690690
hgap=defaults["helix_open"], sgap=defaults["strand_open"], ogap=defaults["other_open"],
691691
cutoff_distance=defaults["iter_cutoff"], gap_extend=defaults["gap_extend"],
692692
show_alignment=defaults['show_alignment'], compute_s_s=defaults["compute_ss"],
693-
keep_computed_s_s=defaults['overwrite_ss'], report_matrix=False,
693+
keep_computed_s_s=defaults['overwrite_ss'], report_matrix=False, rmsd=False,
694694
log_parameters=defaults['log_parameters'],
695695
mat_h_h=default_ss_matrix[('H', 'H')],
696696
mat_s_s=default_ss_matrix[('S', 'S')],
@@ -775,7 +775,7 @@ def cmd_match(session, match_atoms, to=None, pairing=defaults["chain_pairing"],
775775
ss_matrix[('H', 'O')] = ss_matrix[('O', 'H')] = float(mat_h_o)
776776
ss_matrix[('S', 'O')] = ss_matrix[('O', 'S')] = float(mat_s_o)
777777
ret_vals = match(session, pairing, match_items, matrix, alg, gap_open, gap_extend,
778-
ss_fraction=ss_fraction, ss_matrix=ss_matrix,
778+
ss_fraction=ss_fraction, ss_matrix=ss_matrix, rmsd=rmsd,
779779
cutoff_distance=cutoff_distance, show_alignment=show_alignment, bring=bring,
780780
domain_residues=(ref_atoms.residues.unique(), match_atoms.residues.unique()),
781781
gap_open_helix=hgap, gap_open_strand=sgap, gap_open_other=ogap, report_matrix=report_matrix,
@@ -856,7 +856,7 @@ def register_command(logger):
856856
('bring', TopModelsArg), ('show_alignment', BoolArg), ('compute_s_s', BoolArg),
857857
('mat_h_h', FloatArg), ('mat_s_s', FloatArg), ('mat_o_o', FloatArg), ('mat_h_s', FloatArg),
858858
('mat_h_o', FloatArg), ('mat_s_o', FloatArg), ('keep_computed_s_s', BoolArg),
859-
('report_matrix', BoolArg), ('log_parameters', BoolArg)],
859+
('report_matrix', BoolArg), ('rmsd', BoolArg), ('log_parameters', BoolArg)],
860860
synopsis = 'Align atomic structures using sequence alignment'
861861
)
862862
register('matchmaker', desc, cmd_match, logger=logger)

src/bundles/md_crds/src/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def open_args(self):
5656
from chimerax.core.commands import BoolArg, OpenFileNameArg, PositiveIntArg
5757
return {
5858
'auto_style': BoolArg,
59+
'break_triangle_waters': BoolArg,
5960
'coords': OpenFileNameArg,
6061
'end': PositiveIntArg,
6162
'omit': omit_arg,
@@ -71,7 +72,7 @@ def open(self, session, data, file_name, **kw):
7172
@property
7273
def open_args(self):
7374
from chimerax.core.commands import BoolArg
74-
return { 'auto_style': BoolArg }
75+
return { 'auto_style': BoolArg, 'break_triangle_waters': BoolArg }
7576
else:
7677
class MDInfo(OpenerInfo):
7778
def open(self, session, data, file_name, *, structure_model=None,

0 commit comments

Comments
 (0)