Understanding File Attributes in SAMSON’s Node Specification Language (NSL)

For molecular modelers working with SAMSON, efficiently managing molecular files is a central part of the workflow. To streamline this process, SAMSON’s Node Specification Language (NSL) provides an attribute space called file. This blog post explores how you can use file attributes to gain better control of your molecular files and perform more precise operations.

What are File Attributes?

File attributes are a specific component of the Node Specification Language (NSL) in SAMSON. These attributes help users to specify and manipulate file-related nodes. The file attribute space, abbreviated as fi, matches only file nodes. This means that you can use attributes under fi to filter, query, and manage file nodes effectively within your molecular modeling projects.

Why are File Attributes Useful?

Working on large molecular design projects often involves managing dozens, or even hundreds, of files. Without a clear way to categorize, select, and operate on these files, modelers risk inefficiency and oversight. File attributes address this pain point by enabling targeted interactions with file nodes based on criteria such as file names, selection status, and selection flags.

Key File Attributes Explained

Below is an outline of the main file attributes available in the fi attribute space:

  • Name (fi.n): The name attribute allows you to select file nodes by their names. You can use strings in quotes, and wildcards are supported for pattern matching. For instance:
    • fi.n "A": Selects file nodes with the exact name “A”.
    • fi.n "L*": Selects all file nodes whose names start with “L”.
  • Selected (fi.selected): This Boolean attribute indicates whether a file node is currently selected. Examples include:
    • fi.selected: Filters for selected file nodes.
    • not fi.selected: Filters for file nodes that are not selected.
  • SelectionFlag (fi.sf): This attribute allows you to target file nodes based on a selection flag. Examples include:
    • fi.sf false: Targets file nodes with a false selection flag.
    • fi.sf: Targets file nodes with a true selection flag.

How to Use These Attributes

The real power of file attributes lies in how you combine them with other NSL functionalities to streamline your workflow. For instance, you can use the fi attributes to filter files for visualization, to prepare specific files for simulation, or to generate report-ready subsets of data.

Example scenario: Let’s say you want to select all files that start with “Protein” and are currently flagged as selected. You can use the following combination of attributes:

By leveraging simple expressions like this, molecular modelers can dramatically speed up file querying and focus their attention on the files of interest.

Learn More

If you’d like to explore the details of file attributes further, visit the official documentation page: https://documentation.samson-connect.net/users/latest/nsl/file/.

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

Comments are closed.