neurosnap.structure.selectors module#

Residue-selection utilities for Neurosnap structures.

neurosnap.structure.selectors.select_residues(structure, selectors, invert=False)[source]#

Select residues from a structure using a chain/residue selector string.

Supported selector forms include:
  • "A" for an entire chain

  • "A10" or "A10-20" for compact single-character chain selectors

  • "AB:10" or "AB:10-20" for multi-character chain IDs

Parameters:
  • structure (Structure) – Input single-model Structure.

  • selectors (str) – Comma-delimited selector string.

  • invert (bool) – Whether to invert the selection within each chain.

Return type:

Dict[str, List[int]]

Returns:

Dictionary mapping chain IDs to sorted residue numbers.