Install GATK4 with Conda for Variant Calling (macOS Apple Silicon)
Install GATK4 4.6.2.0 natively on an Apple Silicon Mac with conda, isolate it in its own environment, run the gatk wrapper, and fix common bioconda errors.
GATK4 (the Genome Analysis Toolkit, from the Broad Institute) is the reference suite for variant discovery in high-throughput sequencing data. Tools like HaplotypeCaller, Mutect2, and BaseRecalibrator, plus the whole Picard toolset, all live behind a single gatk command. Under the hood it is a Java program: the gatk wrapper is a thin Python script that launches java -jar on a bundled GATK jar.
That Java-plus-Python nature is exactly why you want it in its own conda environment. When you install GATK4 into an isolated env, conda pulls in a matching JDK and Python interpreter and pins them right next to the tool. The exact build you need lives inside the env, independent of whatever Java (or no Java) your system happens to have. Nothing on your Mac gets touched, and you can delete the whole thing with one command later.
This guide installs GATK4 4.6.2.0 natively on Apple Silicon (arm64) with conda.
Prerequisites
You need conda. If you have not set it up yet, follow our Miniconda on Apple Silicon guide first, then come back here. The machine used for this walkthrough runs macOS 26.5.2 on Apple Silicon with conda 25.5.1 and the fast libmamba solver.
We install using only the conda-forge and bioconda channels and pass --override-channels. This keeps the solver away from Anaconda's defaults channel, which sidesteps the Terms-of-Service prompt that otherwise blocks fresh installs.
TL;DR copy-paste install
# Create an isolated env with GATK4 pinned, using only conda-forge + bioconda
conda create -n bu-gatk4 --override-channels -c conda-forge -c bioconda gatk4=4.6.2.0
# Activate it and check the version
conda activate bu-gatk4
gatk --versionThat is the whole thing. The rest of this guide explains each step, shows the real solver output, and covers the errors you are most likely to hit.
Step 1: Create the environment
Give the environment a clear name (bu-gatk4 here), pin the version so the env is reproducible, and list conda-forge before bioconda. Channel order matters: gatk4 lives on bioconda, but its dependencies should come from conda-forge.
conda create -n bu-gatk4 --override-channels -c conda-forge -c bioconda gatk4=4.6.2.0On the test machine the solve completed in about 70 seconds and conda laid out the following plan. Note the platform line (osx-arm64) and the three headline packages: gatk4 itself, openjdk, and python.
### install gatk4 -> env bu-gatk4 : specs: gatk4 ###
Channels:
- conda-forge
- bioconda
Platform: osx-arm64
Collecting package metadata (repodata.json): done
Solving environment: done
## Package Plan ##
environment location: /opt/homebrew/Caskroom/miniconda/base/envs/bu-gatk4
added / updated specs:
- gatk4
The following packages will be downloaded:
package | build
---------------------------|-----------------
gatk4-4.6.2.0 | py310hdfd78af_1 374.0 MB bioconda
openjdk-25.0.2 | h258754b_0 189.9 MB conda-forge
python-3.10.20 |hac0b6dc_1_cpython 12.3 MB conda-forge
# ... (other packages trimmed)
------------------------------------------------------------
Total: 577.5 MB
The following NEW packages will be INSTALLED:
gatk4 bioconda/noarch::gatk4-4.6.2.0-py310hdfd78af_1
openjdk conda-forge/osx-arm64::openjdk-25.0.2-h258754b_0
python conda-forge/osx-arm64::python-3.10.20-hac0b6dc_1_cpython
# ... (other packages trimmed)
real 70.26
A few things worth reading off that plan:
gatk4isnoarch. It is a Java jar plus a Python wrapper, so it is not tied to any CPU architecture.openjdk-25.0.2came along automatically, built forosx-arm64. You did not have to install Java yourself; the env owns its own JDK.python-3.10.20(thepy310build tag) is pulled just to run the wrapper script.- The full download is about 577 MB; on disk the finished env is about 892 MB (measured with
du -sh; because conda hardlinks shared packages, the incremental cost of an extra env is usually less), most of it the GATK jar and the JDK.
Apple Silicon architecture note
GATK4 runs natively on Apple Silicon here. Because gatk4 is noarch, the only architecture-specific pieces are its dependencies, and both openjdk-25.0.2 and python-3.10.20 were installed as osx-arm64 builds in the plan above. No Rosetta, no x86_64 emulation.
You may see an old note on the anaconda.org page saying osx-64 support stopped at GATK 4.0.5.1. That refers to the pre-noarch, platform-specific builds and does not apply to the current 4.6.x packages, which run fine on arm64.
You only need a Rosetta fallback in one narrow case: GATK's deep-learning tools (such as CNNScoreVariants) rely on a separate TensorFlow-based Python env that has poor arm64 support. The core tools you use every day, HaplotypeCaller, Mutect2, BaseRecalibrator, and the Picard commands, do not need it. If you ever do need an emulated env, build it with:
# Only if a tool refuses to resolve on arm64 — creates an emulated osx-64 env
CONDA_SUBDIR=osx-64 conda create -n bu-gatk4-x64 --override-channels -c conda-forge -c bioconda gatk4=4.6.2.0Step 2: Verify the install
Activate the env and ask GATK for its version. The gatk wrapper prints the exact java -jar command it runs, then the version banner, which is a nice confirmation that the Python wrapper found the bundled jar and the JDK inside the env.
conda activate bu-gatk4
gatk --version java -Dsamjdk.use_async_io_read_samtools=false -Dsamjdk.use_async_io_write_samtools=true -Dsamjdk.use_async_io_write_tribble=false -Dsamjdk.compression_level=2 -jar /opt/homebrew/Caskroom/miniconda/base/envs/bu-gatk4/share/gatk4-4.6.2.0-1/gatk-package-4.6.2.0-local.jar --version
The Genome Analysis Toolkit (GATK) v4.6.2.0
HTSJDK Version: 4.2.0
Picard Version: 3.4.0
There it is: GATK v4.6.2.0, HTSJDK 4.2.0, Picard 3.4.0, all served from the jar inside the env at .../envs/bu-gatk4/share/gatk4-4.6.2.0-1/.
A couple more checks are worth knowing about. gatk --list prints every available tool, and java -version confirms the JVM is an arm64 build. To see where the command resolves from:
which gatk # should point inside .../envs/bu-gatk4/bin
gatk --list # lists HaplotypeCaller, Mutect2, and the rest
java -version # confirms the env's JDK (aarch64 / arm64 build)A minimal smoke test that exercises the wrapper, the JVM, and Picard end to end is to build a sequence dictionary from a tiny synthetic FASTA:
printf '>chr1\nACGTACGTACGTACGTACGTACGTACGTACGT\n' > ref.fasta
gatk CreateSequenceDictionary -R ref.fasta
ls ref.dictIf ref.dict appears, the full gatk -> java -> Picard path works.
Doc-grounded note: the gatk --version output above is copied verbatim from the real install on the test machine. The gatk --list, java -version, and CreateSequenceDictionary commands are shown for completeness, but their output was not captured in this run, so no output is reproduced for them here.
Common errors and fixes
| Error | Fix |
|---|---|
CondaToSNonInteractiveError / Terms of Service not accepted for defaults | Never touch the defaults channel. Use --override-channels -c conda-forge -c bioconda as shown, so the solver never reaches the ToS-gated channels. |
PackagesNotFoundError: gatk4 | You dropped the bioconda channel. gatk4 is not on conda-forge. Include both, conda-forge first: -c conda-forge -c bioconda. |
gatk: command not found | The env is not active. Run conda activate bu-gatk4, then confirm with which gatk. |
A JNI error / UnsupportedClassVersionError / java: command not found | The JDK is missing. It normally arrives with gatk4; if not, run conda install -n bu-gatk4 -c conda-forge "openjdk>=17" and re-check with java -version. |
DL tools (CNNScoreVariants) complain about a missing Python env or TensorFlow | Those need the separate gatkcondaenv, whose TensorFlow deps lack good arm64 support. Core tools do not need it; run DL tools in a linux-64 container instead. |
| Slow solve or unexpected versions | Pin the version (gatk4=4.6.2.0) and set conda config --set channel_priority strict. A mamba/micromamba solver is much faster. |
Managing the environment
Keeping everything scoped to bu-gatk4 means updates and cleanup never affect the rest of your system.
# Update GATK4 within the env (still avoiding the defaults channel)
conda update -n bu-gatk4 --override-channels -c conda-forge -c bioconda gatk4
# Export an exact, shareable snapshot of the env
conda env export -n bu-gatk4 > gatk4-env.yaml
# Remove the whole env when you no longer need it
conda remove -n bu-gatk4 --allThe exported YAML pins every package and build, so a collaborator can rebuild the identical env with conda env create -f gatk4-env.yaml.
Next steps
A variant-calling workflow rarely stops at GATK. You will almost always sort, index, and filter alignments alongside it, so install samtools and bcftools next. And if you want to understand the channel and env mechanics we relied on throughout this guide, read working with conda environments and bioconda channels.