This repository contains FLARE, a Snakemake-based workflow for metagenomics and AMR (antimicrobial resistance) analysis.
Clone the repository and enter it:
git clone https://github.com/stalbrec/FLARE && cd FLARECreate and activate the Snakemake environment (replace the name if you prefer):
conda env create -f workflow/envs/snakemake.yaml -n snakemake
conda activate snakemakeNote: the workflow uses --use-conda so Snakemake will create per-rule envs from workflow/envs/ when needed.
Edit config/config.yaml and set at least:
samples: path to your FASTQ folder or asamples.tsvfileoutput_dir: directory for results
Filenames should include R1 and R2 (e.g. sample1_R1.fastq.gz).
You can use this dummy config as a starting point (this is the repository's default config/config.yaml):
# kraken2
kraken2_db: "/home/common-data/databases/kraken2_old"
kraken2_memory_mapping: true
# deeparg
deeparg_data: "/home/common-data/databases/deeparg"
# individual runs
samples: "/home/common-data/seq/testfiles/"
output_dir: "results-test"Short explanation of the keys:
kraken2_db: path to a Kraken2 database used for taxonomic classification.kraken2_use_tmpfs: if true, copy Kraken2 DB to tmpfs for speed (requires enough RAM).kraken2_tmpfs_path: path to tmpfs mount point for Kraken2 database.kraken2_memory_mapping: use memory-mapped files if supported.deeparg_data: path to DeepARG data directory.samples: path to your FASTQ folder orsamples.tsvfile (required).output_dir: directory where results will be written (required).
Edit the file with:
nano config/config.yaml# activate conda environment if not active already:
conda activate snakemake
# run the workflow
snakemakeRe-run the same command after fixing errors — Snakemake will skip completed steps.
- Check
logs/for rule-specific logs. - If conda envs fail, ensure
conda activate snakemakesucceeded.
If Snakemake complains about missing input files, make sure any paths you added in your config are also bound to the singularity runtime in workflow/profiles/default/config.yaml:
singularity_args: "--bind /absolute/path/to/some/data/path"The docker image is not accessible/gone and I need to switch to installing the conda environment on the system
Just go through all rules (i.e. in workflow/Snakefile and in all files in workflow/rules) and replace:
container:
"docker://ghcr.io/stalbrec/flare:latest"
with:
conda:
"../envs/metagen.yaml"