Compare phase response curves¶
Question¶
Do two independent cohorts respond differently to stimulus timing?
See every package-generated example · Read the complete analysis pipeline
When to use¶
Use this to compare stimulus-time response curves from two independent cohorts.
Example figure¶
This deterministic example is calculated by the compare_phase_response_curves action and drawn by render_compare_phase_response_curves_svg, the same renderer used for publication export. Empty or withheld elements are therefore visible exactly as they are in a real result.
import circadian_workbench as cw
cw.call("compare_phase_response_curves", shift_cohorts=cohorts)
Required inputs and controls¶
The public function is the registered action below. settings= is accepted as a friendlier alias for config= by cw.call; the calculation stores the complete normalized config in provenance.
Function reference¶
cw.call("compare_phase_response_curves", shift_cohorts, config=None, unit='animal')
Arguments and parameters¶
| Name | Type | Required | Default | Units | Meaning |
|---|---|---|---|---|---|
shift_cohorts |
object | yes | — | - | Two labelled cohorts of pulsed animals, to test whether their phase response curves differ: {'WT': [animal, ...], 'KO': [...]}. Each animal takes the same shape phase_response_curve's animals does -- a record to score, or a point already scored. Exactly two cohorts: which contrast is meant is a decision about the experiment. |
config |
object | no | null |
- | Partial scientific settings. Omitted or None values use the shared installed defaults; invalid fresh values are rejected. Run describe_config for names, meanings, units, bounds and choices. Explicitly load old saved mappings with load_saved_settings to report compatibility conversions. |
unit |
string | no | "animal" |
- | Independent animal supplying each phase-response point; the legacy default is animal. |
Every nested config key, default, allowed value, and purpose is listed in the complete configuration reference.
How it works¶
Each cohort's scored shifts are fitted to the same periodic basis and compared at the cohort level.
$$ \Delta(CT)=\sum_k[a_k\cos(kCT)+b_k\sin(kCT)] $$
Implementation: phase_response.py::compare_phase_response_curves.
Outputs and interpretation¶
The result includes both fitted curves, parameter contrasts and an overall curve-difference test.
cw.call returns a Result: use .data for calculated values, .warnings for scientific qualifications, .provenance for version and input identity, .script for an equivalent replay script, and .files for saved outputs.
Limitations¶
The cohorts need adequate coverage across circadian time; an uneven stimulus schedule can confound a difference.
Example¶
The figure above is a real package result from a seeded, redistributable synthetic dataset. The flat gallery bundle retains figure_data_compare-phase-response-curves.csv, a standalone plot_compare-phase-response-curves.py, source hashes, an editable SVG, and a rendered preview.
Methods text¶
Two independent cohorts' phase response curves were fitted and compared with the action's declared correction.
See also¶
Fit a phase response curve · Measure a dose response · Measure phase angle · Analysis index · Gallery