A reviewer who receives a transcriptomic point of departure has to judge what was done to the data and to be able to do it again. write_dose_response_records writes one directory per run of dose_response: a dose-response record of each cell type, in the shape of OECD’s reporting module for benchmark-dose analyses of omics data OECD, 2023, the tables that the records summarize, a methods paragraph and a manifest of every file. This page specifies the files and the keys; Record each cell type’s analysis shows how to use them.
cp.write_dose_response_records(etap, "records", points_of_departure=pods)The directory¶
| File | Contents |
|---|---|
manifest.json | the manifest: format ("cytepool.dose_response_records"), format_version (1) and files, one entry per other file with file, description, group_id (null for a file of every cell type) and sha256; a table adds rows (what a row is), n_rows and columns, each with its name, type (text, number, integer or logical) and description |
methods.txt | the methods paragraph, then “References” and one reference per line (DoseResponseResult.methods_text) |
cell_types/<name>.json | the record of each cell type (DoseResponseResult.record); <name> is the cell type’s id when it is portable, as cube files name their arrays (Tables), and not of the form cell_type_<n>, else cell_type_<position>, counted from 1 in the result’s order |
samples.tsv | each sample of each cell type, its dose, cells and counts, and whether the analysis used it (design_report.samples) |
gate.tsv | each gene’s call by the gate, the test that decides which genes count as responding, which the manifest’s description names, cell types one after the other |
benchmark_doses.tsv | with bmr or rules: the benchmark doses of each gene’s best curve |
rule_set.tsv | with rules: the rule set’s verdicts on each gene it kept |
points_of_departure.tsv, points_of_departure_genes.tsv, gene_sets.tsv, points_of_departure_without_top_dose.tsv, study_point_of_departure.tsv | with points_of_departure: its summary, its tables of genes and of gene sets, the summary of the run without the top dose and the value for the study, each when present |
permutation_check.tsv, permutation_check_points_of_departure.tsv | with permutation_check: its summary, and for a check of points of departure its table of them |
Each test’s table, the curves and the EC50s are not written, since module 4.3 has no item for them: result.table(group, name) gives them, as does a run again from a record’s rerun (below). A table of several cell types starts with group_id and holds the union of their columns, in the order first met, with NA where a cell type’s table has no such column, such as passes_gate of a cell type that supports only description. The directory appears only once it is complete: the files are written into a new hidden directory beside it, .<directory>.partial-<random>, renamed to the target at the end, as write_cube writes cube files (Reading and writing); a write that fails removes the hidden directory, and an existing directory is never replaced. The same result written twice gives the same bytes.
The tables are tab-separated UTF-8 text with a header row and \n line ends, as R’s write.table writes them: floats as the shortest text that reads back as the same float, NaN as NA, infinities as Inf and -Inf, integers as digits, booleans as TRUE and FALSE, missing text as NA, and a field that holds a tab, a line end or a double quote within double quotes, its quotes doubled. Read them back value for value with the column types that the manifest gives, as the Validation page does: in R, read.delim(file, quote = "\"", na.strings = "NA", colClasses = ...) with character, numeric, integer and logical for text, number, integer and logical; in pandas, with its types that hold missing values, since a column such as passes_gate holds NA for a cell type that supports only description:
manifest = json.loads(Path("records/manifest.json").read_text())
entry = next(e for e in manifest["files"] if e["file"] == "benchmark_doses.tsv")
types = {"text": "str", "number": "float64", "integer": "Int64", "logical": "boolean"}
table = pd.read_csv(
"records/benchmark_doses.tsv",
sep="\t",
keep_default_na=False,
na_values=["NA"],
dtype={column["name"]: types[column["type"]] for column in entry["columns"]},
)Without the types, a text column whose values all look like numbers or TRUE is read as numbers or booleans, and pandas reads empty text as missing. Text equal to NA reads as missing in both, as with R’s own files.
The record¶
A record is a JSON object of one cell type, which json.load reads:
| Key | Contents |
|---|---|
format, format_version | "cytepool.dose_response_record" and 1 |
group_id, status, tested, reason | the cell type, the design check’s status ("inferential", "descriptive" or "refused"), whether it was tested, and why not |
scope | that the record covers the pseudobulk profiles of one cell type analysed as one data set, a stratified application of the methods named, which no regulatory document defines, so that it is not an NTP or ETAP assessment; for a cube without cell numbers, such as bulk counts, that its profiles are analysed as one data set |
oecd_2023 | framework, the document, and items, OECD’s items by number (below) |
pseudobulk | per dose group (dose_groups) the samples used (n_samples) and the fewest, median and most cells (n_cells) and counts (total_counts) of their profiles, with min, median and max; min_cells, min_counts, and cells, which says how profiles were formed, or that the cube records no cell numbers, so that min_cells did not apply: what module 4.3 has no field for |
r_odaf | the statement on R-ODAF’s rules (below) |
rule_set | null without rules; else the rule set (below) |
permutation_check | null without permutation_check; else its settings and the cell type’s row of its summary, or checked false with the reason for a cell type it did not check, and for a check of points of departure the cell type’s rows of them (points_of_departure) |
results | summary, the cell type’s row of the result’s summary; with BMDs, bmd_statuses, the count of each bmd_status per BMR; with points of departure, points_of_departure, the cell type’s rows of their summary |
run_time | dose_response and, with points of departure, points_of_departure, each with cell_type, the seconds of each stage in this cell type, and whole_run, those of the whole call. For dose_response the stages are linear_model, which also computes the fit again for the multiple contrast tests and curves, multiple_contrast_tests, gate, which with a fold change computes the fit again too, curves, benchmark_doses and rule_set, which holds the rule set’s curves and BMDs, where they ran, and the whole call’s started_at (UTC), design_check and total; for points_of_departure, the cell type’s points_of_departure, and the whole call’s started_at, without_top_dose, when asked for, and total |
rerun | what runs the analysis again (below) |
study_conditions | what the analyst stated about the study (species, strain, sex, age, route, exposure, tissue), or null |
A NaN is written as null, with its status or reason beside it, and an infinity, such as an infinite prior degree of freedom, as "Inf" or "-Inf", so that the files hold standard JSON.
OECD’s items¶
items holds each item of module 4.3 of the OECD Omics Reporting Framework OECD, 2023, and from module 4.1 items 4.1.4.2 and 4.1.5.3, keyed by number: item, its title, and report, what the run did, or "NA" and a reason where the run did not take the step, the framework’s own convention.
| Item | Title | The record reports |
|---|---|---|
| 4.3.1.1 | Data Input | the cube’s fingerprint and provenance, the layer counts and the cell type; for scores, their type, method and settings |
| 4.3.1.2 | Metadata Input | the samples’ table, matched by sample_id, the dose column, the design’s variables, random effects and batch |
| 4.3.2.1 | Software | CytePool and its version, the functions run and the analysis |
| 4.3.2.2 | Operating System | the computer of the run: operating system, machine, Python’s implementation, llvmlite, numpy’s BLAS and the instruction sets it uses (cpu_features), numba’s threads |
| 4.3.2.3 | Additional Libraries Used | numpy (with its BLAS), numba, llvmlite and Python, each with its version and download link |
| 4.3.2.4 | Software Availability | the source repository, the version’s download (a PyPI release, the commit of a development version, or OECD’s words “this library is not available for download”), the licence, the documentation and the Validation page |
| 4.3.3.1 | Dose Levels | the unit, metric and axis, and each dose with its samples kept (n_samples, samples) and whether it was analysed, with the reason when not |
| 4.3.3.2 | Annotation for Model Substrate Data (MSD) | the features, their ids and the values tested; with points of departure, how features of one id are averaged |
| 4.3.3.3 | Version of Platform Annotation that Corresponds to Technology | the cube’s source record, or that the cube records none |
| 4.3.4.1 | Statistical Test Performed to Identify Dose-Responsive MSD | the gate in words, and under a rule set its ANOVA pre-modelling test, Williams’ trend test and fold change in the rule set’s words, with the other tests run; direction, two-sided, or the direction of the one-sided tests |
| 4.3.4.2 | Statistical Threshold Applied | the gate’s FDR, and its direction when it is one-sided; under a rule set, Williams’ p < 0.05, not adjusted, with a 1.5-fold change, and an adjusted ANOVA p-value below 0.05 for the cell type |
| 4.3.4.3 | Statistical Multiple Testing Correction Method | Benjamini-Hochberg within the cell type, with Bonferroni over the doses for a fold change; under a rule set, Benjamini-Hochberg for the ANOVA pre-modelling test and none for Williams’ test |
| 4.3.4.4 | Additional Statistical Test Parameters | the spline, the moderation (df_prior, df_residual, the prior’s share), voom’s and the samples’ weights, random effects, the seeds of the multiple contrast tests and of Williams’ permutations |
| 4.3.4.5 | Additional Filtering | min_cells, min_counts, the expression filter, the gate’s fold change, and the rule set’s values and fold change |
| 4.3.5.1 to 4.3.5.12 | BMD modelling | the approach, the model choice, the models fitted and not fitted, NA for averaging, each BMR’s label, type and the distribution its bounds read, the BMRs given with the 1 SD comparison beside, the fits’ and the search’s settings, the bounds, each model’s restricted parameters in words (k from 0 to 5 times the top dose), the variance, the model selection, NA for a set of one model such as "ll4", and the doses searched, the BMD statuses and the flag sets’ checks; NA with the reason where the cell type has no curves |
| 4.3.6.1 to 4.3.6.4 | Gene sets | with points of departure: the gene-set collection’s record and id_column, the genes that entered, the rules’ criteria of active sets and the medians. Gene sets given as a dict record no name, version, licence, file or SHA-256; read_gmt with name and version, or GeneSets with them, records the collection |
| 4.3.7.1 | Output and Supporting Files | that manifest.json lists the files |
| 4.1.4.2 | Covariance | what the model assumes (random intercepts or independent profiles), the batch checked, the pooling of cells where the cube records cells, and that other sources are the analyst’s to state |
| 4.1.5.3 | Effects Model | the design’s formula, the dose groups’ indicators and random effects, and dose_group_model, the formula of the model fitted: the design’s formula, + 1, which keeps the vehicle’s mean as the intercept even under ~ 0, and one indicator per treated dose |
R-ODAF’s rules¶
The Regulatory Omics Data Analysis Framework (R-ODAF) sets rules for RNA-seq data in a regulatory application Verheijen et al., 2022. r_odaf gives source, selection (the genes the run selected, those passing the gate or under a rule set its prefilter: genes, in words, with n_genes_tested and n_genes_selected), reading and rules, one row per rule with rule, required and status:
read depth,base quality,alignmentandoutlier samples:"not assessed", with thereason: reads are properties of each sequencing library, which a cube does not hold, and the outlier rule is a judgement on a PCA plot.relevance,spurious spikeandthird quartile:"met"when no selected gene fails,"not met"with the failing genes (selected_failing,n_selected_failing), or"not assessed"with the reason, such as no gene selected. Relevance also counts the genes tested that fail it (n_tested_failing).differential expression:"differs": R-ODAF tests each dose against the vehicle with DESeq2’s Wald test.false discovery rate:"met"when the gate’s FDR is at most 0.01,"not met"otherwise and under a rule set, whose prefilter takes Williams’ p-value unadjusted.
R-ODAF reads each comparison of a treatment with its control, so the statement reads each treated dose against the vehicle: a gene meets the rules at a dose when the vehicle or the dose has 75% of its replicates at 1 CPM or more, neither holds a replicate with more than 1.4 n^-0.66 of its normalized count, n its replicates (0.678 at 3 replicates, which the paper rounds to 2/3), and the median of one lies above the third quartile of the other, R’s type 7 quantile; it meets them when it does so at one dose or more. A gene that does not is counted at the first rule it fails, in R-ODAF’s order. CPM are those of DESeq2’s normalized counts, which equal 1e6 counts / library size, and the spike and quartile rules read the normalized counts, DESeq2’s ratio size factors over the samples the selection used; where every feature has a zero, the factors are undefined and those two rules are not assessed. R-ODAF applies relevance before its test and the other two rules to the genes it calls; the record checks all three on the genes the run selected and applies none. The quartile rule follows Sec. 4.2’s words, the median “not higher than the third quartile of the opposite condition”; the legend of the paper’s Fig. 4 also accepts a median below the other’s first quartile.
The rule set’s departures¶
Under rules, rule_set gives name, document, settings (the rows of DoseResponseResult.rules with each step’s outcome), minimums, departures and, for ETAP, study_conditions and review. minimums holds ETAP’s minimums of the study and of the cell type, each with minimum, section, required, observed, met, when_unmet and scope; NTP states none National Toxicology Program, 2018. departures lists each unmet minimum, as minimum (Sec. section): required: ...; observed: ...; when_unmet, each step the rule set does not apply, and, where the cube records cells, the analysis of one cell type’s pseudobulk profiles in place of bulk RNA of the tissue. study_conditions sets each of ETAP’s study conditions (US EPA 2024, Sec. 3.4.2 and 3.4.3: species, strain, sex, age, route, exposure, tissue) beside what the analyst stated, each with condition, etap, section and stated, the analyst’s words or "not stated", and review gives Sec. 3.8’s rule: an ETAP with substantive modifications of the standardized methods also receives independent external peer review, and whether the departures are such modifications is EPA’s determination US Environmental Protection Agency, 2024.
Versions of the format¶
format_version is 1. A change to the keys of a record or the manifest, or to their meaning, after a release raises it, so that a reader can tell which keys to expect: the OECD framework may add a module for single-cell data, which no regulatory document covers yet Mitchell et al., 2025.
Run an analysis again¶
rerun holds function ("cytepool.dose_response"), cube, the fingerprint of the cube analysed, design (formula, random, levels and samples, the columns of the design’s samples that the run read: sample_id, the dose column, the formula’s variables, the random effects’ groupings, the batch and a column that the expression filter names), and arguments, every keyword argument of dose_response as recorded: the dose axis, candidate shapes and BMRs as their to_dict() give them, the analysis by name, the recorded seed as rng and the analysis’s options. With points of departure, points_of_departure holds their arguments and the gene-set collection’s record, and with a permutation check, permutation_check its arguments. A record of scores cannot run again without the scores, which 4.3.1.1 names.
Read a record and the cube whose fingerprint it names:
import json
from pathlib import Path
record = json.loads(Path("records/cell_types/hepatocyte.json").read_text())then rebuild the arguments and run the analysis again:
rerun = record["rerun"]
assert cube.fingerprint() == rerun["cube"]
arguments = dict(rerun["arguments"])
arguments["dose"] = cp.DoseAxis(**arguments["dose"])
arguments["analysis"] = getattr(cp, arguments["analysis"])
if arguments["candidates"] is not None:
arguments["candidates"] = cp.CandidateShapes(**arguments["candidates"])
if arguments["bmr"] is not None:
arguments["bmr"] = [cp.BenchmarkResponse(**bmr) for bmr in arguments["bmr"]]
design = rerun["design"]
again = cp.dose_response(
cube,
cp.Design(
cp.Table(design["samples"]),
design["formula"],
random=design["random"],
levels=design["levels"],
),
**arguments,
)With points of departure, run them again on the gene sets given, gene_sets, which item 4.3.6.1 identifies by their collection’s name, version, file and SHA-256:
points = cp.points_of_departure(
again, gene_sets=gene_sets, **rerun["points_of_departure"]["arguments"]
)On the same kind of processor, this gives the run’s tables value for value; the Validation page runs it from every record it writes. A run of other cell types, or of one alone, changes adjusted_p_value_across_groups, which adjusts over the cell types run together, so keep the recorded groups. On a processor with AVX-512, numpy’s float64 log2 and similar can change the last digits of some values; cpu_features in 4.3.2.2 says which instructions the run used.
- OECD. (2023). OECD Omics Reporting Framework (OORF): Guidance on reporting elements for the regulatory use of omics data from laboratory-based toxicology studies (OECD Series on Testing and Assessment No. 390). OECD Publishing. 10.1787/6bb2e6ce-en
- Verheijen, M. C. T., Meier, M. J., Asensio, J. O., Gant, T. W., Tong, W., Yauk, C. L., & Caiment, F. (2022). R-ODAF: Omics data analysis framework for regulatory application. Regulatory Toxicology and Pharmacology, 131, 105143. 10.1016/j.yrtph.2022.105143
- National Toxicology Program. (2018). NTP Research Report on National Toxicology Program Approach to Genomic Dose-Response Modeling (NTP Research Report No. 5). National Institute of Environmental Health Sciences. 10.22427/ntp-rr-5
- US Environmental Protection Agency. (2024). Standard Methods for Development of EPA Transcriptomic Assessment Products (ETAPs) (EPA Report EPA/600/X-23/083). US Environmental Protection Agency, Office of Research. 10.23645/epacomptox.25365496
- Mitchell, C. A., Wehmas, L., Rouquié, D., Caiment, F., Currie, R. A., & Crute, C. E. (2025). Navigating complexity in modern toxicology: the role of omics in short-term in vivo studies. Toxicological Sciences, 208(1), 32–37. 10.1093/toxsci/kfaf120