Selecting

In SAMSON, to do any operations (inspect, edit, move, simulate, etc) with nodes (atoms, residues, molecules) it is necessary to select them.

SAMSON provides several ways for doing simple and complex selections: selection filters, selection editors, selecting using the Document View, selecting using the Node Specification Language. Also, you can install the Python Scripting SAMSON Element to do even more complex and scripted selections (see Python Scripting Guide).

Selection filters

First, we need to specify the desired level of the selection. Among the toolbars in SAMSON, you may find the selection menu.

MenuSelection.png
The selection menu

It provides a one-click access to the selection functionality and a possibility to set a selection filter. The selection filter allows you to specify types of nodes to which the selection should be applied. You can add your own selection filters (see Selecting using the Node Specification Language).

SelectionFilterFull.png
The selection filter

In this toolbar you will as well find the following icons:

IconSelectAll.png
Select all
IconDeselectAll.png
Deselect all

MenuSelection.gif
Selecting using the selection filter

Let's open a molecule, e.g. 1YRF from the Sample folder. Now, choose "Residues" in the selection filter and click on the "Select all" icon next to the selection filter. You will see that all the residues present in the Document were selected.

Selecting-SelectionFilter-Residues.png
The selection filter: Residues

At the bottom of the document view you will see a selection summary with the number of selected nodes. If you do not see the document view, you can enable it via Interface menu or the Ctrl + 1 shortcut on Windows or Linux or Cmd⌘ + 1 on Mac. You can click on the selection summary to see possible contextual actions.

Note: If you have enabled the inspector (Interface menu or the Ctrl + I shortcut on Windows or Linux or Cmd⌘ + I on Mac), you may notice that a detailed info on the selected nodes is shown in the inspector. The inspector is a powerful tool which allows you to view and edit properties of a single node or a group of nodes. Please, see Inspecting for a learn more about how to work with the inspector.

Choose "Atoms" as a selection filter and click on the "Select all" icon. You will see that all the atoms were selected.

Selecting-SelectionFilter-Atoms.png
The selection filter: Atoms

Now, click on the "Deselect All" icon and everything will be deselected.

Choose "Atoms and bonds" as a selection filter for the rest of the tutorial.

Selecting using Editors

To use selection Editors you can either choose one from the Edit group of the Home menu or go to the Edit menu.

MenuEditors.png
The editors group in the Home menu

Three selection editors are present by default in SAMSON:

Editors-PointSelection.png
The point selection editor
Editors-RectangleSelection.png
The rectangle selection editor
Editors-LassoSelection.png
The lasso selection editor

These three selection editors are combined together in the Edit group of the Home menu.

MenuEditors-Select.gif
Selecting using the rectangle selection editor

The rectangle and lasso selection can either select or not select nodes hidden behind other nodes. To modify this settings, please, double-click on the icon of the rectangle or lasso selection editor and check or uncheck the check box "Select nodes hidden behind other nodes".

Editors-RectangleSelection-SelectHiddenNodes.png
The rectangle selection editor: select hidden nodes

Let's open a molecule, e.g. 1YRF from the Sample folder. Choose the point selection editor. Make sure that the selection filter is set to "Atoms and bonds". If you left click on any atom in the viewport, this atom will be selected. To select more than one node using the point selection editor hold Ctrl/ Cmd⌘.

Selecting-PointSelection.png
Selecting using the point selection editor

Tip: If you press Shift + Space the camera will centered on the selected part (so that the selection will be in focus).

Now, choose the rectangle selection editor. Left click and hold in the viewport and start moving your mouse, you will see the rectangle, once you release the left button the nodes behind the drawn rectangle will be selected. To select more than once, hold Ctrl.

Selecting-RectangleSelection.png
Selecting using the rectangle selection editor

Lasso selection editor allows selecting nodes behind the more complex objects. Choose the lasso selection editor. Left click and hold in the viewport and start moving your mouse, you will see the lasso, once you release the left button the nodes behind the drawn figure will be selected. To select more than once, hold Ctrl/ Cmd⌘.

Selecting-LassoSelection.png
Selecting using the lasso selection editor

You can use selection editors with different selection filters. Set the selection filter to "Residues" and choose the point selection editor. Now, when you will try to select in the viewport an atom that belongs to a residue, this residue will be selected instead.

