diamond4py
This is python binding for diamond--a sequence alignment BLAST software implements in C++. Current base version is diamond v2.1.0.
install
- from source code
git clone https://github.com/GCS-ZHN/diamond4py.git
cd diamond4py
conda create -n diamond4py python=3.8
# zlib is required by diamond.
conda install -c anaconda zlib
pip install -v .
- from pypi
pip install diamond4py
Usage
from diamond4py import Diamond
# create a object
diamond = Diamond(
database="database.dmnd",
n_threads=4
)
# make db if you don't create it or just download one from websites
diamond.makedb("database.fasta")
print(diamond.version)
# print database statistic info
diamond.dbinfo()
# run blast for proteins
diamond.blastp(
query="test_proteins.fasta",
out="test_output"
)
Advanced usage.
Some parameter options are not implemented in current release, You could directly use it like this.
diamond.blastp(
query="test_proteins.fasta",
out="test_blastp_output",
outfmt=OutFormat.BLAST_TABULAR,
sensitivity=Sensitivity.DEFAULT,
top=5 # `--top` option is not directly defined
block_size=2.0 # `--block-size` is not directly defined
)
and you can global change the tabular output with customed title by
OutFormat.BLAST_TABULAR.with_extra_option(
"qseqid", "qstart",
"qend", "qlen", "sseqid"
) # it will change it globally
# call this will reset to default
OutFormat.BLAST_TABULAR.reset()
In fact, you can call the original C++ main method like this:
from .libdiamond import main
args = ['bastp', '--query', 'data.fasta', '--db', 'db.dmnd']
main(*args)
But it is not recommended because the original C++ api lacks necessary interface encapsulation and parameter checking. At the same time, it is not pythonic enough, and there is no parameter reminder during programming unless you read the original parameter document.
How to contrib
The core of python wrap is to use custom python methods and Diamond._build_options to
call the libdiamond.main method More convenient packaging.
Therefore, anyone can make customized extensions through the
above ideas. I maintains this project after work,
so I cannot make it in time Keep up to date with all
diamond developments. Everyone is welcome to submit PRs.
Metadata
Release files for diamond4py 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| diamond4py-0.0.6.tar.gz | 1.8 MB | Without provenance | Details for diamond4py-0.0.6.tar.gz |
Built distributions (wheels)
Total release size: 37.5 MB
Release files / diamond4py-0.0.6.tar.gz
| Download URL | diamond4py-0.0.6.tar.gz |
|---|---|
| Size | 1.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b1126ba457b5beb9d6093123d755dad75d221a910b6ce120be56121b2f995acc
|
|
BLAKE2b-256 checksum How to use checksums |
902ef9ffda4932761755ee2988bea2d010183c5f444b66f2de7d99ee68372488
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Release files / diamond4py-0.0.6-cp310-cp310-win_amd64.whl
| Download URL | diamond4py-0.0.6-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 4.6 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f0d90c1e7bbcefb8a75aa68950f14deed2dfa1f3e4833a338b5b25fde730d954
|
|
BLAKE2b-256 checksum How to use checksums |
8a406c9ef6e4e7b5f23b66ad45c6f262aae9125e719a89e251ab939eb4692d18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Release files / diamond4py-0.0.6-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
| Download URL | diamond4py-0.0.6-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl |
|---|---|
| Size | 5.7 MB |
| Tags | CPython 3.10 Linux glibc 2.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
e91e55e99173fb5e3aa245a9b99c9d279aa6edcb0c22dfcb1b4a0a8dffad0ad7
|
|
BLAKE2b-256 checksum How to use checksums |
3490350ea56e8682a5f23d378f743bb6784caa39847fc4c769d0de82d3980316
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Release files / diamond4py-0.0.6-cp39-cp39-win_amd64.whl
| Download URL | diamond4py-0.0.6-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 4.6 MB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
8b1a924b88e1b6912649f719330ad14f053a904a2681ca10f4f15ef8a5c9ca92
|
|
BLAKE2b-256 checksum How to use checksums |
50745a701dbf9b868dda2f39ae9a16b266f83ef7fad47aafb16ae0874b75ebf0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Release files / diamond4py-0.0.6-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
| Download URL | diamond4py-0.0.6-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl |
|---|---|
| Size | 5.7 MB |
| Tags | CPython 3.9 Linux glibc 2.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
7b00e3bb1e8ce1d077e54e6281d63fabf1f804b216b40a56eebdacafb0f93419
|
|
BLAKE2b-256 checksum How to use checksums |
94774ecf919e56cdff8dd71b96125a06cd2d87b8432b61b0c99d413317276a36
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Release files / diamond4py-0.0.6-cp38-cp38-win_amd64.whl
| Download URL | diamond4py-0.0.6-cp38-cp38-win_amd64.whl |
|---|---|
| Size | 4.6 MB |
| Tags | CPython 3.8 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d270b24c848c4765241e643b8dae18f520a0778cd852174c270fc5eea36b53a9
|
|
BLAKE2b-256 checksum How to use checksums |
dd5412417c217437b9b941a27b3fa33eb8b0676715767793e3248fe058167d0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Release files / diamond4py-0.0.6-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
| Download URL | diamond4py-0.0.6-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl |
|---|---|
| Size | 5.7 MB |
| Tags | CPython 3.8 Linux glibc 2.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
fb3ad34771fd75082f10e6d18ef5ad3522cefe6c2004b54c26ab0820be49082c
|
|
BLAKE2b-256 checksum How to use checksums |
a2aa1b6f5485d630c1a49db96e8ba2e0b1498bd912139eff66ecc3af0d09aecc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Release files / diamond4py-0.0.6-cp37-cp37m-win_amd64.whl
| Download URL | diamond4py-0.0.6-cp37-cp37m-win_amd64.whl |
|---|---|
| Size | 4.6 MB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
2a2f15fb8519439b1d2cd522106f438c411372b63904be6563c3955b79de0ca8
|
|
BLAKE2b-256 checksum How to use checksums |
531f3d5a3c9cba15065914bb954497356c324c07fa5f9182f9154978978a44ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.7
|
Security for diamond4py 0.0.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.