A crowded molecular scene can make a simple question surprisingly slow to answer: which structural groups are unusually large, contain a particular element, or carry a notable charge? Clicking through groups one by one is tedious, and visual inspection alone may not reveal a useful property such as total atom count or formal charge.
SAMSON’s Node Specification Language (NSL) lets you describe structural groups by their attributes. The structural-group attribute space uses the prefix sg. Rather than starting with a long, complicated expression, you can use individual filters to narrow the search and inspect the resulting matches.
Start with size
If you are looking for groups with many atoms, try sg.nat > 100. This matches structural groups whose number of atoms is greater than 100. To focus on a particular size range, use sg.nat 100:200. These are useful first-pass filters when a model contains groups of very different sizes and you want to find candidates for closer inspection.
Element counts can make the search more specific. For example, sg.nC < 10 looks for groups with fewer than 10 carbon atoms, while sg.nO 10:20 matches groups with between 10 and 20 oxygen atoms. Related attributes are available for hydrogen (sg.nH), nitrogen (sg.nN), and sulfur (sg.nS). The sg.ncga attribute counts coarse-grained atoms, which can be useful when working with coarse-grained structures. These counts describe a structural group; they are not a general description of the entire molecular scene.
Separate formal and partial charge
Charge searches are helpful when you need to locate groups with a particular charge characteristic, but formal and partial charge are distinct attributes. Use sg.fc for total formal charge: for instance, sg.fc > 1 matches groups with formal charge greater than 1, and sg.fc 6:8 searches a range. Use sg.pc for total partial charge. The expression sg.pc 1.5:2.0 searches for groups whose partial charge falls between 1.5 and 2.0.
Keeping these two queries separate helps avoid a common interpretation mistake: a formal-charge filter is not a substitute for a partial-charge filter. Choose the attribute that corresponds to the quantity you intend to examine.
Use IDs to revisit specific groups
When you already know a structure ID, sg.id 1 searches for that ID. You can also use comparisons, such as sg.id >= 100, or search multiple ranges with sg.id 10:20, 30:40. This is handy when you need to return to a known subset or inspect several ID ranges without relying on names alone.
A practical way to work
-
Choose the question first: size, element count, charge, or structure ID.
-
Run a focused query, such as
sg.nat > 100orsg.nO 10:20. -
Review the matches in the context of your model. A numerical match identifies a group by the chosen attribute; it does not by itself explain why that group has the value.
-
Adjust the threshold or range if the first search returns too broad or too narrow a set.
This step-by-step approach makes a large scene easier to investigate while keeping the search criteria understandable. The attribute reference also lists inherited node properties, including visibility and selection-related attributes, alongside the attributes specific to structural groups.
Learn more in the structural group attributes reference.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
