Quickly Find the Files You Need in Complex Molecular Projects

When working on large molecular modeling projects, it’s not unusual to find yourself navigating through dozens or even hundreds of files—simulation results, conformational variants, input parameters, and so on. Trying to locate a specific file becomes increasingly difficult as complexity grows.

Fortunately, SAMSON provides a structured way to query and filter file nodes directly, thanks to the file attribute space in the Node Specification Language (NSL). Understanding and leveraging just a few file attributes can dramatically streamline your workflow.

Why File Attributes Matter

Imagine needing to isolate only the selected input files among many, or retrieve files whose names start with a specific prefix. Manually browsing through each node is tedious and error-prone. File attributes can help you automate and simplify this process, making it much easier to manage complex systems.

The file Attribute Space (Short Name: fi)

This attribute space applies exclusively to file nodes. It allows you to filter based on:

  • Name – Filter files by name with string patterns.
  • Selected – Identify whether a file is currently selected.
  • Selection Flag – Whether a selection flag is set on the file.

1. Filtering by Name

To find files with names matching a specific string or pattern, use:

This allows wildcard matching, making it ideal when your files follow naming conventions.

2. Finding Selected Files

To filter for files that are currently selected:

To exclude selected files:

This is useful when organizing, exporting, or manipulating only the parts of your system that are active.

3. Using the Selection Flag

Unlike selected, which reflects current selection in the GUI, selectionFlag allows you to tag nodes programmatically:

This can be useful to keep track of specific files across sessions or scripts, especially when selections are dynamic or automated.

Attribute name Short name Possible values Examples
name n strings in quotes fi.n "A"
fi.n "L*"
selected true, false fi.selected
not fi.selected
selectionFlag sf true, false fi.sf false
fi.sf

Better Queries Today

Practicing with a few filters can drastically reduce the time spent searching through nodes, improve model iterations, and help you maintain clarity in larger systems. It’s a minor skill with a big payoff. Try creating a few queries next time you open SAMSON and see how quickly you can isolate just the files you want.

To learn more about the file attribute space and its use in the Node Specification Language, visit the full documentation here: https://documentation.samson-connect.net/users/latest/nsl/file/

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

Comments are closed.