If you work with complex molecular systems, you’ve probably encountered situations where you needed to quickly focus on specific parts — for example, all segments with more than 500 atoms, or those containing a certain number of carbon atoms. SAMSON’s Node Specification Language (NSL) allows you to express these queries in a simple and readable way, but not everyone knows the full extent of what’s possible in the segment attribute space.
Here’s how you can use segment attributes in SAMSON to locate molecular segments based on chemical and structural properties like atom counts, formal charges, or element composition — all with just a few characters of NSL.
Why segment filtering matters
In large biomolecular systems, segments often correspond to key structural units such as chains or domains. If you want to perform operations like hiding, analyzing, or modifying only segments with specific characteristics (e.g., more than 1000 atoms, or high partial charge), being able to filter them efficiently can save a lot of manual work and reduce visual clutter.
Segment attribute filters you can use
Segment attributes work in the s (segment) namespace, allowing selective filtering using concise expressions. Below are some attributes you can use:
- Total atoms:
s.nat— filter by total number of atoms in the segment. Example:s.nat > 500 - Carbon atoms:
s.nC— number of carbon atoms. Example:s.nC 10:30 - Hydrogens:
s.nH, Nitrogens:s.nN, Oxygens:s.nO, Sulfurs:s.nS - Partial charge:
s.pc— filters by partial charge values. Example:s.pc > 1.5 - Formal charge:
s.fc— filters by formal charge of the segment. Example:s.fc 1:3 - Coarse-grained atoms:
s.ncga— when working with coarse-grained models. Example:s.ncga < 200
Quick examples
Here are a few practical expressions and what they do:
s.nat > 1000: Selects segments with more than 1000 atomss.nC 10:30: Segments with between 10 and 30 carbon atomss.pc > 2.0: Segments with high total partial charges.nN < 5: Segments with fewer than 5 nitrogen atomss.nS: Segments containing sulfur
Combining filters
You can easily combine multiple attributes to narrow down your search:
s.nC 10:50 and s.fc > 1 — segments with between 10 and 50 carbon atoms and formal charge greater than 1.
Start filtering faster
The segment attribute space is ideal for filtering biologically meaningful groups in large systems. Whether analyzing simulation results or preparing a clean rendering, this feature lightens a modeler’s workload considerably.
To learn more about all available segment attributes and their usage, visit the official documentation page: Segment Attributes in SAMSON.
SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON at https://www.samson-connect.net.
