When “LYS” Selects Too Much: A More Precise Molecular Selection Workflow

A familiar modeling frustration: you search for a residue name, select the results, and discover that you have selected more than the residues you intended. In a molecular document, a name-based filter can match multiple levels of the structure hierarchy—not just the residue, but also named backbone and side-chain nodes. The result can look plausible in the viewport while quietly including extra nodes.

Here’s a practical way to make selections more precise in SAMSON: use the Document view to find and inspect nodes, switch from name matching to a Node Specification Language (NSL) expression when needed, and save useful expressions as reusable selection filters.

Start with the Document view

The Document view displays the active document as a hierarchy. If it is hidden, enable it through Interface > Document view. Expand the relevant levels using the + controls, then click a node to select it. This is useful when you want to understand where a selection sits in the structure—for example, whether you are looking at a residue, an atom, or another node.

You can also use the Filter nodes… box to find nodes by name. Enter a string and press Enter to select the matching nodes. The distinction matters: typing filters the visible nodes; pressing Enter performs the selection.

Filtering nodes in the Document view

Why a name search can select extra nodes

Suppose you enter LYS to select lysine residues. A string filter searches node names, so it can also match names of related nodes whose names contain “LYS.” In the documented example, the structure contains five LYS residues, but the name filter selects 15 nodes because backbone and side-chain nodes are included too.

This is not necessarily a problem if you want all those related nodes. But if the intended selection is specifically the residues, define the target by its property rather than by a substring in its name. In the filter box, use the NSL expression residue.type LYS, or its shorter form, r.t LYS, then press Enter.

Selecting LYS residues using a Node Specification Language expression

A useful habit is to check the selection summary after filtering. If the count seems unexpectedly high, inspect the selection in the Document view or Inspector and refine the query. That quick check can catch an overly broad selection before you use it for editing, measuring, visualization, or simulation preparation.

Save queries you expect to use again

If you often need the same selection, save the NSL expression as a custom selection filter. Open the Find window using Select > Find or Ctrl/Cmd + F, enter the expression, and click Save. Give the filter a descriptive name, such as “LYS and HIS residues.” For example, r.t LYS or r.t HIS selects residues whose type is LYS or HIS.

Saving an NSL expression as a custom selection filter

Custom filters appear in the selection-filter list, where you can select them again. To remove a custom filter, make it active and right-click the list. The reset option removes all filters you added, so use it only when you mean to clear your custom filters.

A small workflow that prevents selection surprises

  1. Search by name when you need a quick starting point.
  2. Check the selection count and hierarchy.
  3. Use an NSL property expression when the name search matches too broadly.
  4. Save recurring expressions as named filters.

This approach keeps selection intent explicit: first locate the structure, then narrow the query to the node type and property you actually mean. For more details on selection commands, viewport selection, filters, groups, and Quick Groups, see the SAMSON selection documentation.

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

Comments are closed.