Selecting-PointSelection-Residue.png
Selecting residues using the point selection editor

Selecting using the Document View

You can select nodes through the document view.

Let's open a molecule, e.g. 1YRF from the Sample folder. Unfold several levels and click on a residue, it will be selected.

Selecting-SelectionInDocumentView-Residue.png
Selecting a residue in the Document view

The bottom part of the document view shows a selection summary. Click on it to see possible contextual actions.

You can use Ctrl/ Cmd⌘ + Shift to perform complex selections.

Selecting-SelectionInDocumentView-Residues.png
Selecting residues in the Document view

You can filter nodes in the document view by entering a string or a Node Specification Language expression. Press Enter to select the nodes matching the filter.

Selecting-SelectionInDocumentView-Filter.png
Filter nodes in the Document View

Let's filter Lysine (LYS) residues by name, type LYS in the filter and press Enter to select the filtered nodes.

Selecting-Filter-LYS-UsingString.png
Selecting nodes using a name string filter

You might notice in the document view, in the selection summary, or in the inspector that 15 nodes were actually selected in total, while there are only 5 LYS residues, this is because backbones and side-chaines of LYS residues were as well selected, since their names contain "LYS". Filtering by string is based on names of the nodes. For a more precise filtering you can use the Node Specification Language. To choose only LYS residues, type the following Node Specification Language expression: residue.type LYS (or a short version r.t LYS). Press Enter to select the nodes matching the filter.

Selecting-Filter-LYS-UsingNSL.png
Selecting nodes using a Node Specification Language expression as a filter

As you can see, only the LYS residues were selected now.

See Selecting using the Node Specification Language section to lear more about how to select nodes using Node Specification Language expressions.

Selecting using the Node Specification Language

You can use the Node Specification Language for selecting nodes in the document view filter as it was shown in the Selecting using the Document View section, or by using the Find window. The Find window can be opened via the Ctrl + F shortcut on Windows and Linux or Cmd⌘ + F on Mac or by clicking on an icon "Find" in the Selection menu.

IconFind.png
Find

This will open the Find window.

Find.png
The Find window

See the Node Specification Language section for lear more about it.

Saving selection filters

A Node Specification Language expression can be saved as a selection filter for later use. Open the Find window, type a selection string, and enter the name for the selection filter based on this string to be saved as.

Let's save the selection filter which gives us LYS or HIS residues: r.t LYS or r.t HIS. We will name it "LYS and HIS residues". Once you put the selection string and the name for the selection filter, press Ok or Enter.

Selecting-Find-LYSorHIS.png
Add custom selection filter

The newly added selection filter should appear in the selection filter list.

Selecting-Find-LYSorHIS-SelectionFilter.png
A custom selection filter in the selection filters list

You can remove any filter or reset all the custom filter. To remove a custom filter, this filter first should be selected as an active one. Important: "Reset selection filters" will remove all the selection filters added by you.

Selecting-Find-LYSorHIS-RemoveSelectionFilter.png
Removal of a custom selection filter from the selection filters list

Saving the selection as a group

Selections can be saved as groups. This is useful, for example, to have a fast access to some nodes.

Important: A group does not contain the nodes it refers to, but only links to them. If you select a group but some of the nodes were deleted, only the existing ones will be selected.

Open a molecule and select some atoms. Right click on the selection and choose "Create group" from the context menu, or just click on the "Create a group from the current selection" icon in the selection toolbar.

IconCreateGroup.png
Create a group from the current selection

Selecting-CreateGroup.png
Create a group from the current selection

Once you click on "Create group", a dialog window will pop-up where you can name the group.

Selecting-NewGroup.png
New group window

The newly created group will appear in the document view.

Selecting-GroupInDocumentView.png
A newly created group in the Document View

You can perform different actions with a group:

Selecting-GroupContextMenu.png
Create a group from the current selection

Inverting and expanding selections

To invert the selection, right-click on the selection either in the document view or in the viewport and click in the context menu Invert selection.

Selecting-InvertSelection.png
Invert selection

To expand the selection, right-click on the selection either in the document view or in the viewport and in the Expand selection context menu select for how much you want to expand the selection, you can click custom to set the specific distance.

Selecting-ExpandSelection.png
Expand selection