The “LYS” Filter Trap: Select Residues Without Their Extra Nodes

You type LYS into a molecular model’s filter, press Enter, and expect to select five lysine residues. Instead, the selection summary reports 15 nodes. It can look like a mistake—but the filter may be matching names across the molecular hierarchy, including the residues’ backbones and side chains.

This is a common selection snag: a search that looks specific to a modeler may actually match several kinds of nodes. In SAMSON, filtering by a plain text string is based on node names. For a more precise selection, use the Node Specification Language (NSL) to say which node type and property you mean.

From a broad name match to a residue-only selection

In the Document view, enter LYS in the Filter nodes… box and press Enter. This filters by name and selects the matching nodes. Because names of related nodes can also contain “LYS,” the result may include more than the residue nodes themselves.

Instead, enter residue.type LYS and press Enter. The shorter equivalent is r.t LYS. This expression specifies the node category (residue) and its type (LYS), so it selects lysine residues rather than every node whose name happens to contain that text.

Filtering nodes using a name string

Selecting nodes with a Node Specification Language expression

A reliable selection check

  1. Open the Document view. If it is hidden, enable it through Interface > Document view.
  2. Enter the broad name string and press Enter only if you want to search by node names.
  3. For a residue-level selection, replace it with residue.type LYS (or r.t LYS) and press Enter.
  4. Check the selection summary at the bottom of the Document view. You can also inspect selected nodes in the Inspector.

One important distinction: entering text in the Document view’s filter does not select nodes immediately. It filters the displayed nodes; pressing Enter selects the nodes that match.

Use the same selection again

If you repeat a selection often, save the NSL expression as a selection filter. Open Select > Find or press Ctrl/Cmd + F, enter the expression, and click Save. Give the filter a clear name; it will then appear in the selection-filter list. For example, r.t LYS or r.t HIS selects lysine or histidine residues.

For a one-off selection, the Find window is also a place to enter an NSL expression. For a workflow where you need to revisit the same nodes, you can save the selected nodes as a group. Groups reference nodes rather than containing them, so deleted nodes will not be selected when you use the group later.

Keep selection level in mind

NSL filtering and viewport selection solve related but different problems. When selecting by clicking or drawing a rectangle in the viewport, the selection filter controls the node level. For example, setting it to Residues makes a click on an atom select its residue. In contrast, an NSL expression such as r.t LYS specifies the target directly.

When a selection is part of a repeated design task, Quick Groups can help you switch between remembered selections using number keys. For example, assign a ligand and receptor to separate groups, then switch between them as you work. This keeps the current selection easy to change without repeating the search.

The practical rule is simple: use a name string for a quick name-based search; use an NSL expression when the target must be a specific node type or property. Confirm the result in the selection summary before applying edits or other actions.

For more selection methods and examples, see the SAMSON selection guide.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.

Comments are closed.