phlashlib
This library computes the log-likelihood of binary heterozygosity sequences under a sequentially Markov coalescent model with recombination.
API
phlashlib.loglik(
data: Int[ArrayLike, "L"],
iicr: IICRCurve,
times: Float[ArrayLike, "T"],
theta: ScalarLike,
rho: ScalarLike,
warmup: int = 500,
chunk_size: int = None,
) -> Scalar
Features
- JAX-compatible:
vmap,jit,grad, etc. - GPU-accelerated via
cuda.core.experimental(fallback to CPU if unavailable)
Example
from phlashlib.iicr import PiecewiseConstant
from phlashlib.loglik import loglik
import jax.numpy as jnp
times = jnp.array([0.0, 0.1, 0.5, 2.0])
rates = jnp.array([100.0, 10.0, 1.0])
iicr = PiecewiseConstant(t=times[:-1], c=rates)
data = jnp.array([0, 1, 1, 0, -1, 1, 0, 0], dtype=jnp.int8)
theta = 1.5
rho = 0.5
ll = loglik(data, iicr, times, theta, rho)
JAX Use
from jax import jit, vmap, grad
# JIT
f = jit(loglik)
# Vectorized over data
batched_ll = vmap(loglik, in_axes=(0, None, None, None, None))(batch_data, iicr, times, theta, rho)
# Gradient w.r.t. theta
dtheta = grad(loglik, argnums=3)(data, iicr, times, theta, rho)
Notes
data: 1Dint8, values in{0, 1, -1}iicr: subclass ofIICRCurve, e.g.PiecewiseConstanttheta,rho: scalar mutation and recombination rates- Internally uses a fused CUDA kernel with
jax.custom_vjpif available - Fallback implementation uses pure JAX
Metadata
Release files for phlashlib 0.2.2
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 |
|---|---|---|---|---|
| phlashlib-0.2.2.tar.gz | 10.3 kB | Without provenance | Details for phlashlib-0.2.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| phlashlib-0.2.2-py3-none-any.whl | Python 3 | none | any | Details for phlashlib-0.2.2-py3-none-any.whl |
Total release size: 23.3 kB
Release files / phlashlib-0.2.2.tar.gz
| Download URL | phlashlib-0.2.2.tar.gz |
|---|---|
| Size | 10.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
61ed2a31dcc32a32c00389aa13c3d6df80585dfb0b02d0d68f8c6ebe6aa567df
|
|
BLAKE2b-256 checksum How to use checksums |
e24c2725d296efd338d11b40c8964bc3374f888d44ca68a5119f33efccd98c10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / phlashlib-0.2.2-py3-none-any.whl
| Download URL | phlashlib-0.2.2-py3-none-any.whl |
|---|---|
| Size | 13.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6e2e87923db7d5fd06cf3a6e35aa52be0ca4ded991f7700876caae18ab415ba4
|
|
BLAKE2b-256 checksum How to use checksums |
08a9ebb763fee5c2c283c4532e190e404a0751b03b7daaade7c8b2d252d6797d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for phlashlib 0.2.2
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.