Demystifying Path Attributes in SAMSON’s Node Specification Language

Understanding and efficiently leveraging the Node Specification Language (NSL) in SAMSON can streamline your molecular modeling workflows. In this blog post, we’ll explore path attributes, a part of NSL that’s particularly useful for working with conformation nodes in molecular structures. We’ll cover what these attributes are, how they can be used, and share examples to help you apply this knowledge in your projects.

What Are Path Attributes?

Path attributes belong to the path attribute space, abbreviated as p. They are specifically designed to match conformation nodes and provide a way to filter, query, and manipulate molecular structures based on the attributes of paths.

Inherited Attributes From Node

Some attributes used in the path space are inherited from the more general node attribute space. These include:

  • name: Matches the name of a path, with the short name n. For example:
    • p.n "A": Matches a path named “A”
    • p.n "L*": Matches paths with names starting with “L”
  • selected: Matches whether a path is selected. This attribute has no short name but can be written as p.selected. For instance:
    • p.selected: Matches selected paths
    • not p.selected: Matches paths that are not selected
  • selectionFlag: Matches the selection flag of a path, with a short name sf. For example:
    • p.sf false: Matches paths with a false selection flag
    • p.sf: Matches paths with a true selection flag

Attributes Specific to Path

In addition to inherited attributes, the path space introduces specific attributes to work with paths more effectively:

  • numberOfAtoms: Abbreviated as nat, this attribute matches paths based on their number of atoms. Examples include:
    • p.nat > 100: Matches paths containing more than 100 atoms
    • p.nat 100:200: Matches paths containing between 100 and 200 atoms

Such attributes make it easier to filter paths based on structural features, allowing for precise and tailored queries in complex molecular systems.

Practical Examples

Here’s how these attributes can be combined to perform specific queries in SAMSON:

  • p.n "Ligand*" and p.selected: Matches selected paths named “LigandX” where X is any string.
  • p.sf true and p.nat > 50: Matches paths with a true selection flag and more than 50 atoms.

By combining path attributes, molecular modelers can precisely pinpoint and manipulate desired elements of their molecular structures.

Learn More

Ready to integrate the power of path attributes into your molecular modeling? Check out the full documentation at Path Attributes Documentation.

SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.

Comments are closed.