Find the right molecular groups without counting atoms by hand

When a molecular model contains many structural groups, finding the one you need can turn into a tedious inspection task: Which groups contain a manageable number of atoms? Which have a particular elemental makeup? Where are groups with a specified charge? In SAMSON, the Node Specification Language (NSL) lets you describe structural groups using attributes, so you can search by these properties instead of checking each group manually.

This is especially useful when you are narrowing down a structure for inspection or trying to locate groups that meet a specific criterion. The key is to choose an attribute that describes the question you actually have: size, composition, charge, or structure ID.

Start with the size of a group

Use sg.nat to select structural groups by their number of atoms. For example, sg.nat < 1000 describes groups with fewer than 1,000 atoms, while sg.nat 100:200 describes groups with between 100 and 200 atoms.

A range can be a practical starting point when the model contains groups of very different sizes. It helps you express a useful cutoff directly, rather than relying on a visual estimate. The attribute table also lists sg.ncga for the number of coarse-grained atoms, which is a separate measure from the ordinary atom count.

Use composition to narrow the search

If you care about a particular element, NSL provides element-specific count attributes: sg.nC for carbon, sg.nH for hydrogen, sg.nN for nitrogen, sg.nO for oxygen, and sg.nS for sulfur. For example, sg.nC < 10 describes groups with fewer than 10 carbon atoms; sg.nO 10:20 describes groups with 10 to 20 oxygen atoms.

These counts let you turn a broad question about composition into a specific selection criterion. For instance, if you are looking for a group with relatively few carbons, the carbon-count attribute expresses that directly. The documentation gives the same comparison and range style for each listed element.

Keep formal and partial charge distinct

Charge can be another useful way to describe a group, but NSL exposes two different charge attributes. sg.fc is the total formal charge, and sg.pc is the total partial charge. They are not interchangeable: choose the one that matches the quantity you intend to examine.

For formal charge, examples include sg.fc > 1 and sg.fc 6:8. For partial charge, examples include sg.pc > 1.5 and sg.pc 1.5:2.0. The first attribute uses integer values; the second uses real values. Keeping that distinction in mind can prevent a search from answering a different charge question than the one you meant to ask.

Find groups by structure ID or name

When you already have an identifier, sg.id can match structural groups by structure ID. For example, sg.id >= 100 describes IDs greater than or equal to 100, and sg.id 10:20, 30:40 describes two ranges. If the group name is more useful, the inherited name attribute can be written as sg.n "A"; the reference also gives sg.n "L*" as an example.

A simple way to build a useful search

Begin with the property that matters most. Use an atom-count attribute for size, an element-count attribute for composition, a charge attribute for charge, or sg.id when you know the structure ID. Then choose a comparison or range that reflects your criterion. The examples above are individual attribute expressions; they make it easier to formulate a focused search before adding other selection criteria.

Structural-group attributes also inherit common node properties, including sg.visible, sg.hidden, and sg.selected. These can help describe visibility or selection state when that is relevant. Note that selected has no short name in this attribute space, so write it as sg.selected.

For the complete attribute list and additional examples, see the Structural group attributes reference.

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

Comments are closed.