Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run the workflow step by step #38

Open
thibaulttabarin opened this issue Aug 15, 2022 · 8 comments
Open

Run the workflow step by step #38

thibaulttabarin opened this issue Aug 15, 2022 · 8 comments
Assignees

Comments

@thibaulttabarin
Copy link
Member

We need documentation on how to run the workflow step by step or on specific rule, mainly for development purpose.

@johnbradley
Copy link
Contributor

@thibaulttabarin I put together a rough attempt at explaining how to run each step one at a time here:
https://github.com/hdr-bgnn/BGNN_Snakemake/blob/38-step-by-step/DEVELOPMENT.md. Am I on the right track, or is there some nuance I am missing? Thanks.

@thibaulttabarin
Copy link
Member Author

thibaulttabarin commented Aug 23, 2022

@johnbradley, Sounds good, but how you would process the whole dataset for a single rule... Let say I want to reprocess all the images (from Images/) with an updated version of generate_metadata and check the result before I produce the whole set of results (Cropped/, Segmented/, Morphology/). How would you do that? In your documentation, there is only the option of reprocessing a single input/output.

@johnbradley
Copy link
Contributor

@thibaulttabarin The most direct way to run the workflow through a step is using the --until <stepname> snakemake command line argument. For example:

snakemake -c1 --use-singularity --config list=List/list_test.csv --until generate_metadata

See --until in https://snakemake.readthedocs.io/en/stable/executing/cli.html.


Alternatively if you just want to process some of the files until this step you can specify multiple targets as well:

snakemake -c1 --use-singularity --config list=List/list_test.csv -- Metadata/INHS_FISH_14841.json Metadata/INHS_FISH_38136.json

I would note that the files being generated are based on the contents of --config list=List/list_test.csv and not whatever files happen to reside in Images/.

@johnbradley
Copy link
Contributor

I updated the DEVELOPMENT documentation with the --until argument: https://github.com/hdr-bgnn/BGNN_Snakemake/blob/38-step-by-step/DEVELOPMENT.md#stop-early

@thibaulttabarin
Copy link
Member Author

it doesn't work as expected... only run one file and stop... and after that it throws this error
Using shell: /usr/bin/bash
Provided cores: 4
Rules claiming more threads will be scaled down.
Traceback (most recent call last):
File "/users/PAS2136/thibaulttabarin/.conda/envs/snakemake/lib/python3.10/site-packages/snakemake/init.py", line 726, in snakemake
success = workflow.execute(
File "/users/PAS2136/thibaulttabarin/.conda/envs/snakemake/lib/python3.10/site-packages/snakemake/workflow.py", line 1083, in execute
logger.run_info("\n".join(dag.stats()))
File "/users/PAS2136/thibaulttabarin/.conda/envs/snakemake/lib/python3.10/site-packages/snakemake/dag.py", line 2377, in stats
"min threads": min(min_threads.values()),
ValueError: min() arg is an empty sequence

@thibaulttabarin
Copy link
Member Author

ok it worked after remove the last folder Morphology/

@johnbradley
Copy link
Contributor

johnbradley commented Aug 23, 2022

@thibaulttabarin I think you hit this bug: snakemake/snakemake#1815. It sounds like there is a problem if you run with --until when there is nothing to be done.

@thibaulttabarin
Copy link
Member Author

yep, I agree, sounds like it. For this step by step part I feel it doesn't work the way I_would_like/it_is_conveniant_to_develop_with... Let talk about tomorrow at the meeting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants