Skip to main content

Cython bindings and Python interface to Tantan, a fast method for identifying repeats in DNA and protein sequences.

Project description

🐍🔁 PyTantan Stars

Cython bindings and Python interface to Tantan, a fast method for identifying repeats in DNA and protein sequences.

Actions Coverage License PyPI Bioconda AUR Wheel Python Versions Python Implementations Source Mirror Issues Docs Changelog Downloads

🗺️ Overview

Tantan is a fast method developed by Martin Frith[1] to identify simple repeats in DNA or protein sequences. It can be used to mask repeat regions in reference sequences, and avoid false homology predictions between repeated regions.

PyTantan is a Python module that provides bindings to Tantan using Cython. It implements a user-friendly, Pythonic interface to mask a sequence with various parameters. It interacts with the Tantan interface rather than with the CLI, which has the following advantages:

  • no binary dependency: PyTantan is distributed as a Python package, so you can add it as a dependency to your project, and stop worrying about the tantan binary being present on the end-user machine.
  • no intermediate files: Everything happens in memory, in a Python object you control, so you don't have to invoke the Tantan CLI using a sub-process and temporary files.
  • better portability: Tantan uses SIMD to accelerate alignment scoring, but doesn't support dynamic dispatch, so it has to be compiled on the local machine to be able to use the full capabilities of the local CPU. PyTantan ships several versions of Tantan instead, each compiled with different target features, and selects the best one for the local platform at runtime.

🔧 Installing

PyTantan is available for all modern versions (3.6+), depending only on the scoring-matrices package, and optionally on the lightweight archspec package for runtime CPU feature detection.

It can be installed directly from PyPI, which hosts some pre-built wheels for Linux and MacOS, as well as the code required to compile from source with Cython:

$ pip install pytantan

Check the install page of the documentation for other ways to install PyTantan on your machine.

💡 Example

The top-level function pytantan.mask_repeats can be used to mask a sequence without having to manage intermediate objects:

import pytantan
masked = pytantan.mask_repeats("ATTATTATTATTATT")
print(masked)                 # ATTattattattatt

The mask symbol (and other parameters) can be given as keyword arguments:

import pytantan
masked = pytantan.mask_repeats("ATTATTATTATTATT", mask='N')
print(masked)                 # ATTNNNNNNNNNNNN

To mask several sequences iteratively with the same parameters, consider creating a RepeatFinder once and calling the mask_repeats method for each sequence to avoid resource re-initialization.

💭 Feedback

⚠️ Issue Tracker

Found a bug ? Have an enhancement request ? Head over to the GitHub issue tracker if you need to report or ask something. If you are filing in on a bug, please include as much information as you can about the issue, and try to recreate the same bug in a simple, easily reproducible situation.

🏗️ Contributing

Contributions are more than welcome! See CONTRIBUTING.md for more details.

📋 Changelog

This project adheres to Semantic Versioning and provides a changelog in the Keep a Changelog format.

⚖️ License

This library is provided under the GNU General Public License v3.0 or later. Tantan is developed by Martin Frith and is distributed under the terms of the GPLv3 or later as well. See vendor/tantan/COPYING.txt for more information.

This project is in no way not affiliated, sponsored, or otherwise endorsed by the Tantan authors. It was developed by Martin Larralde during his PhD project at the Leiden University Medical Center in the Zeller team.

📚 References

  • [1] Frith, Martin C. “A new repeat-masking method enables specific detection of homologous sequences.” Nucleic acids research vol. 39,4 (2011): e23. doi:10.1093/nar/gkq1212

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

pytantan-0.1.1.tar.gz (77.9 kB view hashes)

Uploaded Source

Built Distributions

pytantan-0.1.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (279.3 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

pytantan-0.1.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (256.5 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

pytantan-0.1.1-pp310-pypy310_pp73-macosx_10_9_x86_64.whl (197.2 kB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

pytantan-0.1.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (279.1 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

pytantan-0.1.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (256.3 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

pytantan-0.1.1-pp39-pypy39_pp73-macosx_10_9_x86_64.whl (197.0 kB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

pytantan-0.1.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (277.3 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

pytantan-0.1.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (257.2 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

pytantan-0.1.1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl (195.2 kB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

pytantan-0.1.1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (278.9 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

pytantan-0.1.1-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (258.2 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ ARM64

pytantan-0.1.1-pp37-pypy37_pp73-macosx_10_9_x86_64.whl (195.1 kB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

pytantan-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

pytantan-0.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.3 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

pytantan-0.1.1-cp312-cp312-macosx_11_0_arm64.whl (206.4 kB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

pytantan-0.1.1-cp312-cp312-macosx_10_9_x86_64.whl (241.5 kB view hashes)

Uploaded CPython 3.12 macOS 10.9+ x86-64

pytantan-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

pytantan-0.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.4 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

pytantan-0.1.1-cp311-cp311-macosx_11_0_arm64.whl (205.5 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

pytantan-0.1.1-cp311-cp311-macosx_10_9_x86_64.whl (243.6 kB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

pytantan-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pytantan-0.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.3 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

pytantan-0.1.1-cp310-cp310-macosx_11_0_arm64.whl (205.5 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pytantan-0.1.1-cp310-cp310-macosx_10_9_x86_64.whl (243.8 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

pytantan-0.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pytantan-0.1.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.3 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

pytantan-0.1.1-cp39-cp39-macosx_11_0_arm64.whl (206.1 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pytantan-0.1.1-cp39-cp39-macosx_10_9_x86_64.whl (244.3 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

pytantan-0.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pytantan-0.1.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.3 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

pytantan-0.1.1-cp38-cp38-macosx_11_0_arm64.whl (204.8 kB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pytantan-0.1.1-cp38-cp38-macosx_10_9_x86_64.whl (243.3 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

pytantan-0.1.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

pytantan-0.1.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.3 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ARM64

pytantan-0.1.1-cp37-cp37m-macosx_10_9_x86_64.whl (243.5 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

pytantan-0.1.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64

pytantan-0.1.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.3 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ ARM64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page