bulkrna-cosinor-rhythm
Load when the user needs Deterministic fixed-period 24-hour single-component cosinor OLS rhythm analysis for a bulk RNA time-course CSV. Skip when an existing bulkrna skill already covers the request.
- License 许可
- Apache-2.0
- 最近更新
- 2026-10-08
- Stars
- ★ 161
- Forks
- 27
01 前言 Front Matter
- name
- bulkrna-cosinor-rhythm
- tags
- [ "bulkrna", "autogenerated", "skill-scaffold" ]
- trigger
- cosinor, circadian rhythmicity, 24-hour rhythm, bulk RNA time course
- description
- Load when the user needs Deterministic fixed-period 24-hour single-component cosinor OLS rhythm analysis for a bulk RNA time-course CSV. Skip when an existing bulkrna skill already covers the request.
02 资源文件 19
- 脚本_api.py1.9 KB
- 脚本bulkrna_cosinor_rhythm.py7.7 KB
- 参考文档completion_report.json6.7 KB
- 资产文件data/demo_input.csv329 B
- 脚本examples/example_step.py513 B
- 参考文档manifest.json12.8 KB
- 参考文档references/acquisition_abstraction.json8.6 KB
- 参考文档references/admission.md524 B
- 参考文档references/methodology.md659 B
- 参考文档references/output_contract.md925 B
- 参考文档references/parameter_lift.md90 B
- 参考文档references/parameters.md233 B
- 参考文档references/r_visualization.md524 B
- 参考文档references/shipping-workflow.md6.5 KB
- 参考文档references/source_completion_report.json15.7 KB
- 参考文档references/source_manifest.json44.1 KB
- 参考文档references/source_result_summary.md1.7 KB
- 参考文档scaffold_spec.json1.3 KB
- 脚本tests/test_api.py1020 B
03 SKILL.md 正文
bulkrna-cosinor-rhythm
Purpose
Use this Skill for a bulk RNA time-course CSV whose sample columns follow
T{hour}_R{replicate} and require a deterministic 24-hour, single-component
cosinor OLS fit per gene. Use another method when the period must be estimated,
the design has covariates, or multi-harmonic/non-sinusoidal rhythms are needed.
Inputs & Outputs
Outputs
report.mdresult.jsoncosinor_results.csvsemantic_summary.json
API
<!-- api:begin generated from _api.py; regenerate with run.py api <skill dir> --write -->
fit(timecourse)
Fit a fixed 24-hour sinusoid independently to each gene.
:param timecourse: Gene-indexed DataFrame with T00_R1-style sample columns. :returns: Parameter DataFrame with descriptive rhythmic flags and diagnostics. :raises ValueError: Empty data, missing time columns or infinite expression.
run_info(result, *, keep=True)
Read gene counts and time-column filtering decisions.
:param result: DataFrame returned by fit. :param keep: Default True; False removes diagnostic attrs. :returns: Diagnostic dictionary, empty after removal.
rhythm_figure(result)
Plot fitted amplitude against phase, without writing files.
:param result: Parameter DataFrame returned by fit. :returns: matplotlib Figure. :raises KeyError: Parameter columns are missing.
<!-- api:end -->
Flow
- Load
--input <csv>or the repository-bound demo dataset via--demo. - Parse time and replicate identities from the sample columns.
- Fit
mesor + beta_cos*cos(2*pi*t/24) + beta_sin*sin(2*pi*t/24)by OLS. - Derive amplitude, phase, fit statistics, and the per-gene rhythmicity verdict.
- Write
cosinor_results.csv,semantic_summary.json,report.md, and the standard result envelope.
Gotchas
cosinor_results.csvmarks rhythmic genes with descriptive thresholds (R-squared ≥ 0.8 and amplitude/mesor ≥ 0.2), not a significance test.semantic_summary.jsonlists columns dropped for more than 20% missing values. Duplicate gene identifiers keep their first row; fits with insufficient observations or a singular design return missing parameters.cosinor_results.csvuses a fixed 24-hour period;--methodis retained as a report label, not a backend selector.
Key CLI
# Demo
python skills/bulkrna/run-derived/bulkrna-cosinor-rhythm/bulkrna_cosinor_rhythm.py --demo --output /tmp/bulkrna-cosinor-rhythm_demo
# Real input
python skills/bulkrna/run-derived/bulkrna-cosinor-rhythm/bulkrna_cosinor_rhythm.py \
--input <data.ext> --output results/ \
--method fixed-period-cosinor-ols
See also
references/parameters.md— every CLI flag, per-method tunablesreferences/methodology.md— the WHY behind the algorithmreferences/output_contract.md—result.jsonenvelope + downstream paths
Dependencies
Python packages this skill's script needs. They are not installed for you — check before a long run.
numpy, pandas, matplotlib
04 同仓库更多 Skills
demo-skill
A fixture skill for the skill environment tests. Use it for nothing else.
fake-domains
Test fixture for the golden deployment in tests/entry. Load never; it has no script.
replace-me-skill
Load when copying this directory to bootstrap a new OmicsClaw skill. Skip when an existing skill already covers the request.
spatial-velocity
Load when estimating RNA velocity on a spatial AnnData with `layers["spliced"]` + `layers["unspliced"]` via scVelo (stochastic / deterministic / dynamical) or veloVI (deep generative). Skip when input lacks the spliced/unspliced layers (must be quantified upstream by velocyto / kb-python / STARsolo); non-spatial scRNA velocity (use sc-velocity).
spatial-trajectory
Load when inferring pseudotime / lineage trajectories on a preprocessed spatial AnnData via DPT (default — diffusion pseudotime), CellRank (terminal-state + fate-probability), or Palantir (waypoint branch probabilities). Skip when the data has spliced/unspliced layers and you want velocity-driven dynamics (use spatial-velocity); non-spatial scRNA pseudotime (use sc-pseudotime).
spatial-statistics
Load when running spatial autocorrelation / hotspot / co-occurrence / neighbourhood-enrichment / Ripley K stats on a clustered spatial AnnData via squidpy. Skip when ranking spatially variable genes (use spatial-genes); tissue domain detection (use spatial-domains).