This tool can be used to downsample specific regions. Each region can have it own fraction to downsample.

All other reads will not be touched.


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

java -jar <DownsampleRegions_jar> --help


To run this tool a bam file and a bed file is required. The bed file should be formatted like this:

By setting --deviation the fraction can deviate from it randomly.


Single end example: java -jar --bamFile --bedFile --inputR1 --outputR1

Paired end example: java -jar --bamFile --bedFile --inputR1 --inputR2 --outputR1 --outputR2


Usage for DownsampleRegions:

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
--bamFile, -b yes no Input bam file
--bedFile, -L yes no Input bed file. 4e column defined the fraction
--inputR1 yes no Input R1 fastq
--inputR2 no no Input R2 fastq
--outputR1A yes no Output R1 fastq
--outputR2A no no Output R2 fastq
--outputR1B yes no Output R1 fastq
--outputR2B no no Output R2 fastq
--deviation no no Deviation of fractions
--seed no no Random seed


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

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


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