Skip to main content

Efficient manipulation of genomic sequences

Project description

PyPI-Server Unit tests

biostrings

Efficient manipulation of genomic sequences in Python, inspired by the design of Bioconductor's Biostrings package.

The core design relies on a "pool and ranges" memory model:

  • DNAStringSet stores all sequences in a single contiguous block of memory (the pool).
  • Individual sequences are defined by start and width coordinates (the ranges).
  • Slicing a DNAStringSet returns a view (a new set of ranges pointing to the same pool), making subsetting operations virtually instantaneous and memory-free, regardless of the data size.

Install

To get started, install the package from PyPI

pip install biostrings

Quick Start

Working with Single Sequences

The DNAString class represents a single DNA sequence. It enforces the IUPAC DNA alphabet and supports efficient byte-level operations.

from biostrings import DNAString

# Create a DNA string
dna = DnaString("TTGAAAA-CTC-N")
print(dna)
# Output: TTGAAAA-CTC-N

# Basic operations
print(len(dna))            # 13
print(dna[0:3])            # DnaString(length=3, sequence='TTG')

# Reverse Complement
# Handles IUPAC ambiguity codes correctly (e.g., N -> N, M -> K)
rc = dna.reverse_complement()
print(rc)
# Output: N-GAG-TTTTCAA

Working with Sets of Sequences

The DNAStringSet is the primary container for handling collections of sequences (e.g., reads from a FASTA file).

from biostrings import DNAStringSet

# Efficiently create a set from a list of strings
seqs = [
    "ACGT",
    "GATTACA",
    "TTGAAAA-CTC-N",
    "ACGTACGT"
]
dss = DNAStringSet(seqs, names=["s1", "s2", "s3", "s4"])

print(dss)
# Output:
# <DNAStringSet of length 4>
#   [ 1]   4 ACGT                 s1
#   [ 2]   7 GATTACA              s2
#   [ 3]  13 TTGAAAA-CTC-N        s3
#   [ 4]   8 ACGTACGT             s4

Note

This project has been set up using BiocSetup and PyScaffold.

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

