A selection that looks right at first glance can still include the wrong molecular nodes. This is especially easy to do when filtering by a name: searching for LYS may match not only lysine residues, but also their backbones and side chains, because those nodes can have names containing the same text. If your next step is measuring, editing, visualizing, or simulating the selection, that extra structure can matter.
A practical way to avoid this is to be deliberate about what kind of node you want, then check the result before moving on. In SAMSON, you can do this from the Document view with a Node Specification Language (NSL) expression.
From a broad text match to a precise residue selection
Open a molecular document and locate the Filter nodes… field in the Document view. Typing a plain string searches node names. For example, entering LYS and pressing Enter selects nodes whose names match that text. It is a quick way to find relevant parts of a structure, but it may be broader than intended.

To target residues by their residue type instead, enter residue.type LYS, or use the shorter equivalent r.t LYS, then press Enter. This asks for nodes whose residue type is LYS rather than nodes whose names merely contain the letters LYS. The documentation example has five LYS residues; the name search selects 15 nodes because it also catches named backbone and side-chain nodes.

A small selection-checking routine
- Decide the node level. Are you looking for atoms, residues, molecules, or another node type? A selection filter in the viewport can also set the level at which selection editors operate.
- Start with the simplest useful query. Use a name string when you want a quick broad search. Use an NSL expression when the selection depends on a property, such as residue type.
- Apply the filter. In the Document view, typing filters the displayed nodes; it does not select them immediately. Press Enter to select the nodes that match.
- Inspect the result. Check the selection summary at the bottom of the Document view for the number of selected nodes. If the count surprises you, reconsider whether the query matched names or the property you intended.
- Keep the selection reusable if needed. For a recurring query, open Select > Find (or press Ctrl/Cmd + F), enter the NSL expression, choose Save, and give the filter a clear name. For example,
r.t LYS or r.t HIScan be saved as a filter for LYS and HIS residues.
This approach is useful whenever a text search risks catching related nodes alongside the target. It also makes the selection easier to explain to a collaborator: instead of saying “I searched for LYS,” you can say that you selected nodes with residue type LYS. Saving a frequently used expression turns that precise query into a reusable option in the selection-filter list.
When you need to select visually
The rectangle selection editor is available in the viewport (shortcut: R) for point-and-click or box selections. Its selection level depends on the active selection filter. For example, with the filter set to Residues, clicking an atom selects at the residue level. This is handy for visual work, while the Document view and NSL are often better suited to property-based targeting. You can also use Select all with the current filter to select all nodes at that level, or Deselect all to clear the current selection.
For more examples and details on selection commands, editors, filters, groups, and Quick Groups, see the SAMSON selection documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
