A Nextflow pipeline for biosynthetic gene cluster (BGC) prediction and comparison.
It takes one or more genome assemblies, predicts BGCs with three tools (antiSMASH, DeepBGC, GECCO), and then compares the results with bgc-quast. Heavily inspired from nf-core/funcscan 3.0.0 framework.
| Requirement | Notes |
|---|---|
| Nextflow 25.10.5 | This exact version. For now the pipeline doesn't Run on the latest version of the Nextflow which is 26.04. |
| Docker | Must be installed and running. All tools run inside containers, so you don't install antiSMASH/DeepBGC/GECCO yourself. |
| antiSMASH database (v8) | Downloaded once, stored locally. See section 3. |
| DeepBGC database | Downloaded once, stored locally. See section 3. |
| Genome assemblies | Nucleotide FASTA files (.fasta or .fasta.gz). |
GECCO needs no external database — its model ships inside the container.
git clone <YOUR_REPO_URL> bgc_quast_ppl
cd bgc_quast_pplPin the Nextflow version in every terminal you run the pipeline from:
export NXF_VER=25.10.5Tip: run that line once per terminal session, before any nextflow command.
You need two databases on disk before running. Point the pipeline at them with absolute paths (full paths starting from /), not relative ones.
- antiSMASH v8 database → passed with
--bgc_antismash_db - DeepBGC database → passed with
--bgc_deepbgc_db
These are downloaded using each tool's own standard download command. The exact commands depend on the tool version, so follow the official instructions:
- antiSMASH: https://docs.antismash.secondarymetabolites.org/ (the database must match antiSMASH 8, which is why the folder is named
antismash_db_v8). - DeepBGC: https://github.com/Merck/deepbgc (
deepbgc download).
Once downloaded, note the full path to each, for example:
~/bgc_quast_ppl/db/antismash_db_v8
~/bgc_quast_ppl/db/deepbgc_db
You will pass these paths on the command line (shown below).
The input is a CSV file. The columns are:
| Column | Meaning |
|---|---|
sample |
A unique name for the genome (no spaces). |
fasta |
Path to the genome FASTA (.fasta or .fasta.gz). |
type |
Only needed in compare-to-reference mode. q = query, r = reference. Case does not matter (q/Q, r/R). |
The type column is not needed. A two-column sheet is enough:
sample,fasta
assembly_10,~/bgc_quast_ppl/data/assembly_10.fasta.gz
assembly_20,~/bgc_quast_ppl/data/assembly_20.fasta.gzYou must include the type column, with exactly one reference row (r) and one or more query rows (q):
sample,fasta,type
assembly_10,~/bgc_quast_ppl/data/assembly_10.fasta.gz,q
assembly_20,~/bgc_quast_ppl/data/assembly_20.fasta.gz,q
reference,~/bgc_quast_ppl/data/reference.fasta.gz,rThe reference row's sample name (here reference) is used as the reference label in the bgc-quast report.
You pick the mode with --bgc_quast_mode. Choose one per run.
| Mode | What it compares | When to use it |
|---|---|---|
compare-samples (default) |
The same tool across all your samples. You get one report per tool. | "How do my genomes compare to each other?" |
compare-tools |
The three tools against each other, per sample. You get one report per sample. | "For this genome, how do antiSMASH, DeepBGC, and GECCO differ?" |
compare-to-reference |
Your query genomes against one reference genome. QUAST runs automatically. | "How do my genomes' BGCs compare to a known reference?" |
Run from inside the bgc_quast_ppl directory. Replace the paths with your own.
export NXF_VER=25.10.5
nextflow run . \
-profile docker \
--input data/samplesheet.csv \
--outdir results \
--bgc_quast_mode compare-samples \
--bgc_antismash_db ~/bgc_quast_ppl/db/antismash_db_v8 \
--bgc_deepbgc_db ~/bgc_quast_ppl/db/deepbgc_db \
--max_cpus 4 \
--max_memory 24.GBSame command, change the mode:
--bgc_quast_mode compare-tools \Use a samplesheet that has the type column and one reference row (section 4):
export NXF_VER=25.10.5
nextflow run . \
-profile docker \
--input data/samplesheet_ref.csv \
--outdir results \
--bgc_quast_mode compare-to-reference \
--bgc_antismash_db ~/bgc_quast_ppl/db/antismash_db_v8 \
--bgc_deepbgc_db ~/bgc_quast_ppl/db/deepbgc_db \
--max_cpus 4 \
--max_memory 24.GBQUAST runs on its own in this mode — you do not set it up.
All optional. Defaults are shown.
| Option | Default | Meaning |
|---|---|---|
--max_cpus |
2 |
Most CPUs any single step may use. |
--max_memory |
8.GB |
Most memory any single step may use. |
--max_time |
24.h |
Time limit per step. |
Set these to fit your machine (e.g. --max_cpus 4 --max_memory 24.GB).
| Option | Effect |
|---|---|
--bgc_skip_antismash |
Skip antiSMASH. |
--bgc_skip_deepbgc |
Skip DeepBGC. |
--bgc_skip_gecco |
Skip GECCO. |
By default all three run.
antiSMASH runs in minimal mode by default (faster, core BGC detection only).
| Option | Effect |
|---|---|
--bgc_antismash_full |
Run the full analysis instead of minimal. |
--bgc_antismash_minimal |
Force minimal (this is already the default). |
Do not pass both at once — the pipeline stops with an error if you do.
| Option | Default | Meaning |
|---|---|---|
--bgc_quast_edge_distance |
100 |
Distance (bp) from a contig edge used to call a BGC "incomplete". |
--bgc_quast_min_bgc_length |
0 |
Ignore BGCs shorter than this. 0 = no minimum. |
--bgc_quast_merge_distance |
0 |
Merge BGCs closer than this. |
--bgc_quast_overlap_fraction |
0.9 |
Overlap fraction used when matching BGCs. |
--bgc_quast_output_bgcs |
false |
Also write the individual BGC sequences. |
--bgc_quast_quastdir |
— | Supply your own QUAST output directory (compare-to-reference only). QUAST is then skipped. |
--bgc_quast_debug |
false |
Print the raw error output on failure (for troubleshooting). |
Optional. Runs BiG-SCAPE on the antiSMASH predictions and adds gene cluster family (GCF) rows plus a Venn diagram to the antiSMASH bgc-quast report. compare-samples mode only. Off by default — with it off, the report is unchanged.
| Option | Default | Meaning |
|---|---|---|
--run_bigscape |
false |
Turn it on. Needs antiSMASH enabled. |
--bgc_bigscape_pfam |
— | Path to an existing Pfam-A.hmm file (not its folder). Leave unset to download it automatically. |
--bgc_bigscape_pfam_url |
Pfam 38.2 | Where to download Pfam from when --bgc_bigscape_pfam is not set. |
--bgc_bigscape_dir |
— | Supply your own finished BiG-SCAPE output directory. BiG-SCAPE is then skipped. |
--bgc_bigscape_cutoffs |
0.3,0.5,0.7 |
GCF distance cutoffs to compute. They fill the dropdown in the HTML report. |
--bgc_bigscape_cutoff |
0.3 |
Which cutoff the report table shows. Must be one of the above. |
--bgc_bigscape_classify |
none |
BiG-SCAPE binning mode. Only none is wired. |
Pfam. BiG-SCAPE cannot run without it. If you already have a Pfam-A.hmm, pass it with --bgc_bigscape_pfam and make sure the four pressed files (.h3f .h3i .h3m .h3p) sit beside it — run hmmpress Pfam-A.hmm once if they do not.
If you do not pass it, the pipeline downloads and presses Pfam for you. That is about 400 MB to download and roughly 4 GB of free disk once unpacked and pressed. Add --save_db to keep it under <outdir>/databases/pfam, otherwise it stays in the work directory and is downloaded again on a fresh run.
The Pfam release is pinned on purpose. Pfam version changes which domains are found, which changes BiG-SCAPE distances and can change the families, so pinning keeps results reproducible between runs.
Example:
nextflow run . \
-profile docker \
--input example_test_data/samplesheet.csv \
--outdir results \
--bgc_quast_mode compare-samples \
--run_bigscape \
--bgc_bigscape_pfam /ABS/PATH/db/pfam/Pfam-A.hmm \
--bgc_antismash_db /ABS/PATH/db/antismash_db_v8 \
--bgc_deepbgc_db /ABS/PATH/db/deepbgc_db \
--max_cpus 4 --max_memory 32.GB| Option | Default | Meaning |
|---|---|---|
--bgc_mincontiglength |
3000 |
Contigs shorter than this are filtered out before prediction. |
--save_annotations |
false |
Keep the intermediate gene-annotation files. |
Everything lands under the folder you gave to --outdir.
results/
├── bgc_quast/
│ ├── compare_samples/ # compare-samples mode
│ │ ├── antiSMASH/report.tsv
│ │ ├── DeepBGC/report.tsv
│ │ └── GECCO/report.tsv
│ ├── compare_tools/ # compare-tools mode
│ │ └── <sample>/report.tsv
│ ├── compare_to_reference/ # compare-to-reference mode
│ │ ├── antiSMASH/report.tsv
│ │ ├── DeepBGC/report.tsv
│ │ └── GECCO/report.tsv
│ ├── quast/ # only in compare-to-reference mode
│ └── bigscape/ # only with --run_bigscape; includes BiG-SCAPE's own index.html
├── databases/
│ └── pfam/ # only with --save_db; the downloaded and pressed Pfam
└── pipeline_info/ # run reports, timeline, and DAG diagram
Only the folder for the mode you ran will be present. The main results are the report.tsv files.
If a run stops partway, you can continue from where it left off by adding -resume:
nextflow run . -profile docker --input ... --outdir results -resumeKeep the same --outdir. Do not change database options on a -resume.
- "command not found: nextflow" — install Nextflow, then re-run
export NXF_VER=25.10.5. - Docker errors / nothing runs — make sure Docker is installed and running before you start.
- Wrong Nextflow version — this pipeline needs
25.10.5. Newer versions (26.04+) will fail. Always setexport NXF_VER=25.10.5. - Database errors from antiSMASH or DeepBGC — check the paths you passed are absolute (start with
/) and point to the correct folders. The antiSMASH database must be the v8 database. - A run failed and you want detail — add
--bgc_quast_debugto see the raw error message. - "Pipeline did NOT complete successfully" (red box) — the run finished but produced no comparison (for example, all contigs were shorter than
--bgc_mincontiglength, so nothing reached the tools). Check your input genomes.
# 1. one-time setup
git clone <YOUR_REPO_URL> bgc_quast_ppl
cd bgc_quast_ppl
# download antiSMASH v8 and DeepBGC databases (see section 3)
# 2. every run
export NXF_VER=25.10.5
nextflow run . \
-profile docker \
--input data/samplesheet.csv \
--outdir results \
--bgc_quast_mode compare-samples \
--bgc_antismash_db /ABS/PATH/db/antismash_db_v8 \
--bgc_deepbgc_db /ABS/PATH/db/deepbgc_db \
--max_cpus 4 \
--max_memory 24.GB