ARGifier is a Snakemake workflow for assembly-based detection and quantification of antibiotic resistance genes (ARGs) from paired-end metagenomic reads.
For each sample, ARGifier can:
- Trim paired-end reads with Trim Galore.
- Optionally remove host-derived reads with either Kraken 2 or BWA plus samtools.
- Assemble decontaminated reads with MEGAHIT or SPAdes.
- Optionally annotate assembled contigs with Prokka.
- Detect ARGs with Meta-MARC / mmarc.
- Extract non-overlapping ARG sequences from Meta-MARC hits.
- Quantify ARG abundance with either CoverM or Salmon.
- Add ARG ontology annotations and merge per-sample tables into a final summary table.
The pipeline implemented in snakefile can be summarized as follows:
ARGifier is an assembly-based workflow designed for shotgun metagenomic paired-end reads.
This point is important for manuscript interpretation:
- ARGifier is appropriate when reads can be assembled into contigs and ARG detection is followed by sequence extraction and abundance estimation.
- ARGifier is not a dedicated workflow for hybridization-capture datasets such as myBaits when the experimental design does not support contig assembly and downstream contig-based ARG context analysis.
- If your dataset is capture-enriched and you want read-level target recovery without assembly, the present workflow should be considered outside its intended scope unless you adapt the methodology accordingly.
ARGifier/
|-- snakefile
|-- env.yaml
|-- config/
| |-- config.yaml
| |-- config.wp1.yaml
| |-- config.poolseq.yaml
| |-- sample.config
| `-- sample.*.config
`-- scripts/
|-- extractARGSequences.py
|-- table_annotation.py
|-- validate_decontamination_db.py
|-- host_decontamination.kraken.sh
|-- host_decontamination.bwa.sh
`-- KrakenTools/
ARGifier was written for a Linux environment with Conda available.
The repository includes env.yaml, but the full workflow also expects several external command-line tools to be installed and available in PATH.
Core tools used by the workflow:
- Snakemake
- Trim Galore
- FastQC
- Kraken 2 or BWA
- samtools when using BWA-based decontamination
- MEGAHIT or SPAdes
- Prokka if
metamarc_target: prokka - Meta-MARC / mmarc
- CoverM or Salmon
- Python packages required by the helper scripts, including
pandasandbiopython
Clone the repository:
git clone https://github.com/EBosi/ARGifier.git
cd ARGifierCreate and activate the Conda environment:
conda env create -f env.yaml
conda activate spargifyInstall any workflow tools that are not already present in the environment on your system. A practical check is:
which snakemake trim_galore fastqc kraken2 bwa samtools megahit spades.py prokka mmarc coverm salmonNot every tool is needed for every run. For example:
bwaandsamtoolsare only needed for BWA-based decontamination.kraken2is only needed for Kraken-based decontamination.prokkais only needed whenmetamarc_target: prokka.covermorsalmonare alternatives, not both mandatory for a single run.
ARGifier expects paired-end FASTQ files and a sample sheet listing the files associated with each sample.
The sample sheet is a whitespace-delimited text file referenced by sample_config in the YAML configuration.
Minimal 3-column format:
Sample Index File
SAMPLE_A 1 /absolute/path/SAMPLE_A_R1.fastq.gz
SAMPLE_A 2 /absolute/path/SAMPLE_A_R2.fastq.gz
SAMPLE_B 1 /absolute/path/SAMPLE_B_R1.fastq.gz
SAMPLE_B 2 /absolute/path/SAMPLE_B_R2.fastq.gz
Example with a fourth column indicating samples to decontaminate:
#Sample Index File ToDeHost
SAMPLE_A 1 /absolute/path/SAMPLE_A_R1.fastq.gz 1
SAMPLE_A 2 /absolute/path/SAMPLE_A_R2.fastq.gz 1
SAMPLE_B 1 /absolute/path/SAMPLE_B_R1.fastq.gz 1
SAMPLE_B 2 /absolute/path/SAMPLE_B_R2.fastq.gz 1
Files in config/sample.wp1.config and config/sample.poolseq.config provide real examples.
The main run parameters are stored in YAML files under config/.
Important fields used by the workflow include:
OUTDIR: /absolute/path/to/output
sample_config: config/sample.wp1.config
host_decontamination: kraken
decontamination_db: /absolute/path/to/decontamination_db
metamarc_target: prokka
quantification_method: coverm
ARG_ontology: /absolute/path/to/mmarc_model_annotations.tsv
assembler: megahitOUTDIR: base output directory.sample_config: sample sheet listing paired-end FASTQ files.host_decontamination: decontamination strategy; expected values arekrakenorbwa.decontamination_db: Kraken 2 database directory or BWA reference genome, depending on the selected method.metamarc_target: sequence set used as input to Meta-MARC; expected values arecontigsorprokka.quantification_method: expected values arecovermorsalmon.ARG_ontology: path to the Meta-MARC annotation table, typicallymmarc_model_annotations.tsv.assembler: expected values aremegahitorspades.
The repository contains example configuration files:
Run the workflow with a chosen configuration file:
snakemake -s snakefile --configfile config/config.wp1.yaml --cores 8If you prefer to preview the execution graph before starting:
snakemake -s snakefile --configfile config/config.wp1.yaml --cores 8 -n -psnakemake \
-s snakefile \
--configfile config/config.wp1.yaml \
--cores 8Example settings for a common assembly-based run:
host_decontamination: kraken
assembler: megahit
metamarc_target: prokka
quantification_method: covermAlternative settings are possible:
host_decontamination: bwaassembler: spadesmetamarc_target: contigsquantification_method: salmon
The main outputs generated for each sample are:
OUTDIR/<sample>/trimmed/<sample>.trimmed.R1.fq.gzOUTDIR/<sample>/trimmed/<sample>.trimmed.R2.fq.gzOUTDIR/<sample>/trimmed/host_decontamination/<sample>.dehosted.R1.fq.gzOUTDIR/<sample>/trimmed/host_decontamination/<sample>.dehosted.R2.fq.gzOUTDIR/<sample>/assembly/<sample>.contigs.faOUTDIR/<sample>/assembly/prokka/OUTDIR/<sample>/ARGs/<sample>.final.tblout.scanOUTDIR/<sample>/ARGs/<sample>.ARGs.fastaOUTDIR/<sample>/quantification/<sample>.annotated.abundance.tsv
The workflow also produces a merged results table:
OUTDIR/results.table.tsv
*.contigs.fa: assembled contigs used for downstream ARG discovery.*.final.tblout.scan: merged Meta-MARC output across levels 1, 2, and 3.*.ARGs.fasta: extracted ARG sequences retained for quantification.*.annotated.abundance.tsv: abundance table with ARG ontology annotations added.results.table.tsv: concatenated table across samples.
The current implementation uses or expects the following external resources:
- A host-decontamination database for either Kraken 2 or BWA.
- A Meta-MARC ontology table, usually
mmarc_model_annotations.tsv. - Paired-end shotgun metagenomic FASTQ files for each sample.
To make a run easier to reproduce in a manuscript or methods supplement, report at least:
- The exact Git commit of ARGifier used.
- The YAML configuration file used for the run.
- The sample sheet used for the run.
- The versions of Snakemake and all external tools selected in that run.
- The decontamination database and Meta-MARC annotation table versions.
This README documents the workflow currently implemented in the repository. Users should be aware of the following:
- The pipeline assumes paired-end input reads.
- The workflow is assembly-based and therefore depends on successful contig generation.
- Several tools are called from
PATH, so environment validation before launch is recommended. - The repository currently ships example configuration files, but no bundled test dataset.
If you need concise manuscript wording, the implemented workflow can be described as:
The resistome of European coastal environments revealed by high-resolution targeted metagenomics in Oysters
If you use or adapt ARGifier, please open an issue or fork the repository to document changes for downstream users.
