No project description provided
Project description
quickdna
Quickdna is a simple, fast library for working with DNA sequences. It is up to 100x faster than Biopython for some translation tasks, in part because it uses a native Rust module (via PyO3) for the translation. However, it exposes an easy-to-use, statically typed API that should feel familiar for Biopython users.
# These are the two main library types. Unlike Biopython, DnaSequence and ProteinSequence are distinct,
# though they share a common BaseSequence base class
>>> from quickdna import DnaSequence, ProteinSequence
# Sequences can be constructed from strs or bytes, and are stored internally as ascii-encoded bytes
>>> d = DnaSequence("taatcaagactattcaaccaa")
# If no table=... argument is given, NBCI table 1 will be used by default...
>>> d.translate()
ProteinSequence(seq='*SRLFNQ')
# ...but any of the NCBI tables can be specified. A ValueError will be thrown for an invalid table.
>>> d.translate(table=22)
ProteinSequence(seq='**RLFNQ')
# This method will return a tuple of all possible reading frames (seq[:], seq[1:], and seq[2:])
>>> d.translate_all_frames()
(ProteinSequence(seq='*SRLFNQ'), ProteinSequence(seq='NQDYST'), ProteinSequence(seq='IKTIQP'))
# Sequences can be sliced just like regular strings, and return new sequence instances.
>>> d[3:9].translate()
ProteinSequence(seq='SR')
# This exists too!
>>> d[3:9].reverse_complement()
DnaSequence(seq='TCTTGA')
Benchmarks
For regular DNA translation tasks, quickdna is faster than Biopython. (See benchmarks/bench.py
for source)
task | time | comparison |
---|---|---|
translate_quickdna(small_genome) | 0.00306ms / iter | |
translate_biopython(small_genome) | 0.05834ms / iter | 1908.90% |
translate_quickdna(covid_genome) | 0.02959ms / iter | |
translate_biopython(covid_genome) | 3.54413ms / iter | 11979.10% |
reverse_complement_quickdna(small_genome) | 0.00238ms / iter | |
reverse_complement_biopython(small_genome) | 0.00398ms / iter | 167.24% |
reverse_complement_quickdna(covid_genome) | 0.02409ms / iter | |
reverse_complement_biopython(covid_genome) | 0.02928ms / iter | 121.55% |
Installation
Quickdna has prebuilt wheels for Linux (manylinux2010), OSX, and Windows available on PyPi.
Development
Quickdna uses PyO3
and maturin
to build and upload the wheels, and poetry
for handling dependencies. This is handled via
a Justfile
, which requires Just, a command-runner similar to make
.
Poetry
You can install poetry from https://python-poetry.org, and it will handle the other python dependencies.
Just
You can install Just
with cargo install just
, and then run it in the project directory to get a list of commands.
Flamegraphs
The just profile
command requires cargo-flamegraph, please see that repository for installation instructions.
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
Built Distributions
File details
Details for the file quickdna-0.1.3.tar.gz
.
File metadata
- Download URL: quickdna-0.1.3.tar.gz
- Upload date:
- Size: 25.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2389a88eb71d0c0307717af910db7ee5f8723cc5f367a47d6f51265937b518b |
|
MD5 | 7551de4e8c584e87ec1e8c7d4cae57ab |
|
BLAKE2b-256 | a808925af34a28529b1a1772b573721e6c41f5c26a17cbb10f4c160e556320c1 |
File details
Details for the file quickdna-0.1.3-cp310-none-win_amd64.whl
.
File metadata
- Download URL: quickdna-0.1.3-cp310-none-win_amd64.whl
- Upload date:
- Size: 108.4 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c3818e752370e45ece90079789ef5e1e496f6dc502815c41931dd8287992b0a |
|
MD5 | 7eef1aa4c4292b73a43b4811e485499b |
|
BLAKE2b-256 | 18780a757814d5214f7dfa14c6fb2f8c095c4e81251e4b22a5a26d30a5a00174 |
File details
Details for the file quickdna-0.1.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
.
File metadata
- Download URL: quickdna-0.1.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
- Upload date:
- Size: 929.5 kB
- Tags: CPython 3.10, manylinux: glibc 2.12+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4bc3196bf8fcfa358a9d8040652c26973823fa06623ebff17100c38176892d5 |
|
MD5 | 6ef2b43921425d5e46eab1f9fbc873a2 |
|
BLAKE2b-256 | 8185c1a612ba9327e82fac013030b766c4ed35497622edb9aef480dc0b247bcc |
File details
Details for the file quickdna-0.1.3-cp310-cp310-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: quickdna-0.1.3-cp310-cp310-macosx_10_7_x86_64.whl
- Upload date:
- Size: 207.0 kB
- Tags: CPython 3.10, macOS 10.7+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9905952fed66ac73791e8bbb54cfbfa92ddb5659a9623ab6f8191180f34273c |
|
MD5 | 4959d0faf0fd47d17be20ed39d8fdfec |
|
BLAKE2b-256 | 52c8e48db58db7cbe3933fe5bf33ef9f4a71552b2005fbbdcab6de2dbe1aad66 |
File details
Details for the file quickdna-0.1.3-cp39-none-win_amd64.whl
.
File metadata
- Download URL: quickdna-0.1.3-cp39-none-win_amd64.whl
- Upload date:
- Size: 108.4 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 024a94896b6e1ce1d82ecc3fe09447b0fa0d1d36d9bd0fde3e166a1e0936b5ac |
|
MD5 | 74f73e9284d27de11c2235dcc5db1d95 |
|
BLAKE2b-256 | 86a7817c39a85584ce5e12bf13f718f5c1ec0e748d4caeb33a5f84eee2b04448 |
File details
Details for the file quickdna-0.1.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
.
File metadata
- Download URL: quickdna-0.1.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
- Upload date:
- Size: 929.8 kB
- Tags: CPython 3.9, manylinux: glibc 2.12+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62ce24ca76adba9ab2a1c11c167c6fc7abb519ec4ff2c9f8ab79cfbafc753efa |
|
MD5 | 3615e998da235b6f595e81f5ce95e2c5 |
|
BLAKE2b-256 | deab1321db04ad58c1e1915d2e9a27912696c1216a0931bf1b473db27305bf8e |
File details
Details for the file quickdna-0.1.3-cp39-cp39-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: quickdna-0.1.3-cp39-cp39-macosx_10_7_x86_64.whl
- Upload date:
- Size: 207.0 kB
- Tags: CPython 3.9, macOS 10.7+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a075e138739e4877a4a470b1d5f23336f64cf573c0b183922d6e7220417e6bc |
|
MD5 | 83e1d9b8e6baf1b62b05c93e9495c6e8 |
|
BLAKE2b-256 | 64370826dc010d54a361708410592ae9973d7718c8a36f03f9457d11ff85fc32 |
File details
Details for the file quickdna-0.1.3-cp38-none-win_amd64.whl
.
File metadata
- Download URL: quickdna-0.1.3-cp38-none-win_amd64.whl
- Upload date:
- Size: 108.5 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3e7bcae568edddd8d4d8fed280f0b4850549f1eee519a4427ed7024ae171fec |
|
MD5 | 8571a09dac0efe5d7d00486b43d4f05f |
|
BLAKE2b-256 | 11c122894bac8fb2f6e3cb5911f3718b8a33989e8f1f7618033fb1b2ba222446 |
File details
Details for the file quickdna-0.1.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
.
File metadata
- Download URL: quickdna-0.1.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl
- Upload date:
- Size: 930.0 kB
- Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fb7a4e813a3f683faaf5c518219a46fe8e03a797f64077004a718649f8f85f1 |
|
MD5 | 029d24e0cb023703cfb522635accab9e |
|
BLAKE2b-256 | a584057e011fd45d86e214dbe361ddbe90a3214502d624dd13556dc55d242ad9 |
File details
Details for the file quickdna-0.1.3-cp38-cp38-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: quickdna-0.1.3-cp38-cp38-macosx_10_7_x86_64.whl
- Upload date:
- Size: 207.1 kB
- Tags: CPython 3.8, macOS 10.7+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9cd17ab42827f10b84829c38817961bd48dcb32b67abbf09afd95fb890119e6 |
|
MD5 | 05fb6ee04f6f9396b3dbfdf26e5ba48a |
|
BLAKE2b-256 | c06f548a6d0019597f5aac2e7621093c7ce8554fd5515d5a46877ef17c74b420 |
File details
Details for the file quickdna-0.1.3-cp37-none-win_amd64.whl
.
File metadata
- Download URL: quickdna-0.1.3-cp37-none-win_amd64.whl
- Upload date:
- Size: 108.4 kB
- Tags: CPython 3.7, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 154f9770c1b0b8a6836453542ebd79747101152e035aeea27659f7cb20ad43c4 |
|
MD5 | 3027ffa4ba7989f504aa82dd1971a6b0 |
|
BLAKE2b-256 | 97cf71720bc6690245cfe2414fdf93c62b446119bf3b7b554e0229dbdfd1cf8f |
File details
Details for the file quickdna-0.1.3-cp36-none-win_amd64.whl
.
File metadata
- Download URL: quickdna-0.1.3-cp36-none-win_amd64.whl
- Upload date:
- Size: 108.2 kB
- Tags: CPython 3.6, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5adb4b8cc79d5e47ee037c8853cde72d2a5f6510dceeb8742e0333b53ab7eef9 |
|
MD5 | a07c247a7e5ff4e82854dd04a7f33392 |
|
BLAKE2b-256 | d90853991f24cc441252acc2b49480f974abeb2466d661879d7f732879963500 |