Utils
Utils¶
General functions.
Classes:
Config contains the parameters related to specific alignment file. |
|
Configs contains the parameters related to config file. |
Functions:
|
Helper function that gets the results directory from either the config file or the results directory directly. |
|
Create an instance of Configs from a config file |
|
Remove everything in a directory |
|
Run the PMD command from metaDMG-cpp and output the result to the gzipped txt_out |
|
Split a string by comma, space, or both. |
- class metaDMG.utils.Config[source]¶
Config contains the parameters related to specific alignment file.
- class metaDMG.utils.Configs[source]¶
Configs contains the parameters related to config file. Inherits from dict. Implements iterations.
Methods:
Compare the number of configs to the number of parallel_samples used.
Get the first config
get_nth
(n)Gets the n'th config
- metaDMG.utils.get_results_dir(config_file=None, results_dir=None)[source]¶
Helper function that gets the results directory from either the config file or the results directory directly.
- Parameters
config_file (
Optional
[Path
]) – Config file, by default Noneresults_dir (
Optional
[Path
]) – Results directory, by default None
- Return type
Path to the results directory
- Raises
AssertionError – If both config file and results directory are set, raise error
- metaDMG.utils.make_configs(config_file, log_port=None, log_path=None, force=False)[source]¶
Create an instance of Configs from a config file
- Parameters
config_file (
Optional
[Path
]) – The config file to loadlog_port (
Optional
[int
]) – Optional log port, by default Nonelog_path (
Optional
[str
]) – Optional log path, by default Noneforce (
bool
) – Whether or not the computations are force, by default False
- Return type
An instance of Configs
- Raises
typer.Abort – If not a proper config file
- metaDMG.utils.remove_directory(path, missing_ok=False)[source]¶
Remove everything in a directory
- Parameters
path (
Union
[Path
,str
]) – Directory to be deleted- Return type
None