How to Filter Side Chains Based on Attributes in SAMSON

When working with complex molecular models, one common challenge is efficiently identifying and isolating specific parts of the molecular structure. For protein modeling, in particular, side chains can play critical roles in interactions, conformations, and active sites. If you’re tired of manually scanning or highlighting side chains that meet certain conditions, SAMSON’s Node Specification Language (NSL) offers a structured and powerful way to filter them based on a wide range of attributes.

Whether you’re inspecting a local environment around a binding site or analyzing the composition of a mutated protein, NSL can help you express detailed queries on side chains quickly and reproducibly.

What are side chain attributes?

In SAMSON, side chains are special structural group nodes. This means they inherit attributes from both node and structuralGroup attribute spaces. To address side chains specifically, use the prefix sc (short for sideChain) in your queries.

Examples of useful filters

Here are some common side-chain querying patterns you might find useful in day-to-day modeling:

  • Find all visible side chains: sc.v
  • Hide all side chains with more than 5 nitrogen atoms: sc.nN > 5
  • Select all side chains that own material and are currently selected: sc.om and sc.selected
  • Filter side chains whose name starts with “L” (e.g., leucine): sc.n "L*"

Attribute categories

The available attributes fall into two categories, based on where they are inherited from:

From the node structure:

  • hasMaterial (sc.hm): Does the side chain have an associated material?
  • hidden (sc.h): Is the side chain currently hidden?
  • name (sc.n): Match the name of the side chain (supports wildcards like *).
  • ownsMaterial (sc.om): Does the side chain own its material?
  • selected: Whether the side chain is selected (no short name for this one).
  • selectionFlag (sc.sf): Additional selection flag, useful for temporary tagging.
  • visibilityFlag (sc.vf): Controls dynamic visibility states.
  • visible (sc.v): Whether the side chain is visible.

From the structuralGroup structure:

  • formalCharge (sc.fc): Integer value of the formal charge.
  • numberOfAtoms (sc.nat): Total atoms in the side chain.
  • numberOfCarbons (sc.nC): Number of carbon atoms.
  • numberOfHydrogens (sc.nH)
  • numberOfNitrogens (sc.nN)
  • numberOfOxygens (sc.nO)
  • numberOfSulfurs (sc.nS)
  • numberOfCoarseGrainedAtoms (sc.ncga): If using coarse-grained models.
  • partialCharge (sc.pc): Real number value for partial charge.

Putting it to work

Let’s say you’re modeling an organic molecule and you’re only interested in the side chains that contain between 2 and 4 nitrogen atoms but no more than one oxygen atom. You could write:

This kind of filtering is helpful not just for visualization, but also for selecting subsets for simulation, rendering, or export.

Why this matters

Being able to quickly isolate side chains based on objective and quantitative attributes saves time in both visualization and analysis. You’re also less prone to errors than manual selection.

The flexibility of using compound filters (e.g., combining multiple constraints with logical operators) makes NSL a valuable tool when dealing with structurally or chemically diverse molecules.

To learn more about using side chain attributes in NSL, check out the official SAMSON documentation: https://documentation.samson-connect.net/users/latest/nsl/sideChain/

SAMSON and all SAMSON Extensions are now free for non-commercial use. This makes it easier than ever to explore molecular modeling tools in education and academic research.

Comments are closed.