vid1998
vid1998

Reputation: 71

Obtain actual --cores [N], --jobs [N], -j [N] value given from command line within the snakefile

How is it possible to access all configuration values and corresponding parameters passed by command line to snakemake, within the snakefile?

For example by running:

snakemake -p --use-conda -j 16 --snakefile ../../Snakefile --configfile pipeline-test.config.yaml

In particular I wish obtain the number of available cores within the snakefile to be able to perform some computation with that value.

Upvotes: 3

Views: 94

Answers (1)

Jan Schreiber
Jan Schreiber

Reputation: 233

You can use sys.argv within your snakefile to parse the command line parameters.

Upvotes: 1

Related Questions