BaseCounter counts the bases from genes and transcripts and outputs information on the counts in exonic and intronic regions as well as information on the counts on the sense and antisense strands.


BaseCounter 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 BaseCounter here. To generate the usage run:

java -jar <BaseCounter_jar> --help


BaseCounter takes a refflat file and a bam file. Also an output directory needs to be specified. Optionally a prefix for the output files can be specified.

This tool produces a number of tab-seperated output files in the specified output directory. Each of these files contains the base counts for a different type of feature (exon, intron, gene, transcript or meta-exon) or a different strandedness (normal, sense or anti-sense).

For the gene and transcript output an "exonic" and "intronic" output is also generated. These contain the counts for only the exonic regions of a gene/transcript and only the intronic counts for a gene/transcript.

For the exon and intron output a "merge" output is also generated. In these files the counts are given, in which overlapping exons within a gene are considered one exon.

Meta-exons are the exons split into separate features based on the overlap of exons between transcripts and genes.


To count the bases in bamfile.bam usin the regions specified by refflatfile.refflat:

java -jar <BaseCounter_jar> \
-r refflatfile.refflat \
-b bamfile.bam \
-o output_dir \
-p prefix


Usage for BaseCounter:

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
--refFlat, -r yes no refFlat file. Mandatory
--outputDir, -o yes no Output directory. Mandatory
--bam, -b yes no Bam file. Mandatory
--prefix, -p no no The prefix for the output files


BaseCounter 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 BaseCounter can be found here. We welcome any contributions. Bug reports, feature requests and feedback can be submitted at our issue tracker.

BaseCounter 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 BaseCounter. We have had good results with this IDE.


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