Which compounds of a screen change expression in a cell line, and which genes respond to each? This guide tests every compound of the sci-Plex screen in A549 lung adenocarcinoma cells, 188 compounds at 10 nM, 100 nM, 1 uM and 10 uM for 24 hours, two wells of each dose on two culture plates, beside two vehicle wells on each of the 16 plates, whose nuclei were hashed by well and profiled together Srivatsan et al., 2020. Every compound is compared with the same vehicle wells, so the screen runs as one dose series per compound with a shared vehicle: dose_response(..., by="compound", shared_vehicle="vehicle").
The sections, each with the question it answers: what the plates hold; whether each compound supports tests; which compounds change expression; which pathways they act on; which genes respond to a histone deacetylase (HDAC) inhibitor, from which dose; and how potent that inhibitor is, gene by gene. Compound screens with a shared vehicle explains the model, why a screen’s gate takes a fold change and why a compound needs two genes to be active, and Validation gives the agreement with limma on screens of this layout.
from collections import Counter
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.patches import Patch
import cytepool
from cytepool import (
BenchmarkResponse,
Design,
DoseAxis,
check_dose_design,
dose_response,
read_cube,
)
from cytepool.plotting import plot_dose_response
# The cube: one profile per well, the sum of its nuclei's counts.
cube = read_cube("srivatsan2020_a549.cube.zarr")
print(f"CytePool {cytepool.__version__}")
print(cube)CytePool 0.1.1.dev34+g3e7dd8aae
Cube with 1,536 samples x 1 groups x 57,097 features
layers: counts (int32, lazy)
filled: 1,536 of 1,536 sample x group entries have cells (100.0%)
samples: sample_id, compound, catalog_number, dose, plate, replicate, pathway
groups: group_id
features: feature_id, symbol
What the plates hold¶
How are the wells laid out, and how many nuclei does each well give? Each sample is a well: compound names its compound, or "vehicle", dose its dose in uM, plate its culture plate and pathway what the compound targets, as the authors grouped them. Each compound sits on four plates, two wells per dose, and each plate holds two vehicle wells:
# Each well's compound, dose and culture plate.
samples = cube.samples
compound = np.asarray(samples["compound"])
dose = np.asarray(samples["dose"])
plate = np.asarray(samples["plate"])
vehicle = compound == "vehicle"
print(
f"{len(samples):,} wells on {len(set(plate))} plates; {vehicle.sum()} vehicle wells"
)
# The vehicle wells of each plate, and the plates of each compound.
per_plate = Counter(plate[vehicle].tolist())
print(f"vehicle wells per plate: {sorted(set(per_plate.values()))}")
plates_of = {c: set(plate[compound == c]) for c in set(compound[~vehicle])}
spread = sorted({len(p) for p in plates_of.values()})
print(f"{len(plates_of)} compounds, each on {spread} plates")
print("doses (uM): " + ", ".join(f"{d:g}" for d in sorted(set(dose[~vehicle]))))1,536 wells on 16 plates; 32 vehicle wells
vehicle wells per plate: [2]
188 compounds, each on [4] plates
doses (uM): 0.01, 0.1, 1, 10
The nuclei of a well are its cells recovered: a compound that kills cells, or stops their division, leaves fewer at its top doses. Wells of fewer than 10 nuclei are left out of the tests, as min_cells=10 leaves them out by default:
# The nuclei of each well, and the wells that min_cells leaves out.
cells = np.asarray(cube.n_cells)[:, 0]
print(
f"nuclei per well: median {np.median(cells):.0f}, "
f"from {cells.min()} to {cells.max()}"
)
print(f"wells of fewer than 10 nuclei: {int((cells < 10).sum())}")
# The nuclei per well at each dose.
fig, ax = plt.subplots(figsize=(6.5, 3.5))
levels = [0.0, 0.01, 0.1, 1.0, 10.0]
ax.boxplot([cells[dose == d] for d in levels], showfliers=False)
ax.set_xticks(range(1, 6), ["vehicle", "0.01", "0.1", "1", "10"])
ax.set_xlabel("dose (uM)")
ax.set_ylabel("nuclei per well")
ax.set_title("A549 at 24 hours")
plt.show()nuclei per well: median 108, from 3 to 198
wells of fewer than 10 nuclei: 3

