Dense Arrays designs nucleotide sequences with densely packed DNA-protein binding sites. It uses optimal string packing to arrange overlapping sites on both DNA strands, with controls for sequence length, site placement, and library diversity.
First array
Use Python 3.12 or later. This example packs four synthetic 16-base motifs into a 40-base array.
python -m venv .venv # Create an isolated Python environment.
source .venv/bin/activate # Activate it on macOS or Linux.
python -m pip install dense-arrays # Install the released package and CBC solver.
# Fit four sites into at most 40 bases, considering both DNA strands.
dense-arrays optimize \
--motif ACGTTGCAAGTCCTGA \
--motif AGTCCTGATCGTACCG \
--motif TCGTACCGATGCTTAG \
--motif ATGCTTAGGACGTTCA \
--length 40 --strands double
The result reports four placed sites and a 40-base sequence.
Optimal solution | score 4 | length 40 / 40 limit | compression 1.600
TGAACGTCCTAAGCATCGGTACGATCAGGACTTGCAACGT
The terminal also draws the aligned sites. An equally optimal solution can use the reverse complement. The first-array guide explains the overlaps and shows the matching Python code. Installation covers optional features, version availability, Windows, uv projects, and Pixi.
Choose a task
The documentation index links guides to prepare binding-site pools, generate constrained libraries, inspect and compare results, export sequences, and render figures or videos. It also links the API, method, and contributor guides.
Citation
If you use Dense Arrays in your work, please cite the method paper.
Andreani V, South EJ, Dunlop MJ (2024). Generating information-dense promoter sequences with optimal string packing. PLOS Computational Biology 20(7), e1012276. DOI 10.1371/journal.pcbi.1012276.
@article{andreani2024densearrays,
author = {Andreani, Virgile and South, Eric J. and Dunlop, Mary J.},
title = {Generating information-dense promoter sequences with optimal string packing},
journal = {PLOS Computational Biology},
year = {2024},
volume = {20},
number = {7},
pages = {e1012276},
doi = {10.1371/journal.pcbi.1012276}
}
Metadata
Release files for dense-arrays 0.4.0
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 |
|---|---|---|---|---|
| dense_arrays-0.4.0.tar.gz | 455.1 kB | With provenance | Details for dense_arrays-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dense_arrays-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for dense_arrays-0.4.0-py3-none-any.whl |
Total release size: 990.6 kB
Release files / dense_arrays-0.4.0.tar.gz
| Download URL | dense_arrays-0.4.0.tar.gz |
|---|---|
| Size | 455.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6360e9398a13bfb42f4dfae6fe40dcd0212c8f6692174a0112648849d4861a7f
|
|
BLAKE2b-256 checksum How to use checksums |
5468c5bfee98663742ab91607117652a7d438f2e35682f9ce228333ddab95763
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logRelease files / dense_arrays-0.4.0-py3-none-any.whl
| Download URL | dense_arrays-0.4.0-py3-none-any.whl |
|---|---|
| Size | 535.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
15e1923cd2e2b7e2cfa172b9160522e3057ca8924ac9bc3212e981dd0d383e99
|
|
BLAKE2b-256 checksum How to use checksums |
b8b11c9a6498000d3427494e0f0e38c8a56f9388f145044848983c79622652fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logSecurity for dense-arrays 0.4.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for dense_arrays-0.4.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logA 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.