Skip to main content

DYSPLAI Python SDK

For Research Use Only. Not for use in diagnostic procedures.

DYSPLAI is a molecular oncology research platform spanning sequence analysis, reference-atlas positioning, cohort discovery, molecular evidence graphs, counterfactual pathway exploration, clinical metadata harmonisation and reproducible reporting.

This is the typed Python client for it: Pydantic v2 response models, a blocking wait() helper for long-running jobs, and thirteen service surfaces. The SDK is a thin client — every model, atlas and pipeline stays on DYSPLAI infrastructure.

Install

pip install dysplai
# with notebook dependencies:
pip install "dysplai[notebooks]"

Quick start

from dysplai import DysplaiClient

with DysplaiClient(api_key="your-key") as client:
    # Submit a molecular analysis
    job = client.analysis.submit(
        input_uri="gs://your-bucket/sample.csv",
        sample_id="SAMPLE_001",
        cancer_type_hint="lung_adeno",
    )

    # Wait for analysis to complete (~5–15 min)
    result = client.analysis.wait(job.analysis_id, poll_interval=10)

    print(result.cancer_type_probabilities)
    print(result.biological_neighbourhood_description)
    print(result.ruo_disclaimer)

API surfaces

Service Attribute Methods
Analysis client.analysis submit, submit_batch, submit_local, stage, status, batch_status, result, wait, list
Cohort client.cohort summarise, compare, neighbours, rank_targets, reference_compare
Counterfactual client.counterfactual sensitivity, simulate, features, pathway_shift_search, explore, characterise, aggressiveness, cohort_sensitivity, liquid_bleed, normal_projection, perturb_latent, vulnerability_search
Interpretation client.interpretation query
Graph client.graph network, pathways, explanation, clinical_metrics, ingest_status, junction
Experts client.experts list, capabilities, metrics, classify, route, interpret, evidence
Assay design client.assays design, get, results, wait
Histology client.histology submit_slide, wait_slide, slide_status, slide_result, analyse_slide, search_slides, molecular_context, search_molecular_context, pathway_scores, gene_expression, regions, tile_grid, ood, tile_ood, quality, supporting_data
Radiomics client.radiomics submit, wait, status, result, report
Clinical client.clinical parse, annotate, labels, timeline, get_mapping
Reports client.reports generate, status, wait, download, list
Model builder client.model_builder submit_run, get_run, list_runs, cancel_run, get_run_labels, list_models, get_model, activate_model
Account client.account whoami, balance, usage

The molecular evidence graph (client.graph) grounds a prediction in the evidence behind it — supporting and contradicting — rather than returning a score alone. Graph reads take the analysis id and are tenant-private.

Worked examples

Task-oriented guides — cohort discovery, evidence graphs, counterfactual exploration, imaging, assay design and reporting — are in the developer documentation at https://www.dysplasiadx.com/developers, alongside the Colab notebooks listed below.

Error handling

from dysplai import AuthError, QuotaError, NotFoundError, ValidationError

try:
    result = client.analysis.result("unknown-id")
except NotFoundError:
    print("Analysis not found")
except QuotaError:
    print("Quota exceeded")
except AuthError:
    print("Invalid or expired API key")

Notebooks

Five Colab-ready notebooks are published with the developer documentation at https://www.dysplasiadx.com/developers. They are not installed by pip — this distribution is the client only.

Notebook Topic
01_cohort_phenotyping.ipynb Cohort summarisation, group comparison, volcano plot
02_responder_fingerprinting.ipynb Submit, wait, pathway fingerprint, atlas neighbours
03_pathway_counterfactual.ipynb Sensitivity gradients, simulate, natural-language shift search
04_resistance_surveillance.ipynb Serial timepoint atlas drift, immune phenotype monitoring
05_clinical_metadata_enrichment.ipynb De-identification, normalisation, batch annotation

RUO notice

Every scientific output carries ruo_disclaimer: "For Research Use Only. Not for use in diagnostic procedures.", and it is not suppressible by the caller.

That is the rule, not a list — it holds for analysis, cohort, counterfactual, interpretation, graph, experts, assay design, histology, radiomics, model builder and reports alike. The only exception is client.account, which returns administrative data (identity, credit balance, usage) and no scientific result.

DYSPLAI does not diagnose disease, recommend treatment, guide clinical management, provide clinical decision support, or generate prognosis.

Metadata

Release files for dysplai 1.1.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 dysplai 1.1.0
File Size Uploaded
dysplai-1.1.0.tar.gz 61.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dysplai 1.1.0
File Interpreter ABI Platform
dysplai-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 102.1 kB

Release files / dysplai-1.1.0.tar.gz

Download URL dysplai-1.1.0.tar.gz
Size 61.4 kB
Tags Source
SHA-256 checksum
How to use checksums
abd2784a05e203cad6850fe346cc76cde4d92584ee961ce23b973ea5a8e3d7ca
BLAKE2b-256 checksum
How to use checksums
42246d786602db2255eaabbfd18cabb47900e3be81a54d7973211da1cb4385c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.12

Release files / dysplai-1.1.0-py3-none-any.whl

Download URL dysplai-1.1.0-py3-none-any.whl
Size 40.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1a44856fe69f6d7324beaee6a659403e88280a3bc2c18c5a24982e5ed0d84d40
BLAKE2b-256 checksum
How to use checksums
f15cbed955531ec5f7df50922917222f945fb16054e65351c544e4f8b37a3b8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.12

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.4

2 release files

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