Skip to main content

Aptamer candidate generator with GC content constraints

Project description

PyPI version

Aptamer Generator

A Python package for generating DNA aptamer candidates with controlled GC content using AI-driven methods.

Features

  • Configurable Generation: Control sequence length and GC content ranges
  • Reproducibility: Seed-based random number generation for consistent results
  • Validation: Built-in GC content validation using Biopython
  • Testing: Full test coverage with pytest
  • Packaging: Easy installation via pip/PyPI

Installation

From GitHub

pip install git+https://github.com/avinab-neogy/aptamer_generator.git

Local Development

git clone https://github.com/avinab-neogy/aptamer_generator.git
cd aptamer_generator
pip install -e .[test] # Editable mode with test dependencies

Usage

Basic Example


from aptamer_generator import AptamerGenerator

# Initialize generator with seed

generator = AptamerGenerator(seed=42)

# Generate 5 sequences of length 40 with 45-55% GC

sequences = generator.generate_candidates(
num=5,
length=40,
gc_range=(0.45, 0.55)
)

# Print results

for i, seq in enumerate(sequences, 1):
print(f"Sequence {i}: {seq}")

Development

Running Tests


pytest -v --cov=aptamer_generator --cov-report=term-missing

Building the Package


python -m build

Uploading to PyPI (Optional)


twine upload dist/*

Technical Details

Dependencies

  • Python >=3.8
  • numpy >=1.21
  • biopython >=1.79

Algorithm

Uses rejection sampling with the following steps:

  1. Random DNA sequence generation
  2. GC content calculation
  3. Constraint validation
  4. Repeat until requested number of valid sequences are generated

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/your-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin feature/your-feature)
  5. Open a Pull Request

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

aptamer_generator-0.1.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

aptamer_generator-0.1.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file aptamer_generator-0.1.1.tar.gz.

File metadata

  • Download URL: aptamer_generator-0.1.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for aptamer_generator-0.1.1.tar.gz
Algorithm Hash digest
SHA256 91821530606f75fe879b4e605da3313b93fc2b7841f45119ee06d9e12a6d5d86
MD5 b320bb69cfdd8de634492abc290069ce
BLAKE2b-256 88e655eb47e212c7cbbf3d0d2c7e482fffeb4da0832a98697020b0d68f61ad2f

See more details on using hashes here.

File details

Details for the file aptamer_generator-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for aptamer_generator-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 79dcea3c60e373d6c1e1e7f5a5fe0c38e954e3e20581752b3b6de3af1d5b30cf
MD5 861e73e905094609cce4dac06f8421cf
BLAKE2b-256 03c0d1dc9b07dbb36c90db861df6aaaac7f1e0bdc6c110ea1e898974081e0c0e

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