biostrings-0.0.1.tar.gz (28.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

biostrings-0.0.1-cp313-cp313-musllinux_1_2_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

biostrings-0.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (101.7 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

biostrings-0.0.1-cp313-cp313-macosx_11_0_arm64.whl (63.6 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

biostrings-0.0.1-cp313-cp313-macosx_10_13_x86_64.whl (71.7 kB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

biostrings-0.0.1-cp312-cp312-musllinux_1_2_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

biostrings-0.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (101.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

biostrings-0.0.1-cp312-cp312-macosx_11_0_arm64.whl (63.5 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

biostrings-0.0.1-cp312-cp312-macosx_10_13_x86_64.whl (71.7 kB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

biostrings-0.0.1-cp311-cp311-musllinux_1_2_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

biostrings-0.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (100.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

biostrings-0.0.1-cp311-cp311-macosx_11_0_arm64.whl (63.5 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

biostrings-0.0.1-cp311-cp311-macosx_10_9_x86_64.whl (71.0 kB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

biostrings-0.0.1-cp310-cp310-musllinux_1_2_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

biostrings-0.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (99.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

biostrings-0.0.1-cp310-cp310-macosx_11_0_arm64.whl (62.3 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

biostrings-0.0.1-cp310-cp310-macosx_10_9_x86_64.whl (69.7 kB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

biostrings-0.0.1-cp39-cp39-musllinux_1_2_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.9musllinux: musl 1.2+ x86-64

biostrings-0.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (99.5 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

biostrings-0.0.1-cp39-cp39-macosx_11_0_arm64.whl (62.4 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

biostrings-0.0.1-cp39-cp39-macosx_10_9_x86_64.whl (69.8 kB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

File details

Details for the file biostrings-0.0.1.tar.gz.

File metadata

  • Download URL: biostrings-0.0.1.tar.gz
  • Upload date:
  • Size: 28.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for biostrings-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9da09ade910d73a79275dbc8458b67be449000f32d8653aa8253758cceebb6f6
MD5 1399855cb12a3bbe0208c8e90cda3bae
BLAKE2b-256 6558d9b93430316490ccd6f3de173b8e9346b97c43cb3ee913a6f452c5c617e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for biostrings-0.0.1.tar.gz:

Publisher: publish-pypi.yml on BiocPy/biostrings

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file biostrings-0.0.1-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for biostrings-0.0.1-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 b23b641b3f0b887af6c3264015abcf901d4df68367c633173ace3906ac669a3f
MD5 0118b822da2fb423afdcb08bd02ccf2f
BLAKE2b-256 4780040e2ea690ae3e167c2e49e766c3b4693d400ebafd8ebcac7ac8f41dc6c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for biostrings-0.0.1-cp313-cp313-musllinux_1_2_x86_64.whl:

Publisher: publish-pypi.yml on BiocPy/biostrings

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file biostrings-0.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for biostrings-0.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7eaf0de2a9b7a7a2838e922ec78a1bf587f9ab7fb149eca605a5bdfe26b38067
MD5 53f70f764f057d29ca06b38806d55b77
BLAKE2b-256 fa76cad723d31bcef624ab80c28a420fe9c24f5c18754aff04aabfc45fd56f5e

See more details on using hashes here.

Provenance

The following attestation bundles were made for biostrings-0.0.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish-pypi.yml on BiocPy/biostrings

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file biostrings-0.0.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for biostrings-0.0.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bdae7888f489b8c831e10a06c500e15b461f68df795f44ea38c032ccfcfc5add
MD5 dafa78b4fdb57a5cbc73f6e44ebcfae8
BLAKE2b-256 599264289b8c1770a061374387090098b93b5fff00adf08a9a6adc8e2baf7fa8

See more details on using hashes here.

Provenance

The following attestation bundles were made for biostrings-0.0.1-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: publish-pypi.yml on BiocPy/biostrings

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file biostrings-0.0.1-cp313-cp313-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for biostrings-0.0.1-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 8df16b62e1d58ec370f4c18e090015786df00fc59145bd7a7a5ca78aab2f7f68
MD5 16c764e67b5945d9c4d2bb2bf175abaf
BLAKE2b-256 4f8d0aea8f905f1989aa20a1a7873517f97ad0fdd0cd5a565e6cece5720a8081

See more details on using hashes here.

Provenance

The following attestation bundles were made for biostrings-0.0.1-cp313-cp313-macosx_10_13_x86_64.whl:

Publisher: publish-pypi.yml on BiocPy/biostrings

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file biostrings-0.0.1-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for biostrings-0.0.1-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6b38c489a3f5a8baf950327f8f3e1bf0984be9348d9d06a8bae121e3d99a1325
MD5 edb10b331bd78781f270c4fb423503f3
BLAKE2b-256 e96954d151f1dbaa69ccd99c0d8d81214a0d4934a460b4e35b1e6f1139d518d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for biostrings-0.0.1-cp312-cp312-musllinux_1_2_x86_64.whl:

Publisher: publish-pypi.yml on BiocPy/biostrings

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file biostrings-0.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for biostrings-0.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7f366789bc5bbbe4a02164fbd6e1525f502abe48de1b057bc1eb3884f9589981
MD5 d0e140c0e4c556c4ddddb8bd8ae3908b
BLAKE2b-256 4a2161b4c00603f0cdd203116f934f2b528775375eba2988f21caa2dc4de7399

See more details on using hashes here.

Provenance

The following attestation bundles were made for biostrings-0.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish-pypi.yml on BiocPy/biostrings

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file biostrings-0.0.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for biostrings-0.0.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ad161444c40717d0ffd5514dcee645babd3a4edddf171115f8dcb8440e8fc56c
MD5 0912becaaa0982834a01f4c5d9965c90
BLAKE2b-256 c0f9c6e0b7b649b63eef6c819d750282c4e222064f7cd925bbeca67aa4da4e32

See more details on using hashes here.

Provenance

The following attestation bundles were made for biostrings-0.0.1-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: publish-pypi.yml on BiocPy/biostrings

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file biostrings-0.0.1-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for biostrings-0.0.1-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 384e371a1a3cae1d39fdd1e570bdbe8d9503990180b1d5345ff8d401a59d4d1f
MD5 398559b6d7e5406ddee25035c617d67b
BLAKE2b-256 ae094875cee9ef90f2d7e140813919cc4f86d7488a4e62b6374b1f5ab622e50f

See more details on using hashes here.

Provenance

The following attestation bundles were made for biostrings-0.0.1-cp312-cp312-macosx_10_13_x86_64.whl:

Publisher: publish-pypi.yml on BiocPy/biostrings

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file biostrings-0.0.1-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for biostrings-0.0.1-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 224ced07fb8ef48533712625348612743501f6ab51db180afb712020c510b994
MD5 cfc10706541d2dca555da43ce39c7ae3
BLAKE2b-256 6b08e99b40473bc59d0db8129f4300aebb0ed215490311317120d61a7adbcec4

See more details on using hashes here.

Provenance

The following attestation bundles were made for biostrings-0.0.1-cp311-cp311-musllinux_1_2_x86_64.whl:

Publisher: publish-pypi.yml on BiocPy/biostrings

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file biostrings-0.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for biostrings-0.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5687d32fcaf6cb0ff710a378dacc50f0e0bae72232d2f815909df3fe4e843a85
MD5 747091edca0948f8456aa59d33d66f62
BLAKE2b-256 4d9c5ae3dcd0d21e5a2de5fb1c8b519b383db7f4f9874d953210def3c8aabbf7

See more details on using hashes here.

Provenance

The following attestation bundles were made for biostrings-0.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish-pypi.yml on BiocPy/biostrings

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file biostrings-0.0.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for biostrings-0.0.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 16924449616f7874833b6ba3b938e77148e92c00481e0468575ba63d41025a79
MD5 fd8e254eb7fdd4ec30525522382c99cd
BLAKE2b-256 753734e46e01c070fb914cd8938c20a4dd93b71dd50f5bb38d3ccbe9d3710068

See more details on using hashes here.

Provenance

The following attestation bundles were made for biostrings-0.0.1-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: publish-pypi.yml on BiocPy/biostrings

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file biostrings-0.0.1-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for biostrings-0.0.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 029e024918c5957d9768c15e99a061ee657382c3fcd5e064819917885ae3f7e8
MD5 863201afcc23a447f3861a80c65bd096
BLAKE2b-256 86bc4658891ba1139780e0ac89150aeed3d6f894274a02cc0897eae647eb767f

See more details on using hashes here.

Provenance

The following attestation bundles were made for biostrings-0.0.1-cp311-cp311-macosx_10_9_x86_64.whl:

Publisher: publish-pypi.yml on BiocPy/biostrings

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file biostrings-0.0.1-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for biostrings-0.0.1-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a1ea80703201c890e8b61f6d83cf1b0ae3d014ce1cb4de4597d92daf03616104
MD5 962843812f729a4038f55d51da427f82
BLAKE2b-256 a5ce067059eda4892ffc2360a457c384f7b5ebb1c23a16ac7045dfb6b209a868

See more details on using hashes here.

Provenance

The following attestation bundles were made for biostrings-0.0.1-cp310-cp310-musllinux_1_2_x86_64.whl:

Publisher: publish-pypi.yml on BiocPy/biostrings

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file biostrings-0.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for biostrings-0.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3b82e8e5dc728eaf40e1040bbfa2f13c542cf959a1d73265d2518ef6a16a900a
MD5 f33226c78948af9fd7c3ee48d19cec32
BLAKE2b-256 49608a75efcd95f09674ef5a350821af8265eb96062218833eb5fa5d938d0f2f

See more details on using hashes here.

Provenance

The following attestation bundles were made for biostrings-0.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish-pypi.yml on BiocPy/biostrings

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file biostrings-0.0.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for biostrings-0.0.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4d7d090a56a12917bf39d9e1c77a44e7c310d376f1e292226661509ecdfdc09d
MD5 4fad63c9a3815356caf784eadb762965
BLAKE2b-256 8e8b1472360471810956991f8855ba45eefeb0138b719fc4c31959484b5aa26f

See more details on using hashes here.

Provenance

The following attestation bundles were made for biostrings-0.0.1-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: publish-pypi.yml on BiocPy/biostrings

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file biostrings-0.0.1-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for biostrings-0.0.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8b7d84c5167be3647bef738da40f6f1adbc6b849de7b35d570e0e5b380e79a6a
MD5 838cc2db256085def128405b06d61596
BLAKE2b-256 589d3be86b93add4bd0fb28e885c355c86d3661668c03f4ba299bb2a7b9fb00a

See more details on using hashes here.

Provenance

The following attestation bundles were made for biostrings-0.0.1-cp310-cp310-macosx_10_9_x86_64.whl:

Publisher: publish-pypi.yml on BiocPy/biostrings

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file biostrings-0.0.1-cp39-cp39-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for biostrings-0.0.1-cp39-cp39-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 4171775732591a4fd1330951b33f97f1e1b74fe865c44e5759d90f482a24ea9f
MD5 b548bc270ab93aeb832d82528a0bdd52
BLAKE2b-256 a2b6a01c1b09319b37a9f5ec7941c0f6061f2cb56143ebbc3b3eee242f2a41d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for biostrings-0.0.1-cp39-cp39-musllinux_1_2_x86_64.whl:

Publisher: publish-pypi.yml on BiocPy/biostrings

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file biostrings-0.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for biostrings-0.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6c78f4f978ae151c0dfa4595b2defc7e47fd3320362b05ee062b5c80852dd681
MD5 0e35dcbf7e0dc12c96ecee22a7cdf201
BLAKE2b-256 d48b2d03cfe1186fd436696c35686536f11c7d76b2d58b04d604e736ddd43e37

See more details on using hashes here.

Provenance

The following attestation bundles were made for biostrings-0.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish-pypi.yml on BiocPy/biostrings

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file biostrings-0.0.1-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for biostrings-0.0.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 725e778d9427f5ab757227bdafc9070ab52a3f2484e8f636e26efd878523b9fc
MD5 81f618fbeb2ef0bef74e9e64d11cff9b
BLAKE2b-256 5a3f1d5d9d2f47ce07b7d848f4c77c474871c792ef4e8a37e50297bddab1ed66

See more details on using hashes here.

Provenance

The following attestation bundles were made for biostrings-0.0.1-cp39-cp39-macosx_11_0_arm64.whl:

Publisher: publish-pypi.yml on BiocPy/biostrings

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file biostrings-0.0.1-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for biostrings-0.0.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3b45ddd6312eb9efca89531c352728fd54b7cf7cf5252095966e79c3179ac9de
MD5 9f24cd48196af9c190d7013681d3ca62
BLAKE2b-256 cf8fb75eccd15af802edc282813193c15b134fdde2c78f3512b80435d8f7264e

See more details on using hashes here.

Provenance

The following attestation bundles were made for biostrings-0.0.1-cp39-cp39-macosx_10_9_x86_64.whl:

Publisher: publish-pypi.yml on BiocPy/biostrings

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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