Skip to main content

PaReBrick: PArallel REarrangements and BReakpoints Identification Toolkit


Motivation

The high plasticity of bacterial genomes is facilitated by numerous mechanisms, including horizontal gene transfer and recombination via flanking repeats.
Genome rearrangements such as inversions, deletions, insertions, and duplications may occur independently in different strains, leading to parallel adaptation or phenotypic diversity.
Such rearrangements may be responsible for virulence, antibiotic resistance, and antigenic variation.
However, identifying these events often requires laborious manual inspection and verification of phyletic pattern consistency.

Methods and Results

Pipeline of tool

We present PaReBrick — a tool implementing an algorithm for identifying parallel rearrangements in bacterial populations.
We define "parallel rearrangements" as events that occur independently in phylogenetically distant bacterial strains and provide a formalization for calling these events.

The tool takes a collection of strains represented as sequences of oriented synteny blocks and a phylogenetic tree as input.
It identifies rearrangements, tests them for consistency with the tree, and ranks events by their parallelism score.
The tool also generates diagrams for each block of interest, facilitating the detection of horizontally transferred blocks, their extra copies, and any inversions involving duplicated blocks.

We demonstrated PaReBrick’s efficiency and accuracy, showing its potential for detecting genome rearrangements responsible for pathogenicity and adaptation in bacterial genomes.

Installation

PaReBrick can be installed using pip.
Please note that Python <= 3.8 is required (caused by dependencies). To create and activate a Python 3.8 environment using Conda, run the following commands:

conda create -n py38 python=3.8
conda activate py38

Then, install PaReBrick:

pip install PaReBrick

Now you can run the tool from any directory using PaReBrick (or parebrick).

Script Parameters

The main script of the project, which includes all modules, can be run from any location as a console tool.

Required Input

Important: Identifiers in the tree and blocks must match.

--tree/-t

Path to a phylogenetic tree in Newick format, parsable by the ete3 library.
For more information about supported formats, see the ete3 documentation.

--blocks_folder/-b

Path to a folder containing synteny blocks, generated by tools such as Sibelia or maf2synteny.
Refer to BLOCKS-OBTAIN.md for instructions on obtaining synteny blocks using SibeliaZ.

Optional Input

--labels/-l

Path to a CSV file with tree labels for visualization.
The file must contain two columns: strain and label.

--output/-o

Path to the output folder.
Default is ./parebrick_output.

Output

The output consists of three main folders:

  1. preprocessed_data — Contains all synteny blocks in infercars, GRIMM, and CSV formats, as well as genomes_lengths.csv, which lists the lengths of the provided genomes.
  2. balanced_rearrangements_output — Contains a stats.csv file with statistics of non-convex characters from balanced rearrangements, as well as folders (characters, tree_colorings) containing character representations in .pdf trees and .csv formats.
  3. unbalanced_rearrangements_output — Similar to the above, but for unbalanced rearrangements. Contains a stats.csv file and subfolders with tree renderings in .pdf and .csv formats.

Example Run and Data

Example data is available in the example-data folder.

How to Run the Example:

  1. Clone the repository:
git clone https://github.com/ctlab/parallel-rearrangements
  1. Navigate to the example data folder:
cd parallel-rearrangements/example-data/streptococcus_pyogenes
  1. Run PaReBrick using the example input:
PaReBrick -t input/tree.nwk -b input/maf2synteny-output -l input/labels.csv

Or, run with minimal required arguments (without labels):

PaReBrick -t input/tree.nwk -b input/maf2synteny-output

Citation

If you use PaReBrick in your research, please cite:

Alexey Zabelkin, Yulia Yakovleva, Olga Bochkareva, Nikita Alexeev, PaReBrick: PArallel REarrangements and BReakpoints identification toolkit, Bioinformatics, 2021; btab691, https://doi.org/10.1093/bioinformatics/btab691

Release files for PaReBrick 0.5.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PaReBrick 0.5.7
File Size Uploaded
PaReBrick-0.5.7.tar.gz 23.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PaReBrick 0.5.7
File Interpreter ABI Platform
PaReBrick-0.5.7-py3-none-any.whl Python 3 none any Details

Total release size: 51.0 kB

Release files / PaReBrick-0.5.7.tar.gz

Download URL PaReBrick-0.5.7.tar.gz
Size 23.0 kB
Tags Source
SHA-256 checksum
How to use checksums
87aea585e0bc340abad2a4a37d532b5be75872284cabf3c9ad0be83ef372f0e4
BLAKE2b-256 checksum
How to use checksums
a59a66cdd176ee86114736a927c1408bc1e5e8b1f46a065384d575facacf8142
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.19

Release files / PaReBrick-0.5.7-py3-none-any.whl

Download URL PaReBrick-0.5.7-py3-none-any.whl
Size 28.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3cdf9bbfe066d6cb3ba29c025db83b225a3c3842eab9a9617ae3e71b8d6c631e
BLAKE2b-256 checksum
How to use checksums
58c9fcc62b7f348705f61368aeccd5dc2c319ffcda311e9ed3b0097f6828c40c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.19

Release history Release notifications | RSS feed

This release

0.5.7 This release

2 release files

0.5.6

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page