Skip to main content

Ultrafast exact sequence matching in pure Python using NumPy vectorization

Project description

VecMap

PyPI version License: MIT Python 3.9+

Ultrafast exact sequence matching using NumPy vectorization. Designed for CRISPR screens and barcode mapping where exact matching is biologically required.

Paper: bioRxiv preprint

Installation

pip install vecmap

Quick Start

# Command line
vecmap -r reference.fa -q reads.fq -o alignments.txt

# Python API
from vecmap import vecmap
alignments = vecmap(reference_seq, [(read_seq, read_id), ...])

Performance

Benchmarks on human transcriptome (42,027 ± 1,856 reads/second in pure Python):

Tool Reads/sec (mean ± SD) Language Notes
VecMap 42,027 ± 1,856 Python Exact matching only
Minimap2 173,460 ± 5,203 C General purpose aligner
BWA-MEM 60,306 ± 2,418 C General purpose aligner

For CRISPR screening specifically:

  • VecMap: 18,948 ± 892 reads/sec
  • 1.9× faster than MAGeCK
  • 3.8× faster than CRISPResso2

Performance measured on Apple M1 Max, 32GB RAM, Python 3.11.5, NumPy 2.0.0

Applications

CRISPR Guide Detection

from vecmap.applications import CRISPRGuideDetector

guides = {
    "KRAS_sg1": "ACGTACGTACGTACGTACGT",
    "TP53_sg1": "GGCCGGCCGGCCGGCCGGCC"
}

detector = CRISPRGuideDetector(guides)
results = detector.detect_guides(reads)
counts = detector.summarize_detection(results)

Barcode Demultiplexing

from vecmap.applications import BarcodeProcessor

processor = BarcodeProcessor(
    barcode_whitelist=whitelist,
    barcode_length=16,
    umi_length=10
)

corrected = processor.correct_barcodes(processor.extract_barcodes(reads))

Reproducibility

To reproduce all benchmarks and figures from the paper:

git clone https://github.com/the-jordan-lab/VecMap.git
cd VecMap
git checkout v1.0.0
pip install -e .
./reproduce.sh

See DATA_AVAILABILITY.md for complete reproduction details.

Documentation

Citation

@article{jordan2025vecmap,
  title={VecMap: Ultrafast Exact Sequence Matching for CRISPR Screens},
  author={Jordan, James M},
  journal={bioRxiv},
  year={2025},
  doi={10.1101/2025.XX.XX.XXXXXX}
}

License

MIT License. See LICENSE for details.

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

vecmap-1.0.0.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

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

vecmap-1.0.0-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file vecmap-1.0.0.tar.gz.

File metadata

  • Download URL: vecmap-1.0.0.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for vecmap-1.0.0.tar.gz
Algorithm Hash digest
SHA256 092b7105367847b5a46af36b9b9cfc0eed63e269e2e0e1800420102a6fc00698
MD5 266601db9279e254f65284f1d3057018
BLAKE2b-256 521348d1623cb82eb5049bbf2a937c28f8dc76078b6c0df9ff4fd8f81a3e9f51

See more details on using hashes here.

File details

Details for the file vecmap-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: vecmap-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 14.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for vecmap-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 599e868a01dd460800d3bf9b4f174965943e8795911fbc2c81bc7c93a2babe22
MD5 b1d3de777239e1a64a8ee77565f9d02f
BLAKE2b-256 47f9a225978643766add6fc33d7efd78298d2fd8111442f7ddb9de8ce88aba24

See more details on using hashes here.

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