BAMboozle.py is a tool that can remove genetic variation from sequencing reads stored in BAM file format to protect the privacy and genetic information of donor individuals.
BAMboozle.py is available through PyPI. To install, type the following command line, and add -U
for upgrading:
pip install BAMboozle
Alternatively, you can install from this GitHub repository for the latest version:
pip install git+https://github.com/sandberg-lab/dataprivacy
Add --user
if you don't have write permissions in your default python folder.
BAMboozle.py requires only an aligned .bam file and the reference genome in fasta format.
Your fasta file should be indexed (samtools faidx
).
The .bam file should be coordinate sorted and indexed, however BAMboozle.py
will try to do this for you if not.
usage: BAMboozle [-h] [--bam FILENAME] [--out FILENAME] [--fa FILENAME]
[--p P] [--strict] [--keepsecondary] [--keepunmapped]
optional arguments:
-h, --help show this help message and exit
--bam FILENAME Path to input BAM file
--out FILENAME Path to output bam file
--fa FILENAME Path to genome reference fasta
--p P Number of processes to use
--strict Strict: also sanitize mapping score & auxiliary tags (eg. AS / NH).
--keepsecondary Keep secondary alignments in output bam file.
--keepunmapped Keep ummapped reads in output bam file.
BAMboozle sanitizes sequence reads to provide privacy protection and facilitate data sharing.
The BAMboozle procedure involves modification of the observed read sequence to the reference genome sequence and sanitation of auxiliary tags.
Here is an overview of the sequence correction strategy:
Donor-related information could also be inferred from standard bam fields and auxiliary tags:
In --strict
mode, the following tags are also changed:
The output bam file also will contain a @PG
line reflecting the invoked command line call.
Ziegenhain, C., Sandberg, R. BAMboozle removes genetic variation from human sequence data for open data sharing. Nat Commun 12, 6216 (2021). https://doi.org/10.1038/s41467-021-26152-8 https://www.nature.com/articles/s41467-021-26152-8
Help! I am getting the following error message: ERROR: Could not find a version that satisfies the requirement BAMboozle (from versions: none) ERROR: No matching distribution found for BAMboozle
Make sure that you are using pip from a python3 installation! Try pip3 install BAMboozle
instead.