A large molecular model can contain many structural groups, and visual inspection alone may not make it easy to find the groups relevant to a question. You might be looking for unusually large groups, groups with a particular elemental composition, or groups whose total charge falls within a range. In SAMSON, the Node Specification Language (NSL) lets you describe these criteria as attribute-based expressions.
This is useful when you want to turn a broad inspection task into a specific, repeatable search. The examples below focus on structural groups: the structuralGroup attribute space, abbreviated sg, matches only structural group nodes.
Start with size
If you need to narrow attention to larger groups, use the number-of-atoms attribute. For example, sg.nat > 100 matches structural groups with more than 100 atoms. To specify an interval instead, use sg.nat 100:200, which matches groups with a number of atoms between 100 and 200.
This gives you a simple first pass: set a size criterion that is meaningful for your model, then inspect the matching groups. The expression describes a measurable property rather than relying on names or visual appearance.
Ask what the group is made of
Structural groups also have attributes for counting particular elements. The short names are 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 matches groups with fewer than 10 carbon atoms, while sg.nO 10:20 selects groups with between 10 and 20 oxygen atoms.
There is also sg.ncga, which refers to the number of coarse-grained atoms. These counts let you frame a search around composition or representation. They can be more informative than total group size when the chemical feature you care about is specific to one element or to coarse-grained atoms.
Separate formal and partial charge
Charge searches are easier to interpret when you distinguish the two charge attributes. sg.fc is the total formal charge of a structural group; sg.pc is its total partial charge. For example, sg.fc 6:8 matches groups with formal charge between 6 and 8, whereas sg.pc 1.5:2.0 matches groups with partial charge between 1.5 and 2.0.
Formal charge takes integer values in the reference, while partial charge takes real-number values. So, when building a query, choose the attribute that corresponds to the quantity you intend to examine. A query for sg.fc is not interchangeable with one for sg.pc.
Use IDs and context when needed
If you already know which structure IDs matter, sg.id can filter by those identifiers. For example, sg.id >= 10 matches structural groups with a structure ID greater than or equal to 10. You can also specify multiple ranges: sg.id 5:10, 25:30.
Structural groups inherit useful node attributes too. For instance, sg.n "A" searches by name, sg.v refers to visibility, and sg.selected refers to selection state. The documentation notes that selected does not have the short name s in this attribute space, so use the full expression when querying it.
Make the query answer a clear question
A practical way to begin is to write down the property you are trying to investigate, then choose the matching attribute: group size with sg.nat, an element count with its corresponding short name, formal or partial charge with sg.fc or sg.pc, or a structure identifier with sg.id. Start with a simple expression and adjust its value or range if the results are too broad or too narrow. Keeping each expression tied to one clear criterion also makes it easier to understand why a group matches.
For the complete attribute reference and additional examples, see the SAMSON structural group attributes documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