The median falls from about 115 nuclei per well for the vehicle to about 100 at 10 uM, and the wells at 1 and 10 uM reach lower: the compounds that kill cells or stop their division leave fewer nuclei there. The plates enter the model as a term of the design, "~ plate", so that each dose is compared with the vehicle on the same plates Harrill et al., 2021Lun & Marioni, 2017.
Does each compound support tests?¶
Can each compound’s dose series be compared with the vehicle? check_dose_design with by and shared_vehicle reads one model of every well: the plates, an intercept and an indicator of each dose of each compound, and gives each compound its own status from its own dose groups, with the shared vehicle as its vehicle:
# One model of every well: the plates and an indicator of each compound's dose.
axis = DoseAxis("dose", unit="uM", metric="nominal")
design = Design(samples, "~ plate")
report = check_dose_design(
cube, design, dose=axis, by="compound", shared_vehicle="vehicle"
)
print(report)
# One compound's rows of the doses table: the shared vehicle's, then its own.
doses = report.doses.filter(series="Pracinostat (SB939)")
for row in range(len(doses)):
label = "vehicle" if doses["dose"][row] == 0 else f"{doses['dose'][row]:g} uM"
print(
f"{label}: {doses['n_samples_used'][row]} wells, at least "
f"{doses['n_cells_min'][row]:.0f} nuclei, estimable {doses['estimable'][row]}"
)DoseDesignReport: 1 cell type, 5 doses from 0 to 10 uM, 188 series of compound
against the shared vehicle 'vehicle'
A549: 188 series, 188 inferential; 765 residual df
vehicle: 32 wells, at least 52 nuclei, estimable False
0.01 uM: 2 wells, at least 71 nuclei, estimable True
0.1 uM: 2 wells, at least 64 nuclei, estimable True
1 uM: 2 wells, at least 72 nuclei, estimable True
10 uM: 2 wells, at least 33 nuclei, estimable True
Every compound supports tests. Each keeps both wells at each dose, except three compounds that keep one well at one dose once the 3 wells of fewer than 10 nuclei are left out, and the design can compare each dose with the vehicle apart from the plates; the model leaves 765 residual degrees of freedom, which every compound’s tests share. A compound’s rows start with the 32 vehicle wells that every compound shares; the vehicle row is never estimable, since it is the reference. A compound that lost a dose group would keep its other doses, and one that lost every well would be refused with the reason, which the printout names for at most five compounds of each status.
Which compounds change expression?¶
Which of the 188 compounds move the expression of A549 cells? dose_response fits the line once and tests each compound against the shared vehicle. The gate decides which of a compound’s genes count as responding. A screen’s gate tests each dose’s change from the vehicle against a 1.5-fold change by TREAT, multiplies a gene’s smallest p-value by the 4 doses (Bonferroni), and runs Benjamini-Hochberg at 5% within the compound: the part that BMDExpress’s prefilter with a fold-change filter plays, with the fold change tested rather than cut from the estimate. tests="spline" runs beside it the spline test, whether a gene follows a smooth curve of dose (Which genes respond to dose). The genes are filtered within each plate’s wells, expression_filter={"sample_groups": "plate"}, since every plate holds wells of every dose: the design’s filter takes its smallest group from a dose group of two wells and keeps genes seen in a few wells, which on these wells bend voom’s trend below zero and stop the fit. The run takes about 40 seconds on two threads:
screen = dose_response(
cube,
design,
dose=axis,
by="compound",
shared_vehicle="vehicle",
tests="spline",
expression_filter={"sample_groups": "plate"},
)
print(screen)DoseResponseResult (limma_voom): 1 cell type, 1 tested; 188 series of compound
against the shared vehicle 'vehicle'; tests: spline
dose: uM (nominal) on a log10 axis, the vehicle in a group of its own; spline
of 2 columns, knots at 0.316 uM, boundary knots at 0.01 and 10 uM
gate: TREAT beyond 1.5-fold at each dose, Bonferroni over the cell type's
doses, Benjamini-Hochberg within each cell type, at 5% FDR
A549: 188 of 188 series tested, 6,167 genes; 86 with a gene through the gate;
most: Panobinostat (LBH589) 1,347, Quisinostat (JNJ-26481585) 2HCl
1,240, Dacinostat (LAQ824) 1,096, AR-42 1,015, Trichostatin A (TSA) 951
Each compound runs the spline test and the gate, as one dose series would: screen.table("A549", "spline", series=...) gives a compound’s genes. DoseResponseResult.compound_summary says which compounds are active: those of which at least two genes pass the gate’s test, here change beyond 1.5-fold at a dose. Each compound’s p-value of two genes is adjusted by Benjamini-Hochberg across the line’s compounds, and a compound is active at the gate’s 5% FDR. One gene does not make a compound active: at the level that 188 compounds and thousands of genes ask of one gene’s p-value, limma-voom’s null p-values fall too often (Compound screens with a shared vehicle).
# Each compound's genes through the gate and its active call.
summary = screen.compound_summary()
passing = np.nan_to_num(np.asarray(summary["n_genes_passing_gate"]))
active = np.asarray(summary["active"])
print(
f"{int((passing > 0).sum())} compounds have a gene through their gate, "
f"{int((passing > 1).sum())} two or more; {int(active.sum())} are active"
)
# The compounds that pass the most genes, with the pathway each acts on.
pathway = dict(zip(compound.tolist(), np.asarray(samples["pathway"]).tolist()))
order = np.argsort(-passing, kind="stable")
for row in order[:12]:
name = summary["series"][row]
adjusted = summary["adjusted_p_value"][row]
print(
f"{name}: {passing[row]:,.0f} genes, adjusted p {adjusted:.1g} "
f"({pathway[name]})"
)86 compounds have a gene through their gate, 79 two or more; 74 are active
Panobinostat (LBH589): 1,347 genes, adjusted p 8e-67 (Histone deacetylation)
Quisinostat (JNJ-26481585) 2HCl: 1,240 genes, adjusted p 6e-72 (Histone deacetylation)
Dacinostat (LAQ824): 1,096 genes, adjusted p 7e-67 (Histone deacetylation)
AR-42: 1,015 genes, adjusted p 2e-70 (Histone deacetylation)
Trichostatin A (TSA): 951 genes, adjusted p 2e-76 (Histone deacetylation)
CUDC-907: 945 genes, adjusted p 2e-52 (Histone deacetylation)
Givinostat (ITF2357): 901 genes, adjusted p 7e-82 (Histone deacetylation)
Pracinostat (SB939): 851 genes, adjusted p 2e-65 (Histone deacetylation)
Abexinostat (PCI-24781): 820 genes, adjusted p 5e-52 (Histone deacetylation)
M344: 651 genes, adjusted p 2e-59 (Histone deacetylation)
Belinostat (PXD101): 625 genes, adjusted p 2e-53 (Histone deacetylation)
YM155 (Sepantronium Bromide): 471 genes, adjusted p 2e-14 (Mitochondria-mediated apoptosis)
n_genes_passing_gate counts a compound’s genes whose change at some dose TREAT calls beyond 1.5-fold at the gate’s 5% FDR, and adjusted_p_value is the compound’s adjusted p-value of two genes. The compounds that move the most genes are HDAC inhibitors, as the screen’s authors found. Of the 86 compounds with a gene through their gate, 7 pass one gene only, which does not make a compound active, and 5 pass two or more whose p-values fall short once the 188 compounds are adjusted together.
Which pathways do the active compounds act on?¶
Do the active compounds share their targets? The authors grouped the compounds by the pathway they act on; the share of each pathway’s compounds that is active, and the genes they move, say which mechanisms change A549 cells’ expression at these doses:
# Each pathway's compounds: how many are active, and the median genes they pass.
by_pathway = {}
for name, is_active, genes in zip(
summary["series"].tolist(), active, passing, strict=True
):
by_pathway.setdefault(pathway[name], []).append((is_active, genes))
rows = sorted(by_pathway.items(), key=lambda item: -sum(a for a, _ in item[1]))
for name, found in rows[:8]:
called = sum(a for a, _ in found)
median = np.median([g for _, g in found])
print(f"{name}: {called} of {len(found)} active, median {median:.0f} genes")
# The 30 compounds that pass the most genes, coloured by the 4 pathways most of them
# act on.
top = order[:30]
names = [summary["series"][r] for r in top]
common = [p for p, _ in Counter(pathway[n] for n in names).most_common(4)]
colours = {p: plt.cm.tab10(i) for i, p in enumerate(common)}
fig, ax = plt.subplots(figsize=(6.5, 6.0))
ax.barh(
range(len(top)), passing[top], color=[colours.get(pathway[n], "0.7") for n in names]
)
ax.set_yticks(range(len(top)), names, fontsize=7)
ax.invert_yaxis()
ax.set_xlabel("genes through the 1.5-fold gate")
handles = [Patch(color=c, label=p) for p, c in colours.items()]
ax.legend(
handles=[*handles, Patch(color="0.7", label="other pathways")],
fontsize=7,
loc="lower right",
)
ax.set_title("The 30 compounds that pass the most genes")
plt.show()Histone deacetylation: 16 of 32 active, median 31 genes
Aurora kinase activity: 10 of 16 active, median 4 genes
RTK activity: 9 of 20 active, median 2 genes
JAK kinase activity: 6 of 18 active, median 0 genes
Nucleotide analog: 4 of 7 active, median 83 genes
HSP90 activity: 3 of 3 active, median 53 genes
Mitochondria-mediated apoptosis: 3 of 3 active, median 17 genes
Bromodomain: 2 of 2 active, median 19 genes

