Sign inSign up

bbeckleyhub/staphscope

By bbeckleyhub

โ€ขUpdated about 13 hours ago

Welcome to StaphScope Docker

Image
0

1.5K

bbeckleyhub/staphscope repository overview

โ ๐Ÿงซ StaphScope โ€“ Docker Edition

โ A species-optimized computational pipeline for rapid and accessible Staphylococcus aureus genotyping and surveillance

GitHub Docker Pulls Docker Image Size License: MIT Python 3.9+ Conda Downloads Version

โ ๐Ÿ“Œ What is StaphScope?

StaphScope is a complete, all-in-one pipeline for Staphylococcus aureus genomics:

  • MLST, spa typing, SCCmec typing โ€” two independent callers (CGE + RPet)
  • Capsule typing (cap5 / cap8) with completeness scoring
  • AMR profiling โ€” AMRFinderPlus with point mutations
  • Virulence & plasmid screening โ€” ABRicate across 10 databases
  • MGE profiling โ€” mobileOG-db (Beatrix-1.6) across 10 functional categories
  • FASTA QC + fastANI species confirmation
  • Three reporting layers โ€” comprehensive, gene-centric, sample-centric
  • Interactive Plotly dashboard โ€” 10 tabs, offline-capable, single file
  • Lineage prediction with 50 major S. aureus lineages

Everything is pre-installed. All databases (MLST scheme, AMRFinderPlus, ABRicate, mobileOG-db) and every tool (BLAST, DIAMOND, Prodigal, fastANI, agrVATE) are baked into the image. No --pull-mlst-db, no --update-amr-db, no abricate --setupdb โ€” pull and run.


โ ๐Ÿš€ Quick Start

# Pull the image
docker pull bbeckleyhub/staphscope:2.0.0

# Single genome (correct file ownership โ€“ no padlock)
docker run --rm \
  -u $(id -u):$(id -g) \
  -v "$(pwd):/data" \
  bbeckleyhub/staphscope:2.0.0 \
  -i "/data/my_genome.fna" -o /data/results

# Batch processing
docker run --rm \
  -u $(id -u):$(id -g) \
  -v "$(pwd):/data" \
  bbeckleyhub/staphscope:2.0.0 \
  -i "/data/*.fna" -o /data/results --threads 8

Why -u $(id -u):$(id -g)? Ensures all output files are owned by your host user โ€” no sudo chown, no padlock icons.


โ โœจ What's New in v2.0.0 (September 2026)

FeatureDescription
๐Ÿ“ฑ MGE moduleMobile genetic element profiling via mobileOG-db โ€” 10 functional categories (Integrase, Transfer, Stability, Phage, Replication, IS, ICE, Plasmid, Phage-assoc., Key MGE-signatures)
๐Ÿ’Š Capsule modulecap5 / cap8 serotype determination with completeness scoring
๐Ÿ›ก๏ธ SCCmec RPet callerIndependent second opinion from Robert A. Petit III's sccmec, side-by-side with CGE SCCmecFinder, with automatic naming-format normalization
๐Ÿงฌ fastANI species checkFASTA QC confirms species identity against the 95% ANI boundary
๐ŸŽจ Interactive Plotly dashboardTen tabs โ€” Overview, Typing, QC, AMR, Virulence, MGE, Resistance, Alerts, Story, Compare
โš–๏ธ Compare tabPairwise similarity verdict + typing diff + gene-content split, plus union-find cluster detection
๐Ÿ“„ Three reporting layersComprehensive + gene-centric + sample-centric (all in one folder)
๐Ÿงน Share-aware orchestratorModules resolve from $PREFIX/share/staphscope/modules/ โ€” works identically in conda, Docker, and Apptainer
๐Ÿ›ก๏ธ ENV HOME=/tmpFixes /root/.local permission errors for non-root users
๐Ÿ›ก๏ธ Full conda env activation in the entrypointLD_LIBRARY_PATH is set so AMRFinderPlus and other bioconda binaries work out of the box

