Selection syntaxes#
MolSysMT selections identify atoms or higher-level elements with either 0-based indices or a query string. The native syntax uses catalog attribute names, such as atom_name == "CA", group_name in ["ALA", "GLY"], or molecule_type == "water". Logical operators can combine conditions, and spatial or bonding clauses add structural constraints.
Syntax support is directional. The syntax argument accepts MolSysMT and MDTraj queries for inputs convertible to their required topology, and MDAnalysis queries for inputs convertible to MDAnalysis.Universe. The to_syntax argument translates indices to MDTraj or NGLView; it does not imply that MolSysMT can parse those same syntaxes. msm.supported.syntaxes() reports the executable matrix for the running version. Without to_syntax, select() returns 0-based positional indices at the requested element level.
Explicit indices must be non-negative and smaller than the corresponding element count. Boolean masks must contain one entry per element. Invalid ranges and parser failures raise the catalog-backed molsysmt.ArgumentError; the original parser exception remains attached as its cause for diagnostics. This structure-index contract is shared by get(), convert(), extract(), remove(), set(), view(), info(), and Iterator.