scatrans.diagnose_design

scatrans.diagnose_design#

scatrans.diagnose_design(adata_input, groupby, target_group, reference_group, sample_col=None, _min_cells_per_sample=10, *, copy_input=True)[source]#

Analyze the experimental design and provide guidance on suitable analysis choices and expected power/limitations.

This is intended as a pre-flight or post-subset diagnostic to help users interpret warnings and choose between single-cell, pseudobulk, or mixed-model paths.

Returns a dictionary with keys:
  • n_cells_target, n_cells_reference

  • n_samples_target, n_samples_reference (if sample_col provided)

  • unspliced_global_fraction

  • recommendations: list of human-readable strings

  • warnings: list of human-readable strings

  • suggested_preset: filter_active_genes preset (“heuristic” or “pseudobulk”)

  • power_summary: permutation runtime / power guidance dict

  • workflow_preset: recommended entry from WORKFLOW_PRESETS

Note: _min_cells_per_sample is reserved for future use and currently ignored.

copy_inputbool, default True

If True (default), a full deep copy of the input AnnData is made before reading. Set False for a zero-copy read-only diagnostic when the caller guarantees the input will not be mutated (saves large amounts of memory and time on big datasets with many layers).

Parameters:
  • adata_input (Any)

  • groupby (str)

  • target_group (str)

  • reference_group (str)

  • sample_col (str | None)

  • _min_cells_per_sample (int)

  • copy_input (bool)

Return type:

dict[str, Any]