Breaking changes from v1.x: module folder names changed (sccmec_module/ โ†’ sccmec_module_cge/, summary_module/ โ†’ gene_centric_module/). Visualization now reads CSVs and the master TSV, not HTML.


โ ๐Ÿ“ฆ Usage Examples

โ Basic single genome
docker run --rm \
  -u $(id -u):$(id -g) \
  -v "$(pwd):/data" \
  bbeckleyhub/staphscope:2.0.0 \
  -i "/data/SA001.fasta" -o /data/SA001_results
โ Batch with custom threads
docker run --rm \
  -u $(id -u):$(id -g) \
  -v "$(pwd):/data" \
  bbeckleyhub/staphscope:2.0.0 \
  -i "/data/*.fna" -o /data/batch_results --threads 16
โ Skip heavy modules (faster typing-only run)
docker run --rm \
  -u $(id -u):$(id -g) \
  -v "$(pwd):/data" \
  bbeckleyhub/staphscope:2.0.0 \
  -i "/data/*.fasta" -o /data/results \
  --skip-mge --skip-amr --skip-abricate --skip-visualization
โ Skip only the new v2.0.0 modules
docker run --rm \
  -u $(id -u):$(id -g) \
  -v "$(pwd):/data" \
  bbeckleyhub/staphscope:2.0.0 \
  -i "/data/*.fna" -o /data/results \
  --skip-mge --skip-capsule --skip-sccmec-rpet
โ AMR with custom thresholds and no mutations
docker run --rm \
  -u $(id -u):$(id -g) \
  -v "$(pwd):/data" \
  bbeckleyhub/staphscope:2.0.0 \
  -i "/data/*.fna" -o /data/results \
  --amr-min-identity 0.95 --amr-min-coverage 0.9 --skip-amr-mutations
โ Clean output directory before run
docker run --rm \
  -u $(id -u):$(id -g) \
  -v "$(pwd):/data" \
  bbeckleyhub/staphscope:2.0.0 \
  -i "/data/*.fna" -o /data/results --clean-output
โ Interactive shell (for debugging)
docker run --rm -it \
  -u $(id -u):$(id -g) \
  -v "$(pwd):/data" \
  bbeckleyhub/staphscope:2.0.0 bash

โ ๐Ÿ–ฅ๏ธ Singularity / Apptainer for HPC

On HPC clusters without Docker, use Singularity (or Apptainer โ€” same SIF format). Runs as your real UID automatically โ€” no -u, no -e HOME.

# 1. Load runtime + mksquashfs (needed only for pull)
module load containers/singularity/3.6.4   # or: module load apptainer
module load squashfs-tools/4.4             # only for the pull

# 2. Pull the image (one-time, needs internet on login node)
singularity pull staphscope_2.0.0.sif docker://bbeckleyhub/staphscope:2.0.0

# 3. Run โ€” always use `run`, not `exec`
singularity run --bind $(pwd):/data \
  staphscope_2.0.0.sif \
  -i "/data/*.fna" -o /data/output -t 16

Use singularity run, not singularity exec. The image's entrypoint sets up PATH and LD_LIBRARY_PATH for the conda environment. run invokes it; exec skips it and will break AMRFinderPlus.

โ SLURM job script
#!/bin/bash
#SBATCH --job-name=staphscope
#SBATCH --cpus-per-task=16
#SBATCH --mem=32G
#SBATCH --time=04:00:00

module load containers/singularity/3.6.4
cd $SLURM_SUBMIT_DIR

singularity run --bind $(pwd):/data \
  /path/to/staphscope_2.0.0.sif \
  -i "/data/*.fna" -o /data/output -t ${SLURM_CPUS_PER_TASK}

mksquashfs is only needed for the pull. Compute nodes only need Singularity.


โ ๐Ÿ“ Output Structure

