Closed ganiatgithub closed 1 year ago
Hey @ganiatgithub
I have used -e " --rerun-incomplete"
in the execution line for re-running the workflow. It will (in theory) start from a checkpoint. Sometimes it is good to delete the .snakemake
folder that it creates in your execution folder. So the line will go as:
metaphor execute -f metaphor_settings.yaml -c 20 -e " --rerun-incomplete"
I guess that if you change the -c
in the line you will rerun with that amount of cores.
Hi @ganiatgithub,
@camilogarciabotero that is correct. But unless you get an error message specifically saying you need it, there's no need to add the -e " --rerun-incomplete"
flag. Just run the pipeline like you would normally and it will continue from where it left off, assuming the outputs haven't been deleted.
Also, if I restart, can I increase cpu counts to speed thing up?
Yes, no problems with that.
By the way, if you are using a HPC/scheduler system, you may consider using a profile, such as this SLURM one, and turn the scheduler
setting to true
. This launches separate scheduler jobs for each of your tasks, which is usually better for scaling. I will see about adding a template profile so it's easier to configure Metaphor this way.
Please let us know what other questions you may have.
Thank you, Vini
Hey V,
The information for creating a profile and running from HPC is just what I needed, thank you so much. Is there any chance to include a particular example in the docs any time in the future? I'm trying to follow the information but it looks like it compromises several steps or at least several alternatives... What would be the most straightforward path for setting up a job?
Best, Camilo.
Many thanks both.
To proceed I would need to unlock the Snakefile by running the following:
snakemake --snakefile /home/gnii0001/.cache/snakemake/snakemake/source-cache/runtime-cache/tmpb36nl_hj/file/home/gnii0001/rp24/gaofeng/tools/Miniconda3/envs/metaphor/lib/python3.11/site-packages/metaphor/workflow/Snakefile --unlock
Before that I need to locate the Snakefile using:
find ~ -name Snakefile
Can you also help me understand how the profile approach will work in reality?
If I have 100 samples in my dataset, and I've set maximum 10 jobs to be run at a time. Will it handle 10 samples from beginning to end, then move on to the next? Or it would work in stages, i.e. finishing with qc of all samples them move on to assembly?
It would be much appreciated if you could provide some documentation for incorporating profiles.
To proceed I would need to unlock the Snakefile by running the following:
snakemake --snakefile /home/gnii0001/.cache/snakemake/snakemake/source-cache/runtime-cache/tmpb36nl_hj/file/home/gnii0001/rp24/gaofeng/tools/Miniconda3/envs/metaphor/lib/python3.11/site-packages/metaphor/workflow/Snakefile --unlock
Before that I need to locate the Snakefile using: find ~ -name Snakefile
That is correct. If Metaphor is interrupted involuntarily, it may require the unlock command to be ran. The --unlock
flag is also available directly from the Metaphor command:
metaphor execute -c 2 --unlock
If you do need to run Snakemake-specific flags, however, you can find the Metaphor executable by running:
metaphor config show --snakefile
Can you also help me understand how the profile approach will work in reality?
It is difficult to provide a single answer for that as every cluster configuration is different. For me, what works is opening a UNIX screen on my login node and running the Metaphor command from there with the scheduler profile. Some systems however have very strict limitations on login nodes, and you would need to submit the Snakemake process as a job to the scheduler as well. The profile I use is the one I linked in my comment above, but maybe you can try this one if you are working with SLURM: smk-simple-surm.
You run Metaphor exactly the same as you would normally, but you pass the -l
or --profile
flag pointing to the profile directory, and turn scheduler: true
in metaphor_settings.yaml
:
metaphor execute -c 20 -l <your-profile-directory>
If I have 100 samples in my dataset, and I've set maximum 10 jobs to be run at a time. Will it handle 10 samples from beginning to end, then move on to the next? Or it would work in stages, i.e. finishing with qc of all samples them move on to assembly?
This is random. Snakemake will calculate the execution DAG and if a job is not required by another, that is, they are independent, the order of their execution will be random. If you set max jobs to 10, it will always try to have 10 jobs at a time, and once one job finishes, the next one begins, as long as the specified resources allow that.
It would be much appreciated if you could provide some documentation for incorporating profiles.
Thank you for the feedback, I will try to do that. In the meantime, the documentation in the Snakemake configuration profiles (such as the cookiecutter one from the comment above and the smk-simple-slurm in this comment) should be able to help you.
Best, Vini
I am going to go ahead and close this issue as there appears to be no outstanding action points, but please don't hesitate to reopen it if you continue to have problems.
Thank you. Vini
Hello Vini,
I've been running metaphor for a large dataset. Due to a limit of wall time, my job was killed before finished. Here is my code for running:
Setting is as follows:
Currently, 26 out of 90 assemblies with megahit were completed. Is there a good way to restart from a check point?
Also, if I restart, can I increase cpu counts to speed thing up?
Many thanks and sorry if there's an obvious answer I've missed.