Skip to content

A Python package for CD-HIT, clustering protein or nucleotide sequences.

License

Notifications You must be signed in to change notification settings

yuanx749/py-cdhit

Repository files navigation

py-cdhit

PyPI version Downloads Codacy Badge

A Python package for CD-HIT, clustering protein or nucleotide sequences.

This package provides a Python interface for CD-HIT (Cluster Database at High Identity with Tolerance), which has programs for clustering biological sequences with a very fast speed. Specifically, this package contains functions that run commands and read the output files, thus reducing the overhead of switching between languages and writing parsing code when using Python in the data analysis workflows.

Read the documentation here.

Usage

A simple example on Linux is provided below. See the notebook for more details.

from pycdhit import cd_hit, read_clstr

res = cd_hit(
    i="./docs/examples/apd.fasta",
    o="./docs/examples/out",
    c=0.7,
    d=0,
    sc=1,
)

df_clstr = read_clstr("./docs/examples/out.clstr")

Please visit CD-HIT's documentations for its installation and the options of commands.

Installation

First Install CD-HIT. Mamba is recommended. For example, to create an environment and install:

mamba create -n myenv python=3.10
mamba activate myenv
mamba install -c bioconda cd-hit cd-hit-auxtools

Then install this package from PyPI:

pip install py-cdhit

Development

Install from source after git clone:

cd py-cdhit
pip install -e '.[dev]'
pip install -r docs/requirements.txt
python -m pytest --cov-report term-missing --cov=pycdhit tests/

About

A Python package for CD-HIT, clustering protein or nucleotide sequences.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages