$ show broadinstitute/gatk
The Genome Analysis Toolkit (GATK4) is a production-grade bioinformatics framework developed by the Broad Institute for variant discovery and genotyping in high-throughput sequencing data. It provides a comprehensive suite of command-line tools for germline and somatic variant calling (HaplotypeCaller, Mutect2), copy number variation analysis (GermlineCNVCaller), structural variant detection (FindBreakpointEvidenceSpark), functional annotation (Funcotator), base quality score recalibration (BQSR), and read processing. The architecture is built around a plugin-style engine with walker base classes (ReadWalker, VariantWalker, LocusWalker) that define traversal patterns over genomic data, with extensive use of Apache Spark for distributed execution on clusters and cloud platforms (GCS, HDFS). Key entry points include the `gatk` wrapper script and individual tool classes registered via the Barclay argument parser, with workflows orchestrated through WDL/Cromwell pipelines. External dependencies include htsjdk for BAM/VCF I/O, BWA for alignment, PyMC3 for Bayesian CNV modeling, and PyTorch for deep learning-based variant scoring. The codebase is heavily tested with unit and integration tests, and supports both local and cloud-based execution.
The LLM identified 5 files worth highlighting for reuse:
Provides a library of composable read filters (e.g., MappingQualityReadFilter, FragmentLengthReadFilter) that can be chained using logical operators. The filter interface and composition pattern are isolated and reusable across any sequencing analysis pipeline, not just GATK. Demonstrates clean separation of concerns and testability.
Implements a hierarchical metrics collection framework that accumulates per-unit (e.g., per-sample, per-library, per-read-group) statistics. The collector pattern is generic and can be extracted for any domain requiring multi-level aggregation. Includes thread-safe accumulation and output formatting.
A custom hash map implementation for Apache Spark that uses hopscotch hashing and Kryo serialization for efficient distributed storage. Self-contained and optimized for genomic k-mer and interval lookups. Demonstrates advanced Java and Spark optimization techniques.
Provides a Java interface for Smith-Waterman local alignment with fallback implementations (Java, AVX native). The abstraction allows swapping alignment engines without changing client code. Reusable in any bioinformatics tool requiring pairwise sequence alignment.
A generic table writer for TSV/CSV output with support for headers, column types, and streaming. Paired with TableReader for symmetric I/O. The design is format-agnostic and can be extracted for any project needing structured tabular output.