Skip to content

Add a bulk RNA profile

Add the sample's bulk RNA profile to the prediction for its slide, and keep the same genes and file format. Without a bulk profile, Aurora predicts from the slide alone.

Use sample-matched bulk RNA as measured sample information alongside the image. The profile should come from the same tissue block as the slide. Prepare one profile per sample, then include it when you submit that slide.

1. Prepare the profile

bulk_rna takes the table you have and writes the one layout the service accepts. It resolves names through the same gene table every result is keyed by, and tells you what it did.

Not executed — needs your bulk RNA table and API access

Use your sample's counts or TPM table as sample.tsv.

import auroraomics as ao

with ao.Client() as client:
    card = next(m for m in client.models()
                if "patches" in m["accepts"]["observations"]
                and "bulk_rna" in m["accepts"]["covariates"])
    report = ao.bulk_rna(
        "sample.tsv",
        "sample.bulk.tsv",
        units="counts",
        card=card,
        resolve=client.resolve_keys,
    )

print(report.rows, "genes prepared")

State the unit; it is never guessed

A gene missing from your profile stays missing. Nothing is filled in.

A profile has to cover enough of the model's genes. report.coverage says how much of them yours covers, and one that covers too few is refused with bulk_rna_coverage_too_low.

2. Submit it

The prepared table is named in the submission's covariates. A model whose card does not accept it answers model_does_not_accept. It is never quietly ignored.

Not executed — needs an API key and a served model

A submission spends a job from your quota, so this build does not make one.

import auroraomics as ao

client = ao.Client()
job = client.predict(
    model="deepspot-h/global/patches@1.0.0",
    observations={"patches": "sample.zip"},
    covariates={"bulk_rna": "sample.bulk.tsv"},
)
result = job.wait().download("result.h5ad")

The result is the same .h5ad as any other, and its provenance records that a profile was used. For a cohort, prepare one profile per sample and submit each with that sample's own file.

What the file must be

Part Contract
Layouts long, wide
Units counts, tpm
Long layout columns gene_id, then one value column named by its unit (counts, tpm)
Scale as measured — counts or TPM; a table already log-transformed is refused

A long table is one row per gene: a name column, then one value column named by its unit.

A wide table is one row of values, under one column per gene name.

Gene names may be symbols or Ensembl identifiers, with or without a version suffix. The package also reads a GDC STAR gene-counts file as downloaded.

Next

Explore the result, or learn about supported file layouts in the input reference.