Skip to content

Utils

Convert a list of residue names into a formatted selection string.

PARAMETER DESCRIPTION
resnames

List of residue names to string together.

TYPE: Sequence[str]

linker

String to link (e.g., put between) residue names.

TYPE: str DEFAULT: 'or'

RETURNS DESCRIPTION
str

Formatted selection string.

TYPE: str

Example

resnames = ["WAT", "HOH", "H2O"] formatted_string = format_resnames(resnames) print(formatted_string) resname WAT or resname HOH or resname H2O formatted_string = format_resnames(resnames, linker="and") print(formatted_string) resname WAT and resname HOH and resname H2O