Find the Right Structural Groups Without Inspecting Them One by One

A molecular model can contain many structural groups, and locating the ones that matter by browsing names or clicking through the scene can become tedious. If your question is about a group’s size, elemental composition, or charge, SAMSON’s Node Specification Language (NSL) lets you describe that property directly and match groups by it.

The structural-group attribute space uses the prefix sg. These attributes match structural group nodes specifically. The examples below are useful starting points when you need to narrow down a large model, check a chemical feature, or locate a group with a known identifier.

Start with size

When a model contains groups of very different sizes, atom count is a practical first filter. Use sg.nat for the number of atoms:

  • sg.nat > 100 matches groups with more than 100 atoms.
  • sg.nat 100:200 matches groups with an atom count between 100 and 200.

This is useful when you want to focus on larger assemblies or set aside small groups while exploring. The count refers to atoms in the structural group; it is not a measure of the group’s spatial size.

Filter by elemental composition

Atom totals alone may not distinguish the structures you care about. NSL also provides counts for specific elements: 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.
  • sg.nO 10:20 matches groups with between 10 and 20 oxygen atoms.
  • sg.ncga 100:200 matches groups with between 100 and 200 coarse-grained atoms.

These filters can help answer specific questions without relying on a group’s name—for example, whether a group falls within a chosen range of oxygen atoms. The element-count attributes work in the same general way as atom count: use a comparison or a range to express the values you are looking for.

Use charge to narrow the search

Structural groups have attributes for both formal and partial charge. Formal charge is an integer, while partial charge can be a real number. Examples include:

  • sg.fc > 1 for groups with formal charge greater than 1.
  • sg.fc 6:8 for formal charges between 6 and 8.
  • sg.pc > 1.5 for groups with partial charge greater than 1.5.
  • sg.pc 1.5:2.0 for partial charges between 1.5 and 2.0.

Keeping the two attributes distinct matters: they describe different charge measures and accept different kinds of values. Choose the one that matches the property you need to inspect.

Find groups by structure ID

If you already know the structure ID, use sg.id. A query such as sg.id >= 10 matches IDs of 10 or greater. To specify separate intervals, use sg.id 5:10, 25:30. This can be handy when you need to refer to particular ID ranges rather than search by composition or charge.

A helpful way to approach a filtering task is to translate the question into an attribute: “How many atoms?” points to sg.nat; “How many of this element?” points to the corresponding element-count attribute; “Which charge?” points to sg.fc or sg.pc; and “Which identifier?” points to sg.id. The short names keep expressions compact, while the full names—such as structuralGroup.numberOfAtoms—make their meaning explicit.

For the complete attribute list, inherited node attributes, 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.