molclusters.config¶
config
¶
Provides the MolClsConfig class that stores the configuration information for the analysis.
Rule
¶
Base rule class.
CMRule
¶
HBRule
¶
Bases: Rule
Rule class for hb rule.
Besides the donor-acceptor distance and D-H-A angle cutoffs, it holds the
criteria that pick out the rule's hydrogens (mass strictly between
h_mass_min and h_mass_max, charge above h_charge_min) and acceptors
(charge below a_charge_max). The defaults are MDAnalysis'
HydrogenBondAnalysis.guess_hydrogens()/guess_acceptors() ones.
MolClsConfig
¶
Bases: BaseSettings
Settings class for input parameters.
lammps_timestep_ps
property
¶
lammps_timestep_ps: float | None
The LAMMPS timestep size, in ps.
Returns:
| Type | Description |
|---|---|
float | None
|
|
resname_for_resid
¶
Look up the resname configured for a LAMMPS molecule id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
resid
|
int
|
A LAMMPS molecule id (the |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
The name assigned to |
Source code in src/molclusters/config.py
is_ignored_composition
¶
Check whether a cluster composition is configured to be ignored.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
resnames
|
Iterable[str]
|
The residue names making up a candidate cluster. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if this composition matches an |
Source code in src/molclusters/config.py
describe
¶
describe() -> str
Describe the configuration the analysis actually runs with.
Unlike the raw config file, this shows the parsed rules with their
defaults filled in, the solute keyword expanded, and the LAMMPS molecule
id ranges merged, so a user can check what was understood.
Returns:
| Type | Description |
|---|---|
str
|
A multi-line, human-readable description. |
Source code in src/molclusters/config.py
read_config
¶
read_config(path: Path | str) -> MolClsConfig
Read a configuration file and return an MolClsConfig object.
Support JSON, YAML, and TOML file formats based on the file extension.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
The path to the configuration file. |
required |
Returns:
| Type | Description |
|---|---|
MolClsConfig
|
An instance of MolClsConfig initialized with the data from the configuration file. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the file extension is not supported. |
Notes
- Supported file extensions: '.json', '.yaml', '.yml', '.toml'.
- Requires the corresponding libraries for each file type (e.g.,
json,yaml,tomllib).