A molecular model can contain many structural groups, and locating the ones relevant to a question is not always obvious. You might need to narrow the scene to groups with a particular charge, find unusually large groups, or identify groups rich in a particular element. Scanning them one by one is slow—and visual inspection alone may not answer questions about exact counts.
In SAMSON, the Node Specification Language (NSL) can match structural groups by their properties. This makes it possible to describe a useful filter directly: for example, match groups with more than 100 atoms, or groups with a partial charge in a specified range. The examples below focus on structural-group attributes, so the queries target structural group nodes, not individual atoms.
Start with the structural-group prefix
Structural-group attributes belong to the structuralGroup attribute space, abbreviated sg. The short form keeps queries compact. For example, sg.nat > 100 uses nat for the number of atoms. The longer equivalent is structuralGroup.nat > 100.
That prefix is useful to remember: it makes the target of the query explicit. The attributes described here match structural groups, and the sg prefix helps distinguish them from attributes in other NSL spaces.
Use counts to narrow a crowded model
When group size is the first thing you know, try sg.nat > 100 to match groups with more than 100 atoms. To focus on a size interval, use sg.nat 100:200. These are handy starting points when a scene contains groups of very different sizes and you want to reduce the set before investigating further.
You can also filter by selected element counts. For example, sg.nC < 10 matches groups with fewer than 10 carbon atoms, while sg.nO 10:20 matches groups with 10 to 20 oxygen atoms. Corresponding attributes are available for hydrogen (nH), nitrogen (nN), and sulfur (nS), as well as coarse-grained atoms (ncga).
These counts answer a specific question: how many atoms of a given type are in a structural group? They do not describe how those atoms are arranged. If arrangement or connectivity matters, a count alone is not a complete chemical description.
Be precise about charge
Formal and partial charge are separate attributes. Use sg.fc 1 for groups with formal charge equal to 1, or sg.fc 6:8 for groups with formal charge between 6 and 8. For partial charge, use sg.pc 1 or a range such as sg.pc 1.5:2.0.
This distinction matters when turning a chemical question into a query. If the question is about formal charge, use fc; if it is about total partial charge, use pc. They are not two spellings for the same property. The documentation describes fc as an integer-valued attribute and pc as a real-valued one.
Keep an identifier-based route in reserve
Sometimes the group is known by its structure ID rather than its chemistry. The short attribute is id: for example, sg.id >= 10 matches groups whose structure ID is greater than or equal to 10. You can also specify more than one interval with sg.id 5:10, 25:30.
A simple filtering routine
- State the question. Decide whether you care about group size, an element count, formal charge, partial charge, or structure ID.
- Choose the matching attribute. For example, use
natfor atom count,nOfor oxygen count, andpcfor partial charge. - Begin with a broad threshold or interval. The documented examples show comparisons such as
>and ranges such as100:200. - Check the matched groups in context. A numerical match describes the selected attribute; it does not, by itself, explain the group’s structure or role.
This approach turns an open-ended search into a sequence of clear questions. Start with a count or charge you can state precisely, then inspect the groups that match. For the full attribute reference and additional details, see the SAMSON structural group attributes documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
