Bacterial Genome Pipeline (BAGEP) is an automated and scalable workflow for downstream analysis of Whole genome sequencing of bacterial samples. It also generates a graphical interactive heatmap for the visulisation of SNPs and their positions across the genome.
BAGEP is hosted on github. Clone the pipeline with:
git clone https://github.com/idolawoye/BAGEP.git
The pipeline has only been tested to work on Linux OS - Ubuntu 16.04 and later versions. Earlier versions should work fine as long as the dependencies are properly installed.
For Microsoft Windows users, ensure you have Windows Subsystem for Linux installed.
Ensure you have the miniconda.
The best way to install the pipeline with all it's dependencies is creating a conda environment. To do that, navigate into the BAGEP directory using cd BAGEP
and run:
conda env create -f environment.yml
conda activate bagep
All dependencies should be rightly installed on the path of the workstation or server
Download and install Centrifuge database which is approximately 8 GB with the following steps
wget -c ftp://ftp.ccb.jhu.edu/pub/infphilo/centrifuge/data/p_compressed+h+v.tar.gz
mkdir $HOME/centrifuge-db
tar -C $HOME/centrifuge-db -zxvf p_compressed+h+v.tar.gz
export CENTRIFUGE_DEFAULT_DB=$HOME/centrifuge-db/p_compressed+h+v
rm -rf ~/miniconda3/envs/bagep/opt/krona/taxonomy
mkdir -p ~/krona/taxonomy
ln -s ~/krona/taxonomy/ ~/miniconda3/envs/bagep/opt/krona/taxonomy
ktUpdateTaxonomy.sh ~/krona/taxonomy
Ensure that the BAGEP environment is active before running and that you have set Centrifuge's database to global locations on your PC and Kraken's taxonomy.
Your paired end FASTQ files should have this format:
SampleName_R1.fastq.gz
and SampleName_R2.fastq.gz
If they occur as SampleName_pass_1.fastq.gz
and SampleName_pass_2.fastq.gz
You can rename them to the appropriate format by running:
snakemake -s rename.txt
All fastQ files (paired end reads) of same bacterial species should be saved in a fastq/ folder. The pipeline uses Snakemake to run the workflow by cleaning and trimming the files, antimicrobial resistance gene detection, taxonomic classification, calling variants, generating alignment files from the core and whole genome and constructing a phylogeny tree on either the core genome or whole genome using maximum likelihood. To run the pipeline, simply enter:
snakemake --config ref={users reference genome}
If you are familiar working on Linux, MacOS terminal or PowerShell, you can edit the shell command in the Snakefile in a text editor to change the parameters used in running particular steps. For example, to mask problematic positions such as repeats in the genome when generating core alignment with snippy-core, add --mask {BED file of sites to mask}
to the shell command of rule snippy_core
. Other steps such as Phylogenetics, Variant detection and AMR detection can be modified too. To view full options of an particular processing step, enter the name of the tool flagged with help. For example:
iqtree --help
Will list the options and parameters under IQ-TREE
Trimmed files will be deposisted in the fastp folder. A reference genome for mapping should be provided for the bacterial samples, either in .gbk or .fasta format.
Taxonomic visualization of individual isolate is found in taxonomy/fastq/. HTML files show interactive Krona plot of taxonomic classification in sequencing reads. An example is shown below
A TAB file named amr_output consisting of antimicrobial genes and coverage in the AMR database being used.
Alignment of core genomes will be deposited in the results/ directory as core.aln
, whole genome alignment in same directory as core.full.aln
TAB and VCF reports are also generated. If you wish to inspect individual variant reports it will be deposited in a folder with the name of the sample as a sub directory in fastq
The phylogeny tree is constructed using the aligned core/whole genomes (whole genomes by default), generating *.treefile
which can be visualised using any tree visualisation tool.
The SNP heatmap will generate an interative image in an HTML file named heatmap_output.html
. An example is shown below
conda deactivate
If you used BAGEP for your analysis, kindly cite the pipeline:
Olawoye IB, Frost SDW, Happi CT. 2020. The Bacteria Genome Pipeline (BAGEP): an automated, scalable workflow for bacteria genomes with Snakemake. PeerJ 8:e10121 https://doi.org/10.7717/peerj.10121