The HDAC inhibitors move the most genes: four of them over a thousand each, and 16 of the 32 compounds of histone deacetylation are active. Inhibitors of Aurora kinases are active more often, 10 of 16, and of receptor tyrosine kinases about as often, 9 of 20, though with a median of a few genes each.
Which genes respond to an HDAC inhibitor, and from which dose?¶
Which genes does one HDAC inhibitor move, and from which dose? Pracinostat (SB939), an active HDAC inhibitor, passes 851 genes through its gate. A compound’s tables are read with series=, and its lowest effective doses call each dose against the vehicle in the genes that pass its gate, here beyond the gate’s 1.5-fold change, from the line’s fit computed again; the result keeps that fit, so the lowest effective doses of the line’s other compounds take a fraction of a second each:
# The inhibitor's gate, spline test and lowest effective doses.
inhibitor = "Pracinostat (SB939)"
gate = screen.table("A549", "gate", series=inhibitor)
spline = screen.table("A549", "spline", series=inhibitor)
lowest = screen.lowest_effective_doses("A549", series=inhibitor)
passed = np.asarray(gate["passes_gate"])
print(f"{inhibitor}: {int(passed.sum()):,} of {len(gate):,} genes pass the gate")
# How many of the genes it passes respond from each dose.
first = Counter(np.asarray(lowest["lowest_effective_dose"])[passed].tolist())
for d in sorted(k for k in first if not np.isnan(k)):
print(f" lowest effective dose {d:g} uM: {first[d]:,} genes")
# The six genes of smallest spline p-values.
best = np.argsort(np.asarray(spline["p_value"]))[:6]
for row in best:
print(
f" {spline['symbol'][row]}: spline p {spline['p_value'][row]:.1e}, "
f"lowest effective dose {lowest['lowest_effective_dose'][row]:g} uM"
)Pracinostat (SB939): 851 of 6,167 genes pass the gate
lowest effective dose 0.01 uM: 9 genes
lowest effective dose 0.1 uM: 33 genes
lowest effective dose 1 uM: 235 genes
lowest effective dose 10 uM: 574 genes
UBR3: spline p 2.2e-114, lowest effective dose 10 uM
AC010197.1: spline p 1.4e-99, lowest effective dose 1 uM
ACSL3: spline p 3.9e-98, lowest effective dose 1 uM
HMGCS1: spline p 5.2e-91, lowest effective dose 10 uM
MORF4L1: spline p 2.0e-82, lowest effective dose 10 uM
COL26A1: spline p 1.8e-80, lowest effective dose 1 uM
Two thirds of the genes that pass the gate respond from 10 uM, a quarter from 1 uM and 42 from 0.1 uM or below: the inhibitor’s response grows with dose and reaches most genes at the top dose. The curves of the three genes with the smallest spline p-values, each dose’s change from the vehicle with the spline fitted through the doses and its 95% band:
# Each dose's change from the vehicle, with the spline and its 95% band.
genes = [spline["feature_id"][row] for row in best[:3]]
fig, ax = plt.subplots(figsize=(6.5, 4.0))
plot_dose_response(screen, "A549", genes=genes, series=inhibitor, ax=ax)
ax.set_title(f"{inhibitor} in A549")
plt.show()
Each point is a dose’s change from the vehicle on the same plates, and the band holds the spline fitted to the dose groups’ means. AC010197.1 rises along the whole series: from 1 uM its change is called beyond 1.5-fold, its lowest effective dose, while at 0.1 uM it changes about 2.4-fold with a standard error of 0.46 log2 units, too uncertain to call beyond 1.5-fold. UBR3 stays near the vehicle up to 1 uM and jumps at 10 uM, its lowest effective dose.
How potent is the inhibitor, gene by gene?¶
At which dose does each of the inhibitor’s genes reach a 1.5-fold change, and where is its half-maximal effect? A screen fits no curves of named models, so run dose_response on the inhibitor’s wells and the shared vehicle’s, with the plates in the design: the four-parameter log-logistic curve, models="ll4", fitted with variance="weighted", which reads the dose groups’ means adjusted for the plates, where the default constant variance would leave the plates out; benchmark doses at a 1.5-fold change, bmr=BenchmarkResponse.absolute(np.log2(1.5)); and the screen’s gate and filter. The run fits every gene and takes about two minutes:
# The inhibitor's wells and the shared vehicle's, with the plates in the design.
mine = samples.filter((compound == inhibitor) | vehicle)
one = dose_response(
cube,
Design(mine, "~ plate"),
dose=axis,
models="ll4",
variance="weighted",
bmr=BenchmarkResponse.absolute(np.log2(1.5)),
gate={"fold_change": 1.5},
expression_filter={"sample_groups": "plate"},
)
# The EC50s of the genes through the gate that lie within the doses.
ec50s = one.table("A549", "ec50s")
through = np.asarray(ec50s["passes_gate"])
within = through & (np.asarray(ec50s["ec50_status"]) == "within the doses")
ec50 = np.asarray(ec50s["ec50"])[within]
low, high = np.quantile(ec50, [0.25, 0.75])
print(f"{int(through.sum()):,} genes through the gate")
print(
f" {int(within.sum()):,} EC50s within the doses: median {np.median(ec50):.2g} "
f"uM, middle half {low:.2g} to {high:.2g} uM"
)
# Their benchmark doses at a 1.5-fold change.
bmds = one.table("A549", "benchmark_doses")
first = np.asarray(bmds["bmr"]) == bmds["bmr"][0]
reached = (
first
& np.asarray(bmds["passes_gate"])
& (np.asarray(bmds["bmd_status"]) == "within the doses")
)
bmd = np.asarray(bmds["bmd"])[reached]
print(
f" {int(reached.sum()):,} benchmark doses within the doses: median "
f"{np.median(bmd):.2g} uM"
)860 genes through the gate
510 EC50s within the doses: median 1 uM, middle half 0.11 to 1.3 uM
710 benchmark doses within the doses: median 0.4 uM
In its own run, Pracinostat passes 860 genes through the gate, close to the screen’s 851, whose filter read every well and whose genes’ variances every compound shares. 510 of them have an EC50 within the doses, a median of 1 uM, and 710 reach a 1.5-fold change within the doses, at a median benchmark dose of 0.4 uM. Potency and points of departure explains EC50s and benchmark doses, and the points of departure that sum up a compound’s genes.
What to read where¶
Compound screens with a shared vehicle explains the model of a screen, the fit with the dose groups swept out, the active calls and their error rates, and what a run with a shared vehicle does not take.
Validation compares each compound’s tests with limma on the dense design of a simulated screen, and gives the error rates of the active calls on null screens.
Dose response per cell type follows one dose series through curves, benchmark doses and points of departure, which run on one compound’s wells and the vehicle’s as the section above runs them.
- Srivatsan, S. R., McFaline-Figueroa, J. L., Ramani, V., Saunders, L., Cao, J., Packer, J., Pliner, H. A., Jackson, D. L., Daza, R. M., Christiansen, L., Zhang, F., Steemers, F., Shendure, J., & Trapnell, C. (2020). Massively multiplex chemical transcriptomics at single-cell resolution. Science, 367(6473), 45–51. 10.1126/science.aax6234
- Harrill, J. A., Everett, L. J., Haggard, D. E., Sheffield, T., Bundy, J. L., Willis, C. M., Thomas, R. S., Shah, I., & Judson, R. S. (2021). High-Throughput Transcriptomics Platform for Screening Environmental Chemicals. Toxicological Sciences, 181(1), 68–89. 10.1093/toxsci/kfab009
- Lun, A. T. L., & Marioni, J. C. (2017). Overcoming confounding plate effects in differential expression analyses of single-cell RNA-seq data. Biostatistics, 18(3), 451–464. 10.1093/biostatistics/kxw055