Sign inSign up

bbeckleyhub/kleboscope

By bbeckleyhub

•Updated 2 months ago

Image
0

990

bbeckleyhub/kleboscope repository overview

⁠🧬 What is Kleboscope?

Kleboscope is a comprehensive bioinformatics pipeline for complete genomic characterization of Klebsiella pneumoniae. It integrates seven core analysis modules into a single automated workflow:

  • FASTA QC – Assembly statistics and quality control
  • MLST – Multi‑Locus Sequence Typing (Pasteur scheme)
  • Kaptive – Capsule (K) and lipopolysaccharide (O) locus typing
  • AMR Profiling – Resistance gene detection (AMRFinderPlus)
  • ABRicate – Multi‑database screening (11 databases: CARD, ResFinder, VFDB, PlasmidFinder, BacMet2, etc.)
  • Environmental Co‑selection Markers – Biocide and heavy metal resistance genes
  • Ultimate Reporter – Gene‑centric interactive HTML report with pattern discovery

Perfect for clinical microbiology, outbreak investigations, and genomic surveillance.

📖 Full documentation, examples, and Conda installation instructions are available on the GitHub repository:
👉 https://github.com/bbeckley-hub/Kleboscope⁠


⁠📦 What’s inside this Docker image

  • Full Kleboscope pipeline (all modules)
  • All dependencies pre‑installed (Conda environment, Perl, BLAST, ABRicate, Kaptive, AMRFinderPlus, etc.)
  • ABRicate databases pre‑configured (abricate --setupdb already run)
  • jq installed for reliable JSON parsing (ensures correct summary generation)
  • No need for Conda, no manual setup, no “read‑only filesystem” errors

⁠🚀 Quick Start

⁠Pull the image
docker pull bbeckleyhub/kleboscope:latest
⁠Run on a single FASTA file
docker run --rm -v $(pwd):/data bbeckleyhub/kleboscope:latest -i "/data/genome.fna" -o /data/output

After the run, output files are owned by root on your host. To reclaim ownership:

sudo chown -R $USER:$USER ./output
⁠Run on all FASTA files in the current directory
docker run --rm -v $(pwd):/data bbeckleyhub/kleboscope:latest -i "/data/*.fna" -o /data/output

⁠📖 Detailed Usage

