Skip to main content

A Boolean Algebra for Genetic Variants

Project description


A Boolean Algebra for Genetic Variants

A set of Boolean relations: equivalence; containment, i.e., either a variant is fully contained in another or a variant fully contains another; overlap, i.e., two variants have (at least) one common element; and disjoint, i.e., no common elements that allows for a comprehensive classification of the relation for every pair of variants by taking all minimal Longest Common Subsequence (LCS) alignments into account.

Jonathan K. Vis, Mark A. Santcroos, Walter A. Kosters and Jeroen F.J. Laros. "A Boolean Algebra for Genetic Variants." (2021)


Use pip to install from the Python Package Index (PyPI).

python -m pip install mutalyzer-algebra

Or directly from GitHub for development (after cloning in an active virtual environment).

python -m pip install --upgrade --editable .[dev]


Run the tests.

python -m coverage run -m pytest


Use the command-line interface.

algebra --reference "AAAAA" compare --lhs-hgvs "1_2insTA" --rhs-hgvs "2_3insT"

Or as a Python package.

from algebra import compare
from algebra.variants import parse_hgvs

reference = "AAAAA"
lhs = parse_hgvs("1_2insTA")
rhs = parse_hgvs("2_3insT")

# returns: Relation.DISJOINT
compare(reference, lhs, rhs)

reference = "CATATATC"
lhs = parse_hgvs("2_7AT[4]")  # observed: CATATATATC
rhs = parse_hgvs("5_6insT")   # observed: CATATTATC

# returns: Relation.CONTAINS
compare(reference, lhs, rhs)

See Also

A web interface with integration with Mutalyzer: Mutalyzer Algebra

Mutalyzer Algebra on PyPI

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mutalyzer-algebra-1.2.0.tar.gz (15.5 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page