moiexpositoalonsolab / grenepipe

A flexible, scalable, and reproducible pipeline to automate variant calling from raw sequence reads, with lots of bells and whistles.
http://grene-net.org
GNU General Public License v3.0
94 stars 21 forks source link

mamba is difficult to install in grenepipe environment #40

Closed wangshuangyi closed 6 months ago

wangshuangyi commented 10 months ago

(grenepipe) [sysu_mhwang_1@sy3ubuntu1804-23101937-698d4864d-99fwt envs]$conda install mamba Collecting package metadata (current_repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source. Collecting package metadata (repodata.json): / Software installation would be too slow without mamba.I noticed that the yaml files in the envs folder don't have names, can I write a name for each yaml file and then install each virtual environment separately in the mamba environment

lczech commented 10 months ago

Hey @wangshuangyi,

it seems that you first created the grenepipe environment with conda, and are now installing mamba from within that environment? That indeed could be slow - it's faster to install mamba first, just as a normal step in conda withing any grenepipe, and then create the grenepipe environment from there, as documented here. That should work faster.

As for naming the environments: That is not something that snakemake uses. If you create all the individual tool environments manually, snakemake won't know about it, and won't use them, so that would not help you. Instead, get mamba to work as documented, install and activate the grenepipe environment from there, and let snakemake take care of the rest ;-)

Hope that helps, so long Lucas

wangshuangyi commented 10 months ago

Thank you very much for your reply. I have solved the problem of mamba, but as shown below, this command is often interrupted due to my network environment, may I ask whether I can re-run this command after the interruption? Also, I notice that when I run snakemake --use-conda --conda-frontend mamba --cores 4 --directory example/, each yaml will generate a different file after completion under path/grenepipe-0.12.2/example/.snakemake/conda/. If I execute a different project, do I need to run $snakemake --use-conda --conda-frontend mamba --cores 4 --directory xxx/?

lczech commented 10 months ago

Hi @wangshuangyi,

Thank you very much for your reply. I have solved the problem of mamba,

Very good!

but as shown below, this command is often interrupted due to my network environment, may I ask whether I can re-run this command after the interruption?

That is a more general conda/mamba question. If any install step fails, you might need to delete the env first again before re-trying (conda env remove --name env_name), but I'd talk with your network administrator to fix your network instead.

Also, I notice that when I run snakemake --use-conda --conda-frontend mamba --cores 4 --directory example/, each yaml will generate a different file after completion under path/grenepipe-0.12.2/example/.snakemake/conda/.

Yes, for some reason, snakemake always installs the environments locally in the directory where you run your analysis (the one specified via --directory). This is of course time- and space-consuming and unnecessary, and so you can use this trick to instead re-use the environments once you have them installed.

If I execute a different project, do I need to run $snakemake --use-conda --conda-frontend mamba --cores 4 --directory xxx/?

Yes, see here and here.

I'd recommend to read the whole wiki. That might answer most of your questions. If not, let me know.

Cheers Lucas

lczech commented 8 months ago

Dear @wangshuangyi,

any update on this, or can be close the issue?

Cheers Lucas

lczech commented 6 months ago

Closing the issue now, but feel free to re-open if this is still and issue.

lczech commented 4 months ago

For anyone finding this in the foreseeable future: We currently recommend to use micromamba to get started with grenepipe and install the general grenepipe conda environment. That seems to be the easiest and most stable, as of now.