qm_atlas¶
- qm_atlas.constants.DEFAULT_SCR¶
Default scratch directory, resolved at import time by
qm_atlas.utils.get_scratch_dir().
- qm_atlas.utils.get_scratch_dir()[source]¶
Returns a scratch directory for temporary files. The function first checks if the environment variable TMPDIR is set and returns its value as a Path object. If TMPDIR is not set, it attempts to create a scratch directory in /scratch/<user>/qm_atlas_tmp, where <user> is the current user’s username. If this fails due to permission issues, it falls back to creating a scratch directory in the current working directory.
- qm_atlas.utils.has_macrocycle(mol, ring_threshold=10)[source]¶
- Checks whether a molecule has a macrocycle, i.e. if the largest ring has more
atoms than a given threshold
- qm_atlas.utils.conformer_is_3d(mol, conf_id=0)[source]¶
Checks whether a molecule has 3D coordinates. The check is more extensive than simply checking for a non-zero z-coordinate. Instead it checks if there are any four consecutive atoms, for which the position vectors are linearly independent.
- qm_atlas.utils.remove_conformers(mol, idcs_to_remove, reset_idcs=True)[source]¶
Removes Conformers from an rdkit molecule object. Modifies the molecule in place.
- qm_atlas.utils.as_float(value)[source]¶
Return value as float, if possible. If the value cannot be parsed as a float, the original value is returned
- Return type:
- qm_atlas.utils.meta_func(func, args, **kwargs)[source]¶
meta func to translate positional args to tuple
- qm_atlas.utils.get_atom_indices_map(mol)[source]¶
returns a list mapping the original atom indices to the new ones.
- qm_atlas.utils.intervals_overlap(interval1, interval2)[source]¶
- Checks whether two intervals overlap. Touching counts as overlapping as well.
For example, the intervals [1, 2] and [2, 3] overlap.
- qm_atlas.utils.remove_salt(smiles, saltfile=None)[source]¶
Remove salt and small molecules from smiles
Does not remove all non-covalented molecules
Does not neutralize the molecule
>>> uncharger = rdMolStandardize.Uncharger() >>> mol = uncharger.uncharge(mol) # remove salt and adjust charges
- qm_atlas.software_environment.get_python_activation_command()[source]¶
Auto-detect the activation command for the currently active Python virtual environment.
Checks
VIRTUAL_ENV(set by any activated venv/virtualenv) and falls back tosys.prefix. ReturnsNonewhen no virtual environment is detected (e.g. running in the system Python).
- qm_atlas.software_environment.get_cosmo_solvents_dir_key(level)[source]¶
Get the appropriate global settings key for COSMO solvents directories based on level.
- Parameters:
level (
str) – The cosmotherm level of theory (e.g. “bp-tzvpd”, “bp-tzvp”, “bp-svp”, “dmol3-pbe”)- Returns:
The global settings key to use for retrieving the solvents directories for the given level
- class qm_atlas.software_environment.SoftwareEnvironment(*, commands, environment_variables, thread_control_variables, available=False)[source]¶
- Parameters:
- class qm_atlas.software_environment.EnvironmentManager(config_file=None)[source]¶
- Parameters:
config_file (Path | None)
- ALLOWED_SUBMISSION_KEYS = {'command_prepend', 'module_load', 'module_purge', 'module_use'}¶
- ALLOWED_GLOBAL_SETTINGS_KEYS = {'cosmo_solvents_dir_bp-svp', 'cosmo_solvents_dir_bp-tzvp', 'cosmo_solvents_dir_bp-tzvpd', 'cosmo_solvents_dir_dmol3-pbe', 'moka_model'}¶
- qm_atlas.software_environment.get_config_file()[source]¶
Return the user-supplied software config file path, or
Noneif the environment variableSOFTWARE_CONFIG_ENV_VARis not set.Raises
EnvironmentErrorwhen the variable is set but points to a file that does not exist, so typos are caught early.
- qm_atlas.software_environment.load_environment_manager(config_file=None)[source]¶
- Return type:
- Parameters:
config_file (Path | None)
- class qm_atlas.software_environment.SoftwareConfig[source]¶
- qm_atlas.software_environment.get_moka_model()[source]¶
Get the default MoKa model path from global settings.