📘 Guide to Running the statgen-tools Docker Image

Instructions for accessing your data using Volume Mounting on Windows and Linux.

1. Image Repository Overview

StatGen Tools: Bioinformatics Analysis Environment

This image provides a comprehensive environment containing essential tools for statistical genetics, genomics data manipulation (VCF, BAM/SAM, BED), and quality control, built on Ubuntu 18.04.

📦 Image Content and Key Features

This container includes pre-compiled, widely-used bioinformatics utilities, ensuring a consistent and reproducible analysis workflow.

  • Operating System: Ubuntu 18.04 (Base Image).
  • Core Dependencies: Includes necessary packages like build-essential, git, zlib1g-dev, and various essential libraries (libssl-dev, libgsl0-dev, libperl-dev, etc.).
  • Bioinformatics Tools:
    • PLINK (Version from 20241022 asset): Essential for whole-genome association and linkage analysis.
    • VCFtools: For working with and manipulating VCF (Variant Call Format) files.
    • BCFtools: For variant calling and manipulating VCF/BCF files, compiled with GSL and Perl filter support.
    • SAMtools (v1.9): For manipulating alignments in SAM/BAM format.
    • HTSlib: Core library required by BCFtools and SAMtools for high-throughput sequencing data formats.
    • BEDOPS: A suite of tools for highly efficient set operations on genomic data in BED format.
🚀 Getting Started (Pulling the Image)

To download and use the latest version of this image:

docker pull <your-docker-username>/statgen-tools:latest
⚠️ Important Note on BEDOPS

While included, users should be aware that the version of **BEDOPS** installed in this container may **cause segmentation faults** during certain operations. Exercise caution or consider building a more recent version if BEDOPS is critical to your workflow.


2. Universal Command Syntax

To use your bioinformatics or statistical tools inside the statgen-tools image, you must run it as a container. Crucially, you need to use **Volume Mounting** (-v) to map your local data directory to a path inside the container.

The standard syntax is:

docker run -it --rm -v <HOST_PATH>:/data statgen-tools <COMMAND_TO_RUN>

Command Flags Breakdown

Flag Description Purpose
-it Interactive and TTY. Allows interaction and proper tool execution.
--rm Remove. Automatically cleans up the container when it exits.
-v Volume Mount. Maps host data to the container's file system (Critical).
:/data Destination folder inside the Container. All file references within the container must use /data/.

3. 🐧 Running on Linux (or Windows WSL)

Use standard Unix-style paths for the host volume.

Scenario: Your input data is located at /home/user/data/genetics.

Execution Command Example

docker run -it --rm -v /home/user/data/genetics:/data statgen-tools plink --bfile /data/input_file --out /data/results

4. 🖥️ Running on Windows (PowerShell/CMD)

When using Windows, you must ensure your file path uses the drive letter and **forward slashes** (/) for the host path.

Scenario: Your input data is located at C:\Users\User\ProjectData.

Execution Command Example

docker run -it --rm -v C:/Users/User/ProjectData:/data statgen-tools bcftools view -H /data/input.vcf

Important: Note the use of C:/Users/User/ProjectData (forward slashes and drive letter) for the Windows path.


5. Interactive Shell (Troubleshooting)

If you are unsure which command to run, you can run an interactive Bash shell inside the container to explore the installed tools and data files:

docker run -it --rm -v <HOST_PATH>:/data statgen-tools /bin/bash

Once inside, use ls /data to verify your host files are visible, and type exit to stop the container.