Skip to main content

DNA models implemented in JAX

Project description

dnax — DNA models in JAX

[!WARNING] This is an experimental implementation.

dnax provides JAX-based implementation of models like BPNet, ChromBPNet, DragoNNFruit. The code is heavily based on original implementations (chrombpnet, bpnet-lite) however attempts to be more readable, accessible, and maintainable.

Installation

pip install dnax

# or 

pip install git+https://github.com/gtca/dnax.git

Usage

Vanilla ChromBPNet:

from dnax.models.chrombpnet import ChromBPNet

bias = BPNet(n_filters=512, n_layers=8)
accessibility = BPNet(n_filters=512, n_layers=8)

model = ChromBPNet(bias, accessibility)

x = ...  # (batch, 2114, 4) tensor (1-hot)
profile, counts = model(x)

For inference, you can load existing ChromBPNet models:

from dnax.io import load_chrombpnet_model

model = load_chrombpnet_model(bias_file, accessibility_file)

profile, counts = model(x)

Implementation

dnax currently uses flax and its NNX API.

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

dnax-2024.0.0a1.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

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

dnax-2024.0.0a1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file dnax-2024.0.0a1.tar.gz.

File metadata

  • Download URL: dnax-2024.0.0a1.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for dnax-2024.0.0a1.tar.gz
Algorithm Hash digest
SHA256 ded2ce9e955c08eea88d3db19a61cac012a34e60e5aaf9b737fdb89315c01f81
MD5 be08cca7e95dec486d68412a20b14480
BLAKE2b-256 d4914bf39d3f7a8ea4883f5ec0e7ec887b6d58b4a6afd080934e7a5859a97235

See more details on using hashes here.

File details

Details for the file dnax-2024.0.0a1-py3-none-any.whl.

File metadata

  • Download URL: dnax-2024.0.0a1-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for dnax-2024.0.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 b534b79d3bbc555604ec658d61383be12581a012c341b45a4a084ed6d64583ae
MD5 ecf626ba37995d25464cbde6457bbdf9
BLAKE2b-256 07d654b4396d74b9fd1a568d06e4429e9ea60497c2dd9703887fc438f6448038

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