results/
โ”œโ”€โ”€ Staphscope_final_report/                    # ๐Ÿ‘ˆ The folder you need
โ”‚   โ”œโ”€โ”€ staphscope_comprehensive_report.html
โ”‚   โ”œโ”€โ”€ staphscope_comprehensive_report.json
โ”‚   โ”œโ”€โ”€ staphscope_comprehensive_report.tsv    # Master typing TSV
โ”‚   โ”œโ”€โ”€ STAPHSCOPE_ULTIMATE_GENE_CENTRIC_REPORTS/
โ”‚   โ”‚   โ”œโ”€โ”€ staphscope_ultimate_gene_centric_report.html
โ”‚   โ”‚   โ”œโ”€โ”€ amr_genes.csv
โ”‚   โ”‚   โ”œโ”€โ”€ virulence_genes.csv
โ”‚   โ”‚   โ”œโ”€โ”€ bacmet_genes.csv
โ”‚   โ”‚   โ”œโ”€โ”€ plasmid_replicons.csv
โ”‚   โ”‚   โ”œโ”€โ”€ mutations.csv
โ”‚   โ”‚   โ”œโ”€โ”€ mge_profile.csv
โ”‚   โ”‚   โ”œโ”€โ”€ fasta_qc.csv
โ”‚   โ”‚   โ””โ”€โ”€ sample_overview.csv
โ”‚   โ””โ”€โ”€ STAPHSCOPE_ULTIMATE_SAMPLE_CENTRIC_REPORTS/
โ”‚       โ”œโ”€โ”€ staphscope_ultimate_sample_centric_report.html
โ”‚       โ””โ”€โ”€ staphscope_ultimate_sample_centric_report.json
โ”œโ”€โ”€ STAPHSCOPE_VISUALIZATIONS/                  # Interactive dashboard + static exports
โ”‚   โ”œโ”€โ”€ staphscope_dashboard.html              # โ† Plotly dashboard, single file
โ”‚   โ”œโ”€โ”€ PNG/  PDF/  SVG/  DATA/
โ”‚   โ””โ”€โ”€ staphscope_visualizations_bundle.zip
โ”œโ”€โ”€ mge_results/                                # Per-module outputs
โ”œโ”€โ”€ mlst_results/
โ”œโ”€โ”€ spa_results/
โ”œโ”€โ”€ sccmec_cge_results/
โ”œโ”€โ”€ sccmec_rpet_results/
โ”œโ”€โ”€ capsule_results/
โ”œโ”€โ”€ agr_results/
โ”œโ”€โ”€ staph_amrfinder_results/
โ”œโ”€โ”€ abricate_results/
โ”œโ”€โ”€ fasta_qc_results/
โ””โ”€โ”€ staphscope_run.log

Open in your browser:

  • Staphscope_final_report/STAPHSCOPE_ULTIMATE_GENE_CENTRIC_REPORTS/staphscope_ultimate_gene_centric_report.html
  • STAPHSCOPE_VISUALIZATIONS/staphscope_dashboard.html

โ ๐Ÿงช Test Drive with a Public Genome

mkdir -p test_data
wget -O test_data/SA.fna \
  https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/013/425/GCF_000013425.1_ASM1342v1/GCF_000013425.1_ASM1342v1_genomic.fna

docker run --rm \
  -u $(id -u):$(id -g) \
  -v "$(pwd)/test_data:/data" \
  bbeckleyhub/staphscope:2.0.0 \
  -i "/data/*.fna" -o /data/results --threads 4

firefox test_data/results/STAPHSCOPE_VISUALIZATIONS/staphscope_dashboard.html

โ ๐Ÿ› ๏ธ Build the Docker Image Yourself

git clone https://github.com/bbeckley-hub/staphscope-typing-tool.git
cd staphscope-typing-tool
docker build -t staphscope:custom .

The Dockerfile bakes in:

  • Full micromamba environment from environment.yml
  • abricate --setupdb
  • AMRFinderPlus database update
  • S. aureus MLST scheme (staphscope --pull-mlst-db)
  • Writable HOME=/tmp for non-root execution
  • Entrypoint that sets PATH and LD_LIBRARY_PATH for the conda env

