# Constructed data: expression of a clock gene (log scale) sampled every 4 h for 48 h (ZT0 to ZT44), 3 different mice
# per time point and genotype (one sample per mouse). True rhythms: WT mesor 5.0, amplitude 1.0, peak at ZT10;
# KO mesor 5.0, amplitude 0.5, peak at ZT12; residual SD 0.4. The seed (1) was the first one run; it was not selected.
import numpy as np, pandas as pd
rng = np.random.default_rng(1); rows = []
for g, (m, a, pk) in {"WT": (5.0, 1.0, 10), "KO": (5.0, 0.5, 12)}.items():
    for zt in range(0, 48, 4):
        for i in range(3):
            y = m + a * np.cos(2 * np.pi * (zt - pk) / 24) + rng.normal(0, 0.4)
            rows.append((g, zt, f"{g}-ZT{zt}-{i+1}", round(y, 3)))
pd.DataFrame(rows, columns=["genotype", "zt", "mouse", "expr"]).to_csv("rhythm.csv", index=False)
