Skip to main content

polymer-genomics

Python client for the Polymer Genomics API — DNA biophysical properties and curated genomic reference data.

Install

pip install polymer-genomics

Quick Start

from polymer_genomics import PolymerClient

client = PolymerClient(api_key="pk_live_...")

# Evaluate a DNA sequence (physics linter)
report = client.evaluate("ATGCGATCGATCGATCG" * 20)
print(report["flag_counts"])
print(report["summary"]["mean_dG37"])

# Compare wild-type vs mutant
delta = client.compare({
    "wt":  "ATGCGATCGATCG" * 20,
    "mut": "ATGCGATCAATCG" * 20,
})
print(delta["deltas_vs_reference"])

# Look up a gene
tp53 = client.gene("hg38", "TP53")
print(tp53["symbol"], tp53["chr"], tp53["start"])

# GTEx expression
expr = client.gene_expression("hg38", "BRCA1")
print(expr["tissues"]["Breast - Mammary Tissue"])

# Query a genomic region
features = client.region("hg38", "chr17:7668402-7687550", layers=["cpg_islands"])

# Methylation probes
probe = client.probe("hg38", "cg00000029")
batch = client.batch_probes("hg38", ["cg00000029", "cg00000108"])

# Biophysical properties of a genomic region
bp = client.biophysics("hg38", "chr17:7668402-7669000")

# Batch evaluate up to 100 sequences
batch = client.batch_evaluate({
    "v1": "ATGCGATCGATCG" * 20,
    "v2": "ATGCAATCGATCG" * 20,
    "v3": "ATGCGATCAATCG" * 20,
})
print(batch["summary"])  # GC range, warning counts

# Region profile — everything about a region in one call
profile = client.region_profile("hg38", "chr17:7668402-7687550")
print(profile["summary"])  # layers with/without features
print(profile["flags"])    # significance flags

# Platform statistics
stats = client.platform_summary()
print(stats["platform"]["total_rows"])

# Cross-layer query recipes
recipes = client.recipes()
recipe = client.recipe("silencing_prone_regions")
# Use recipe filters with client.intersect()

# Reference data
nn = client.nn_parameters()          # nearest-neighbor thermodynamics
aa = client.amino_acid_properties()  # amino acid physicochemical data
pc = client.physical_constants()     # DNA/protein physical constants

Authentication

Pass your API key to the constructor:

client = PolymerClient(api_key="pk_live_...")

Or omit it for local development:

client = PolymerClient(base_url="http://localhost:8000")

Error Handling

from polymer_genomics import (
    PolymerAPIError,
    PolymerAuthError,
    PolymerNotFoundError,
    PolymerValidationError,
    PolymerRateLimitError,
)

try:
    client.gene("hg38", "NOTREAL")
except PolymerNotFoundError:
    print("Gene not found")
except PolymerRateLimitError:
    print("Slow down")
except PolymerAPIError as e:
    print(f"API error {e.status_code}: {e.message}")

API Reference

See the full API docs at api.polymerbio.org/docs.

License

MIT

Metadata

Release files for polymer-genomics 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for polymer-genomics 0.3.0
File Size Uploaded Provenance Actions
polymer_genomics-0.3.0.tar.gz 12.9 kB Without provenance Details for polymer_genomics-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for polymer-genomics 0.3.0
File Interpreter ABI Platform Actions
polymer_genomics-0.3.0-py3-none-any.whl Python 3 none any Details for polymer_genomics-0.3.0-py3-none-any.whl

Total release size: 22.4 kB

Release files / polymer_genomics-0.3.0.tar.gz

Download URL polymer_genomics-0.3.0.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a2e526ae27240b31f72501a6ec84b0c26ff0b4d621b990ee4be1967cb29edb0c
BLAKE2b-256 checksum
How to use checksums
f6fdf95f4c3e628afcd1d56217100783bd2141216d94a24674bfc2b66d07acbe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / polymer_genomics-0.3.0-py3-none-any.whl

Download URL polymer_genomics-0.3.0-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6cd90c7ff0223d4f748c6a6cf1af76f76290299a79d462cc9e01b653794f8cf
BLAKE2b-256 checksum
How to use checksums
2183318a3f7abad63d492c1591a1f799b3a73dd9a0bbd6aa5b85843e67d65572
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for polymer-genomics 0.3.0

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.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page