iscc.data.scRNA ¶
scRNA(protocol='10x', n_cells=100, count_model='nb', batch_label=None, n_reads=None, lib_size_sigma=None, dispersion=None, sigma_batch=None, mu_lib=None, sigma_lib=None, ambient_frac=None, doublet_rate=None, dropout_mid=None, dropout_shape=None, well_sigma=None, depth_batch_sigma=None, kappa=None, seed=42)
Bases: Assay
scRNA-seq assay: applies a protocol-keyed Batch to a sample's cell_exp.
The protocol preset sets typical magnitudes for every technical knob below; any of
them can be overridden explicitly (None keeps the preset value). Legacy aliases are
accepted: n_reads maps onto mu_lib and lib_size_sigma onto sigma_lib.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
protocol
|
str
|
Hyper-parameter preset selecting which technical components dominate: |
"10x"
|
n_cells
|
int
|
Number of cells to sample and assay, capped at the number available. Ignored when
|
100
|
count_model
|
str
|
Final count-emission model: |
"nb"
|
batch_label
|
str
|
Label recorded for this batch/realization; defaults to |
None
|
n_reads
|
float
|
Legacy alias for |
None
|
lib_size_sigma
|
float
|
Legacy alias for |
None
|
dispersion
|
float
|
Negative-binomial overdispersion phi ( |
None
|
sigma_batch
|
float
|
Per-gene batch-factor LogNormal sd; |
None
|
mu_lib
|
float
|
Mean library size (UMIs / cell) = sequencing depth; per-cell library
|
None
|
sigma_lib
|
float
|
Per-cell library-size LogNormal sd (cell-to-cell depth variation). Default None -> preset (10x: 0.35, smartseq3: 0.45). |
None
|
ambient_frac
|
float
|
Fraction of each cell's library drawn as ambient "soup" — Poisson counts from the pooled expression profile added to every cell. Default None -> preset (10x: 0.05, smartseq3: 0.005). |
None
|
doublet_rate
|
float
|
Fraction of barcodes merged with a random partner cell (two cells combined into one). Default None -> preset (10x: 0.05, smartseq3: 0.01). |
None
|
dropout_mid
|
float
|
Logistic dropout midpoint in expected-count space (Splatter-style zero-inflation keyed to mean count); 0 disables dropout. Default None -> preset (10x: 1.5, smartseq3: 0.0, i.e. disabled). |
None
|
dropout_shape
|
float
|
Logistic dropout steepness (active only when |
None
|
well_sigma
|
float
|
Per-cell "well" / plate-position LogNormal sd — an extra per-cell multiplier nesting a plate-position effect inside the batch (Smart-seq3); 0 disables. Default None -> preset (10x: 0.0, smartseq3: 0.15). |
None
|
depth_batch_sigma
|
float
|
Per-batch depth-shift LogNormal sd, so different seeds (batches) differ in realized depth. Default None -> preset (0.05). |
None
|
kappa
|
float
|
Dirichlet concentration for the |
None
|
seed
|
int
|
RNG seed. Fixes both the technical signature of the batch (per-gene factor, depth, ambient soup) and the sampled-cell selection; two instances with the same hyper-parameters and different seeds are two batches (same biology, different technical noise). |
42
|
Methods:
| Name | Description |
|---|---|
run |
Assay single-cell RNA expression for the sampled cells. |
run ¶
Assay single-cell RNA expression for the sampled cells.
Draws per-cell UMI counts from each cell's expression state through one sequencing batch: per-gene capture factor, library size, negative-binomial overdispersion, ambient soup, dropout, and doublets.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cell_data
|
dict
|
Per-cell ground-truth tables from the sampling stage; uses the expression
table |
required |
cell_subset
|
array-like of cell IDs
|
Fix the assayed cells so that several batches share the same biology. By default every sampled cell is used. |
None
|
Returns:
| Type | Description |
|---|---|
scRNA
|
|
Technology presets¶
Pass protocol= to select a platform preset, or override individual knobs. Two presets are built
in; the rest are parameter starting points you can set explicitly, or fit from a real dataset with
estimate_rna.
| Platform | protocol |
Profile |
|---|---|---|
| 10x Chromium 3′ / 5′ | "10x" |
Droplet UMI: mu_lib ≈ 4000, dropout_mid = 1.5 (real dropout), ambient_frac = 0.05, doublet_rate = 0.05, no per-well term. |
| Smart-seq3 | "smartseq3" |
Plate UMI: deeper (mu_lib ≈ 8000), no dropout (dropout_mid = 0), low ambient (0.005), well_sigma = 0.15. |
| Smart-seq3xpress | "smartseq3" + lower mu_lib (~3000–5000) |
Miniaturised Smart-seq3 — same plate profile, shallower per cell. |
| Smart-seq2 | "smartseq3" + dispersion ≈ 0.4 |
Plate, no UMIs → read counts carry more amplification noise (raise dispersion); full-length gene-body coverage is not modelled. |