Running the workflow#
Once your data is set up, perform a dry run of snakemake to see which rules and modules the workflow is configured to run. A dry-run does not actually run the workflow, but determines and prints to screen what will be run based on your configuration file and the current set of results.
-n indicates a dry run.
snakemake --cores 4 --use-conda -n
The --cores option sets the maximum number of CPU cores Snakemake may use in parallel. 4 is only an example, not a requirement. If you omit --cores, Snakemake will not assume a sensible machine-wide default for local execution, so you should set it explicitly.
For most laptops or desktops, --cores 4 is a safe starting point. On a larger workstation or server, a good rule is to use roughly all available cores or leave one free for responsiveness.
To see how many CPU cores your machine has, run nproc on Linux or sysctl -n hw.ncpu on macOS.
To run the workflow, for example on 4 cores:
snakemake --cores 4 --use-conda
If you wish to override using the standard config/config.yaml path, you can provide a config file at the command line as follows.
snakemake --cores 4 --use-conda --configfile myconfig.yaml
If you wish to check that AmpSeeker is configured correctly prior to running it on your dataset, you can run AmpSeeker on the test dataset. First, you will need to run resources/copy-resources-for-testing.sh from the root directory. Then, to run on the test dataset, use the following command:
snakemake --cores 4 --directory tests/snakemake/ --use-conda --configfile tests/snakemake/config/config_fastqauto.yaml --conda-prefix ../.snakemake/conda
If we dont add the conda-prefix snakemake will install all the conda environments in the tests/snakemake directory, which we dont want.
Running snakemake on a cluster
If you are running snakemake on a cluster which uses queuing systems, you may need to provide some extra parameters at the command line. See the snakemake documentation for more information.
For running the workflow with SLURM, please see the documentation here. Note that native SLURM support requires snakemake version 7.19 or higher.