This tool will count the alleles in multiple bam files. It's posible to count alleles for each separated readgroup. This can be used for quality checks.


CountAlleles requires Java 8 to be installed on your device. Download Java 8 here or install via your distribution's package manager.

Download the latest version of CountAlleles here. To generate the usage run:

java -jar <CountAlleles_jar> --help


This tool require that in the bam files the readgroups are setup correctly to detect the sample and readgroup names. The input and output vcf file can be compressed, this is auto detected by the file extension.

Readgroup calling is optional and can be enabled with --outputReadgroups.


Default run with 1 bam file:

java -jar <CountAlleles_jar> \
-R <reference_fasta> \
-I <input_vcf> \
-o <output_vcf> \
-b <input_bam>

Run with readgroups:

java -jar <CountAlleles_jar> \
-R <reference_fasta> \
-I <input_vcf> \
-o <output_vcf> \
-b <input_bam> \


Usage for CountAlleles:

Option Required Can occur multiple times Description
--log_level, -l no no Level of log information printed. Possible levels: 'debug', 'info', 'warn', 'error'
--help, -h no no Print usage
--version, -v no no Print version
--inputFile, -I yes no input VCF filename
--outputFile, -o yes no output VCF filename
--bam, -b no yes (unlimited) bam file, from which the variants (VCF files) were called
--bamList no yes (unlimited) bam file, from which the variants (VCF files) were called
--min_mapping_quality, -m no no minimum mapping quality score for a read to be taken into account
--referenceFasta, -R yes no reference fasta
--outputReadgroups no no Output each readgroup separated


CountAlleles is part of BIOPET tool suite that is developed at LUMC by the SASC team. Each tool in the BIOPET tool suite is meant to offer a standalone function that can be used to perform a dedicate data analysis task or added as part of BIOPET pipelines.

All tools in the BIOPET tool suite are Free/Libre and Open Source Software.


The source code of CountAlleles can be found here. We welcome any contributions. Bug reports, feature requests and feedback can be submitted at our issue tracker.

CountAlleles is build using sbt. Before submitting a pull request, make sure all tests can be passed by running sbt test from the project's root. We recommend using an IDE to work on CountAlleles. We have had good results with this IDE.


For any question related to CountAlleles, please use the github issue tracker or contact the SASC team directly at: