Skip to content

broadinstitute/docker-centrifuger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Centrifuger

Build and Push Docker Image

Docker image for Centrifuger taxonomic classifier using Pixi package manager with Bioconda, including Picard tools for BAM→FASTQ conversion.

Packages

  • Centrifuger (v1.0.12+): Taxonomic classifier for metagenomic sequencing reads
  • Picard (picard-slim v3+): Java tools for BAM→FASTQ conversion via SamToFastq

Pull from GHCR

docker pull ghcr.io/broadinstitute/docker-centrifuger:latest

Available tags: latest, 1, 1.0, 1.0.0 (semver)

Build Locally

docker build -t centrifuger:latest .

Usage

Default (help)

docker run --rm centrifuger:latest

Centrifuger Classification

docker run --rm -v /path/to/data:/data centrifuger:latest \
    centrifuger -x /data/index -1 /data/reads_1.fq -2 /data/reads_2.fq -t 8 -o /data/results

BAM to FASTQ Conversion

docker run --rm -v /path/to/data:/data centrifuger:latest \
    picard SamToFastq I=/data/input.bam FASTQ=/data/R1.fq SECOND_END_FASTQ=/data/R2.fq

Interactive Shell

docker run --rm -it --entrypoint bash centrifuger:latest

WDL Pipeline Examples

BAM to FASTQ Task

task bamToFastq {
    File bam_file
    String output_prefix = "output"

    command {
        picard SamToFastq I=${bam_file} FASTQ=${output_prefix}_R1.fq SECOND_END_FASTQ=${output_prefix}_R2.fq
    }
    runtime {
        docker: "centrifuger:latest"
    }
    output {
        File fastq_r1 = "${output_prefix}_R1.fq"
        File fastq_r2 = "${output_prefix}_R2.fq"
    }
}

Centrifuger Classification Task

task classify {
    File fastq_r1
    File fastq_r2
    File centrifuger_index
    Int threads = 8

    command {
        centrifuger -x ${centrifuger_index} -1 ${fastq_r1} -2 ${fastq_r2} -t ${threads} > results.tsv
    }
    runtime {
        docker: "centrifuger:latest"
    }
    output {
        File results = "results.tsv"
    }
}

Available Commands

Command Description
centrifuger Taxonomic classification
centrifuger-build Build custom index
centrifuger-quant Quantification
picard SamToFastq BAM to FASTQ conversion

Entrypoint Behavior

The entrypoint activates the Pixi environment and uses exec "$@" to pass through any command:

# Default: runs centrifuger --help
docker run centrifuger:latest

# Explicit commands
docker run centrifuger:latest centrifuger-build --help
docker run centrifuger:latest picard SamToFastq --help

This design is ideal for WDL/CWL pipelines where the workflow engine specifies the command.

About

A docker image for Centrifuger, including picard tools to allow format conversions.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Contributors