If you have ever typed a residue name into a molecular-structure filter and selected far more than you expected, you have run into a common modeling frustration: a text match can find names at several levels of the structure. Searching for LYS, for example, may match lysine residues as well as their backbones and side chains. The result can look like five residues were selected, while the selection actually contains 15 nodes.
The fix is to filter by the property you mean—not just by a word that happens to appear in a node’s name. In SAMSON, the Node Specification Language (NSL) lets you describe that intent directly. For lysine residues, use residue.type LYS, or its shorter form, r.t LYS.

Filter first, select second
In the Document view, enter your query in the Filter nodes… box. A typed string or NSL expression filters the displayed nodes; it does not immediately select them. Press Enter to select the nodes that match. This distinction is useful: you can refine what you are looking for before committing to a selection.
- Open the Document view. If it is hidden, enable it through Interface > Document view.
- Enter
residue.type LYSin the Filter nodes… box. - Press Enter to select the matching residues.
- Check the selection summary, or inspect the selected nodes in the Inspector, to confirm the result.
The same idea applies whenever a broad name search is too inclusive: use an NSL expression that specifies the relevant node property. NSL expressions can be used in the Document view filter and in the Find window. The Find window is available from Select > Find or with Ctrl/Cmd + F.

Make a useful query reusable
If you regularly return to the same selection, you do not need to remember and retype the expression each time. In the Find window, enter the query and click Save. Give the filter a descriptive name, such as LYS residues, and confirm. It will then appear in the selection-filter list, where you can use it again.
You can also combine residue types in one saved filter. For example, r.t LYS or r.t HIS matches lysine or histidine residues. Save it with a name that describes the selection, such as LYS and HIS residues. A clear name helps you distinguish a carefully defined selection from a broad text search later in a busy document.
Custom filters can be removed by making the filter active and right-clicking the selection-filter list. The Reset selection filters command removes all custom filters you added, so use it only when you intend to clear them all.
A quick check before the next operation
Before applying an edit, measurement, visualization, or other operation, take a moment to check what is selected. The Document view’s selection summary shows the number of selected nodes, and the Inspector can show details about them. If the count seems unexpectedly high, reconsider whether a name-string match has included related nodes, or whether you need a more specific NSL expression.
For selections you will switch between repeatedly, SAMSON also offers Quick Groups. You can assign a selection to a numbered group with Shift + a number, then switch to it by pressing that number. This can help keep frequently revisited parts of a structure close at hand without rebuilding each selection.
For more examples of selection commands, filters, editors, NSL, and saved groups, see the SAMSON Selecting documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
