When working with large molecular systems, molecular modelers often need to isolate relevant substructures for visualization, editing, or simulation. One common task is identifying substructures with specific formal charges—whether to locate reactive sites, predict ion binding regions, or prepare input for force field parametrization.
Fortunately, SAMSON’s Node Specification Language (NSL) provides a simple and powerful syntax to filter structural groups by their formal charge using the structuralGroup.formalCharge property, also referred to as sg.fc.
Why filter by formal charge?
Structural groups with non-neutral charges often hold significant biological or chemical roles. For example:
- In proteins, positively charged lysine or arginine side chains may form salt bridges.
- In small molecule libraries, groups with negative charges might bind to active sites of receptors.
- In materials science, charged components may drive ionic conduction processes.
Being able to select these charged regions quickly can save time and enable more targeted analyses.
Using NSL to find charged structural groups
The formalCharge attribute is defined specifically for structural group nodes. Its short form is sg.fc. You can use it to match structures with a specific formal charge or a range:
sg.fc 1— matches any structural group with a total formal charge of +1sg.fc -1— matches structural groups with a charge of -1sg.fc 2:4— selects groups with charge between 2 and 4 inclusivesg.fc > 0— finds all positively charged groupssg.fc < 0— finds all negatively charged groups
You can combine this with other filters such as the number of atoms (sg.nat), the presence of certain elements (e.g., sg.nO for oxygens), or visibility (sg.v) to refine the query for your modeling needs.
Example workflow
Imagine you’re working on a simulation of a large protein-ligand complex and want to locate a ligand fragment with a charge of +1:
- Open your molecular system in the SAMSON interface.
- Type
sg.fc 1into the NSL search bar. - The matching structural group(s) will be highlighted in the viewport.
- Optionally, further restrict the selection with
sg.nat 10:50if you’re only interested in small ligands.
This simple search can dramatically speed up your workflow—especially in systems with thousands of atoms.
Tips
- Remember to interpret the formal charge as the sum over all atoms in the group. Often this corresponds to manually assigned charges in structural preparation tools.
- You can mix multiple conditions (e.g.,
sg.fc > 0 and sg.nO > 2) to isolate functional groups like protonated carboxylic acids or organometallic moieties. - If you’re unsure how charges are assigned, you may want to double-check using a visualization mode that colors by formal charge.
Learn more in the official SAMSON documentation.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
