This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
DO NOT document program behavior, usage, features, or user-facing functionality in this file.
All user-facing documentation (how the program works, command-line options, file formats, examples, etc.) belongs EXCLUSIVELY in src/docs/, which is the source for the user's manual published at https://pcingola.github.io/SnpEff/.
This file (CLAUDE.md) is ONLY for developer guidance: build instructions, code architecture, and development workflows. Never duplicate or paraphrase user-facing documentation here.
SnpEff is a variant annotation and effect prediction tool for genomic variants. It's a Java-based bioinformatics application that analyzes VCF files and predicts the functional effects of genetic variants.
Documentation: https://pcingola.github.io/SnpEff/ (source files in src/docs/)
The project uses Maven for building and BDS (BigDataScript) for automation tasks.
# Build SnpEff JAR with dependencies
mvn clean compile assembly:single jar:jar
# The output JAR will be in target/SnpEff-5.2-jar-with-dependencies.jarUse the wrapper script that handles Java memory options:
# Using the wrapper script
./scripts/snpEff [options]
# Direct JAR execution
java -Xms1g -Xmx8g -jar snpEff.jar [options] -c snpEff.configThe main class is org.snpeff.SnpEff.
Tests use JUnit Jupiter (JUnit 5):
# Run all tests using Maven
mvn test
# Run specific test class
mvn test -Dtest=TestCasesVcf
# Run BDS-based integration tests
./src/bds/integration_test.bdsTest files are located in:
src/test/java/org/snpeff/snpEffect/testCases/unity/- Unit testssrc/test/java/org/snpeff/snpEffect/testCases/integration/- Integration teststests/- Test data files (VCF, FASTA, etc.)
org.snpeff- Main entry point and top-level commandsorg.snpeff.snpEffect- Core effect prediction engineConfig- Configuration management for genomes and databasesSnpEffectPredictor- Main predictor that analyzes variantsVariantEffect- Represents predicted effects on genes/transcriptscommandLine/- Command-line interface implementations for all subcommandsfactory/- Factories for building genome databases
org.snpeff.interval- Genomic intervals (genes, transcripts, exons, chromosomes)- Core genomic feature classes:
Gene,Transcript,Exon,Chromosome,Genome Marker- Base class for genomic intervalsVariant- Represents genetic variants
- Core genomic feature classes:
org.snpeff.vcf- VCF file parsing and manipulationVcfEntry,VcfFileIterator- Core VCF handling
org.snpeff.fileIterator- File format parsers (VCF, GFF, GTF, BED, GenBank, etc.)org.snpeff.outputFormatter- Output formatters for different formats
The main SnpEff class dispatches to subcommand implementations in org.snpeff.snpEffect.commandLine:
SnpEffCmdEff- Main annotation command (default: "ann")SnpEffCmdBuild- Build genome databases from GTF/GFF filesSnpEffCmdDownload- Download pre-built databasesSnpEffCmdDatabases- List available databases- And many more specialized commands
Configuration is managed through .config files in the config/ directory:
snpEff.config- Main configuration (symlink toconfig/snpEff.config)config/snpEff.core.config- Core configuration settingsconfig/snpEff.ENSEMBL_*.config- Ensembl genome configurations- Configuration files define genome data directories and database locations
Database building is orchestrated using BDS scripts (src/bds/make.bds):
# Build a specific genome database (requires genome data in data/ directory)
java -jar snpEff.jar build -v <genome_name>
# Download pre-built database
java -jar snpEff.jar download <genome_name>Genome data is expected in data/<genome_name>/ directory with:
genes.gtforgenes.gff- Gene annotationssequences.fa- Reference genome sequences
The project requires Java 21 (specified in pom.xml compiler configuration).
- Command pattern: Each SnpEff subcommand is implemented as a separate class implementing
CommandLineinterface - Iterator pattern: File parsers use iterator pattern for memory-efficient processing of large genomic files
- Factory pattern: Genome database factories handle different source formats (GTF, GFF, GenBank, EMBL)
- Serialization: Genome databases are pre-built and serialized to
.binfiles for fast loading
The file src/bds/make.bds is the main entry point for development tasks: building, testing, downloading genomes, building databases, creating distribution packages, and uploading releases. It uses BDS (BigDataScript), a DSL for running heavyweight pipelines. Run it from ~/snpEff/:
~/snpEff/make.bds [options]With no arguments, it builds the JAR files (equivalent to -make).
-make Build JAR files (snpEff.jar and SnpSift.jar)
-createConfig Create/regenerate the snpEff.config file
-createDocs Build documentation web pages from markdown (uses mkdocs)
-db Build all genome databases
-dbs <genome ...> Build specific genome databases by name
-dbTest Build databases needed for test cases
-distro Create distribution zip files (core + all database zips)
-distroCore Create only the core distribution zip
-test Run SnpEff and SnpSift test suites
-download Download all genome datasets
-downloadSet <set> Download one dataset. Sets: ensembl, ensemblBfmpp, ucsc, mane, pdb, dbsnp, dbnsfp, cytobands, jaspar, gwasCatalog, nextprot, clinvar, flybase
-downloadEnsembl <genome> Download a specific Ensembl genome (e.g. 'GRCh38.103'), requires -downloadEnsemblSpecies
-downloadEnsemblSpecies <species> Ensembl species name (e.g. 'Homo_sapiens'), must match Ensembl capitalization
-downloadMane Download MANE transcripts
-downloadNcbi <genome> Download genome from NCBI (also requires -ncbiId)
-ncbiId <id> NCBI genome ID (used with -downloadNcbi)
-downloadUcsc <genome> Download genome from UCSC
-uploadCore Upload core zip package to S3
-uploadDbs Upload all database zips from the zip/ directory to S3
-uploadDbNsfp Upload dbNSFP databases to S3
-uploadDev Upload development version to S3
-zipGenome <g ...> Create zip file for specific genome(s)
-awsProfile <name> AWS profile (default: 'snpeff')
-s3Bucket <name> S3 bucket (default: 'snpeff-public')
-s3DatabasesPath <path> S3 path for databases
-s3VersionsPath <path> S3 path for versioned releases
-s3HttpUrl <url> S3 HTTP URL
-ensemblRelease <int> Ensembl vertebrate release number (default: 115)
-ensemblBfmppRelease <int> Ensembl BFMPP release number (default: 57)
-maneGenome <string> MANE genome (default: 'GRCh38')
-maneReleases <string ...> MANE release versions
-maneSelect Use MANE 'select' version
-maneTrIdTypes <string ...> Transcript ID types: 'ensembl', 'refseq'
-flybaseRelease <string> Flybase release (default: 'FB2022_02')
-dbCompatibleVersions <string ...> List of database compatible versions
All paths are relative to ~/snpEff/:
build/-- build log filesdata/-- genome data and compiled databasesdb/-- external databases (nextProt, PDB, JASPAR, cytoBands, etc.)download/-- downloaded genome fileszip/-- database zip files for distribution
SnpSift is a companion tool developed in a separate repository but typically distributed together with SnpEff. The build script (scripts_build/make.sh) builds both tools.