predict_expression
Predict a gene's expression from the sequence around its TSS.
Expression is cell-type-specific, so `description` (cell type /
assay context, e.g. 'K562 cell line') is REQUIRED — the API
rejects requests without it.
The input rule is the same for every expression model: at least
9,198 bp, with the TSS at least 4,599 bp from each end, up to
500,000 bp. Longer TSS-centred sequence gives better predictions:
each model's bio_spec.recommended_flank_bp (see list_models) says how
many bp it reads on each side of the TSS, and flank beyond that is
ignored. Less flank, down to 4,599 bp, is accepted and scored, but
the model then reads less than it was trained on. Omit `model` for
the server's default.
- A 9,198 bp sequence with the TSS at offset 4,599 (the midpoint)
needs no `tss_index`.
- Any longer sequence needs `tss_index`: the 0-based offset of the
TSS into it (a fetch_gene_for_expression handle carries its own).
The API cuts what the model reads around that offset and never
scans for a TSS itself.
Under 9,198 bp, or a TSS closer than 4,599 bp to either end, is
rejected here and by the API (422). A locus with no offset is
rejected too, because it is indistinguishable from a mis-centred
window. A very N-rich or low-complexity window can also be refused
by the API (422).
An offset that is merely WRONG (e.g. counted over a wrapped FASTA's
characters, or against a chromosome coordinate instead of an offset
into THIS sequence) still succeeds and scores the wrong window —
verify meta.task_specific_counts.scored_window in the response.
Easiest paths: fetch_gene_for_expression(gene) already fetches a
long TSS-centred handle (as much flank as the listed models
recommend) and records its `tss_index`, which is sent for you when
you pass that handle without one; find_genes_and_predict_expression
takes a raw region and finds each TSS for you.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Optional model id; omit for the task default. See list_models. | |
| sequence | No | DNA bases A/C/G/T/N (case-insensitive). Line breaks are ignored (a wrapped FASTA body may be pasted verbatim; a `>` header line may not). Mutually exclusive with `sequence_ref`. | |
| tss_index | No | 0-based offset of the transcription start site into the sequence, counted in bases (whitespace is ignored). Required unless the sequence is exactly 9,198 bp; must leave at least 4,599 bp on each side (4,599 <= tss_index <= length - 4,599). The model reads the sequence around this offset (9,198 bp for g0-expression, more flank for a model with a larger bio_spec.recommended_flank_bp) and the API reports the slice it used as meta.task_specific_counts.scored_window. Check it: a wrong-but-in-range offset scores the wrong window silently. | |
| description | No | REQUIRED experimental context — cell type / assay / conditions (e.g. 'K562 cell line', 'liver tissue'). Expression is cell-type-specific; the API rejects requests without it. | |
| sequence_ref | No | Handle (seq_…) from any acquisition tool (fetch_ensembl_sequence, fetch_region, fetch_gene_for_expression, load_demo_sequence, load_local_fasta, store_inline_sequence). Mutually exclusive with `sequence`. | |
| sequence_name | No | Label echoed back in the response (ignored when `sequence_ref` is used). | sequence |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||