Skip to main content

Aptamer candidate generator with GC content constraints

Project description

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/yourusername/aptamer-generator.git

Local Development

git clone https://github.com/yourusername/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.0.tar.gz (3.9 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.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aptamer_generator-0.1.0.tar.gz
  • Upload date:
  • Size: 3.9 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.0.tar.gz
Algorithm Hash digest
SHA256 8d9070438562c40c488c2e8249ca2fc01c8ade3001fb7944f753f62e9bd209a3
MD5 2a604caa531621bacf50881cfeb6dcc4
BLAKE2b-256 57f63c030873dd6cf148bb37979683f9cc8755ad02bc54f569902cf8df518e3f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aptamer_generator-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 39c461710de9ed1d32aba8b4b0b51b978cee64a3d9be9a46c0860a4674de1a74
MD5 5fed384a758bc06f1284cb79c2f7994b
BLAKE2b-256 01db8754cb7e26b1840303737e615d9f2c3a0675cecc83749329030fa21449ba

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