⁠Basic syntax
docker run --rm -v $(pwd):/data bbeckleyhub/kleboscope:latest [OPTIONS]
  • --rm : remove container after exit
  • -v $(pwd):/data : mount current directory to /data inside container
  • Input files must be under /data (e.g., /data/*.fna)
  • Output directory must also be under /data (e.g., /data/output)
⁠All Kleboscope options work
docker run --rm -v $(pwd):/data bbeckleyhub/kleboscope:latest \
  -i "/data/*.fna" -o /data/output \
  --threads 8 --skip-qc --skip-amr

See docker run --rm bbeckleyhub/kleboscope:latest -h for all options.

⁠Using custom threads
docker run --rm -v $(pwd):/data bbeckleyhub/kleboscope:latest \
  -i "/data/*.fna" -o /data/output -t 16

⁠🔧 Handling File Permissions (The “Padlock” Issue)

By default, Docker runs as root inside the container. Any files written to your mounted directory will be owned by root:root.
You have three options:

⁠1. Change ownership after the run (easiest)
sudo chown -R $USER:$USER ./output
⁠2. Run with your host user ID (requires a small code fix – coming soon)

Currently not fully supported because Kleboscope needs to write to its own installation directory. A future update will fix this.

See the Singularity section⁠ below.


⁠🧪 Testing Your Docker Setup

⁠Check help message
docker run --rm bbeckleyhub/kleboscope:latest -h
⁠Verify ABRicate databases are installed
docker run --rm --entrypoint /bin/bash bbeckleyhub/kleboscope:latest -c "abricate --list | head -5"

Expected output: list of databases (ncbi, card, vfdb, etc.)

⁠Verify jq is installed (important for correct JSON parsing)
docker run --rm --entrypoint /bin/bash bbeckleyhub/kleboscope:latest -c "jq --version"

Should output jq-1.6 or similar.


⁠🖥️ Singularity for HPC (no sudo, correct ownership)

On HPC clusters that support Singularity/Apptainer⁠, you can run Kleboscope without sudo and output files will be owned by your user automatically.

Important: Kleboscope writes temporary files inside its own installation directory (e.g., /opt/kleboscope/...). Singularity mounts containers as read‑only by default, so you must add the --writable-tmpfs flag to allow these writes. The flag creates an ephemeral, writable overlay in memory – no permanent changes are made to the container.

⁠Option A: Direct pull (if network allows)
singularity pull kleboscope.sif docker://bbeckleyhub/kleboscope:latest
singularity run --writable-tmpfs -B $(pwd):/data kleboscope.sif -i "/data/*.fna" -o /data/output
⁠Option B: Convert from a local Docker image (when singularity pull fails)

If you encounter TLS timeouts or other network errors (common on some HPCs), convert an existing Docker image to a Singularity SIF file on a machine with Docker, then transfer the .sif file to the HPC.

Step 1 – on a machine with Docker (e.g., your laptop):

docker pull bbeckleyhub/kleboscope:latest
docker save bbeckleyhub/kleboscope:latest -o kleboscope.tar
singularity build kleboscope.sif docker-archive://kleboscope.tar

Now copy kleboscope.sif to your HPC home or project directory (e.g., using scp).

Step 2 – on the HPC (no sudo needed):

singularity run --writable-tmpfs -B $(pwd):/data kleboscope.sif -i "/data/*.fna" -o /data/output
⁠Explanation of flags
FlagPurpose
--writable-tmpfsCreates a temporary writable overlay – required for Kleboscope to write intermediate files to /opt/...
-B $(pwd):/dataBinds your current directory to /data inside the container (input files are read from here, output is written here)
-i "/data/*.fna"Input pattern – use quotes to prevent shell expansion on the host
-o /data/outputOutput directory (will appear as ./output on your host)
⁠Additional options

You can use any Kleboscope flag, e.g.:

singularity run --writable-tmpfs -B $(pwd):/data kleboscope.sif \
    -i "/data/*.fna" -o /data/output --threads 8 --skip-qc
⁠Verify it works

After a successful run, you will see output indicating each module completed. All result files in ./output will be owned by your HPC user – no sudo chown needed.


⁠📁 Output Structure

After a successful run, your output directory will contain:

output/
├── fasta_qc_results/               # Quality control reports per sample
├── mlst_results/                   # MLST results (Pasteur scheme)
├── kaptive_results/                # Capsule (K) and O locus typing
├── klebo_abricate_results/         # Multi-database screening (11 DBs)
├── klebo_amrfinder_results/        # AMR gene detection with risk levels
└── KLEBOSCOPE_ULTIMATE_REPORTS/    # 🎯 FINAL INTEGRATED REPORT
    ├── kleboscope_ultimate_report.html   # Interactive gene‑centric HTML dashboard
    ├── kleboscope_ultimate_report.json   # Complete data (machine‑readable)
    └── *.csv files for easy import into spreadsheets

The main interactive report is KLEBOSCOPE_ULTIMATE_REPORTS/kleboscope_ultimate_report.html.


⁠❓ Frequently Asked Questions

⁠Why are output files owned by root?

Docker containers run as root by default. Use sudo chown or Singularity to fix ownership.

⁠Can I use --user $(id -u):$(id -g)?

Not yet – Kleboscope currently needs to write into its own installation directory. A future update will remove this limitation.

⁠How large is the image?

Approximately 1–2 GB (includes Conda, all dependencies, ABRicate databases, and Kaptive).

⁠Can I run this on Windows / macOS?

Yes, with Docker Desktop. Mount paths must be absolute (e.g., -v /c/Users/name/data:/data on Windows Git Bash).

⁠Does it work on ARM (Apple Silicon)?

The image is built for linux/amd64. On Apple Silicon, Docker will use emulation (may be slower).


⁠📜 License & Citation

Kleboscope Docker image bundles the same tools as the Conda package. See the main README⁠ for third‑party licenses.

If you use Kleboscope in research, please cite:

@software{kleboscope2026,
  author = {Beckley Brown et. al},
  title = {Kleboscope: A gene‑centric, species‑optimized computational pipeline for comprehensive Klebsiella pneumoniae genomic surveillance},
  year = {2026},
  url = {https://github.com/bbeckley-hub/Kleboscope}
}


⭐ Star the project on GitHub if it helps your research!

Tag summary

Content type

Image

Digest

sha256:ac594cbf6…

Size

1.4 GB

Last updated

2 months ago

docker pull bbeckleyhub/kleboscope