Closed axiomcura closed 1 year ago
One of the common issues of using conda as environment manger is that it takes a considerable amount of time to create an environment.
conda
It seems that the snakemake developers favors mamba as their environment manager.
snakemake
mamba
Since we have base configuration file, users can either select mamba or conda as their environment manger. It will look something like this.
# in configuration.yaml env_mamanger: mamba
we can use snakemake's api to overwrite the default configs when executing a workflow by using the config parameter. According to the documentation:
config
config (dict) – override values for workflow config
Therefore we can implement something like this:
import yaml import snakemake # load base configs config_file = "configuration.yaml" with open(config_file, 'r') as f: configs = yaml.safe_load(f) # create dictioanry to overwrite default settings custom_configs = { "conda_create_call" : configs[env_manager]} # executing workflow snakemake.snakemake("workflow.smk", cores=3, config=custom_configs}
The implementation above ensures that your complete workflow is now using mamba to generate environments instead of conda
NOTE: This idea is subject to change!
This has been added in #45
issue
One of the common issues of using
conda
as environment manger is that it takes a considerable amount of time to create an environment.It seems that the
snakemake
developers favorsmamba
as their environment manager.potential approach
Since we have base configuration file, users can either select mamba or conda as their environment manger. It will look something like this.
we can use
snakemake
's api to overwrite the default configs when executing a workflow by using theconfig
parameter. According to the documentation:Therefore we can implement something like this:
The implementation above ensures that your complete workflow is now using
mamba
to generate environments instead ofconda
NOTE: This idea is subject to change!