โ โš™๏ธ Command Line Reference

FlagDescription
-i, --inputInput FASTA file(s) โ€” supports glob patterns like "*.fna"
-o, --outputOutput directory
-t, --threadsNumber of CPU threads (default: 2)
--skip-fasta-qcSkip FASTA QC + fastANI species confirmation
--skip-mlstSkip MLST typing
--skip-spaSkip spa typing
--skip-sccmecSkip SCCmec CGE typing
--skip-sccmec-rpetSkip SCCmec RPet typing
--skip-capsuleSkip capsule typing
--skip-agrSkip agr typing
--skip-amrSkip AMRFinderPlus
--skip-abricateSkip ABRicate
--skip-mgeSkip MGE profiling
--skip-lineageSkip lineage reference generation
--skip-comprehensiveSkip comprehensive + gene-centric reports
--skip-sample-centricSkip sample-centric report
--skip-visualizationSkip visualization dashboard
--amr-min-identityMinimum identity for AMR hits (0โ€“1)
--amr-min-coverageMinimum coverage for AMR hits (0โ€“1)
--skip-amr-mutationsDisable point mutation reporting
--abricate-minid / --abricate-mincovABRicate thresholds (default 80)
--clean-outputDelete output directory before starting
--keep-tempDo not delete temp directories (debugging only)

โ ๐Ÿงฐ Companion Toolkit โ€” iTOL Metadata Made Easy

We also built a companion toolkit that generates iTOL-ready annotation files from StaphScope outputs โ€” no Excel gymnastics required.

git clone https://github.com/bbeckley-hub/staphscope-toolkit.git
cd staphscope-toolkit
pip install -r requirements.txt

python staphscope_itol.py --input_dir /path/to/Staphscope_final_report

Drag the generated files into iTOLโ  โ€” that's it.

๐Ÿ”— github.com/bbeckley-hub/staphscope-toolkitโ 


โ ๐Ÿ› Troubleshooting

ProblemSolution
Permission denied / padlock iconsAdd -u $(id -u):$(id -g) to your docker run command
BUNDLED AMRfinderPlus not properly installed (Singularity)Use singularity run, not singularity exec
mksquashfs: executable file not found (Singularity pull)module load squashfs-tools/4.4 before singularity pull
Out of memoryAdd --memory="8g" to docker run
Permission denied: '/.local'Should be fixed by ENV HOME=/tmp โ€” make sure you're using the v2.0.0 image
manifest unknown on pullThe tag hasn't been pushed โ€” check https://hub.docker.com/r/bbeckleyhub/staphscope/tagsโ 
Cross-run contaminationUse --clean-output or delete the output dir between runs

For further help, open an issue on GitHubโ  or email [email protected]โ .


โ ๐Ÿ“š Citation

If you use StaphScope in your research, please cite:

Beckley, B., Amarh, V. (2026). StaphScope: a species-optimized computational pipeline for rapid and accessible Staphylococcus aureus genotyping and surveillance. BMC Genomics, 27:123. DOI: 10.1186/s12864-026-12609-xโ 

@article{beckley2026staphscope,
  title={StaphScope: a species-optimized computational pipeline for rapid and accessible Staphylococcus aureus genotyping and surveillance},
  author={Beckley, Brown and Amarh, Vincent},
  journal={BMC Genomics},
  volume={27},
  pages={123},
  year={2026},
  doi={10.1186/s12864-026-12609-x}
}

โ ๐Ÿ“„ License

MIT License โ€” see LICENSEโ  for details.


๐Ÿง StaphScope โ€” From reads to resistance, in minutes.
Made with โ˜• and ๐Ÿงฌ by Brown Beckley, University of Ghana Medical School

Tag summary

Content type

Image

Digest

sha256:a36c3bb40โ€ฆ

Size

1.8 GB

Last updated

about 13 hours ago

docker pull bbeckleyhub/staphscope