circadian
Tools for the simulation and analysis of circadian rhythms
Science Score: 67.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 14 DOI reference(s) in README -
✓Academic publication links
Links to: zenodo.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.3%) to scientific vocabulary
Repository
Tools for the simulation and analysis of circadian rhythms
Basic Info
- Host: GitHub
- Owner: Arcascope
- License: mit
- Language: Jupyter Notebook
- Default Branch: main
- Homepage: https://arcascope.github.io/circadian/
- Size: 33.3 MB
Statistics
- Stars: 12
- Watchers: 2
- Forks: 8
- Open Issues: 6
- Releases: 4
Metadata Files
README.md
Circadian
Welcome to circadian, a computational package for the simulation and
analysis of circadian rhythms
Install
circadian can be installed via pip:
sh
pip install circadian
Overview
The circadian package implements key mathematical models in the field
such as:
Forger99- Forger et al. (1999)Hannay19andHannay19TP- Hannay et al. (2019)Jewett99- Kronauer et al. (1999)
See all the available models at circadian/models.py
Additionally, circadian provides a set of tools for simulating and
analzying circadian rhythms:
- Define light schedules using the
Lightclass and feed directly into the models - Calculate phase response curves using the
PRCFinderclass - Generate actograms and phase plots with the
circadian.plotsmodule
Finally, the package streamlines the process of reading, processing, and
analyzing wereable data via the circadian.readers module.
Check out the documentation for a full overview of the package and its features.
Example
The code below shows how to simulate the circadian rhythm of a shift worker for four different models and visualize the results in an actogram plot
``` python import numpy as np import matplotlib.pyplot as plt import matplotlib.lines as lines from circadian.plots import Actogram from circadian.lights import LightSchedule from circadian.models import Forger99, Jewett99, Hannay19, Hannay19TP
daysnight = 3 daysday = 2 slamshift = LightSchedule.ShiftWork(lux=300.0, dayson=daysnight, daysoff=days_day)
totaldays = 30 time = np.arange(0, 24*totaldays, 0.10) lightvalues = slamshift(time)
fmodel = Forger99() kjmodel = Jewett99() spmmodel = Hannay19() tpmmodel = Hannay19TP()
equilibrationreps = 2 initialconditionsforger = fmodel.equilibrate(time, lightvalues, equilibrationreps) initialconditionskj = kjmodel.equilibrate(time, lightvalues, equilibrationreps) initialconditionsspm = spmmodel.equilibrate(time, lightvalues, equilibrationreps) initialconditionstpm = tpmmodel.equilibrate(time, lightvalues, equilibration_reps) ```
The models are integrated using an explicit Runge-Kutta 4 (RK4) scheme
python
trajectory_f = f_model(time, initial_conditions_forger, light_values)
trajectory_kj = kj_model(time, initial_conditions_kj, light_values)
trajectory_spm = spm_model(time, initial_conditions_spm, light_values)
trajectory_tpm = tpm_model(time, initial_conditions_tpm, light_values)
The Dim Light Melatonin Onset (DLMO), an experimental measurement of circadian phase, is calculated for each model by
python
dlmo_f = f_model.dlmos()
dlmo_kj = kj_model.dlmos()
dlmo_spm = spm_model.dlmos()
dlmo_tpm = tpm_model.dlmos()
Lastly, the results of the simulation–DLMOs included– are visualized in
an Actogram plot from the circadian.plots module
``` python acto = Actogram(time, lightvals=lightvalues, opacity=1.0, smooth=False) acto.plotphasemarker(dlmof, color='blue') acto.plotphasemarker(dlmospm, color='darkgreen') acto.plotphasemarker(dlmotpm, color='red') acto.plotphasemarker(dlmokj, color='purple')
legend
blueline = lines.Line2D([], [], color='blue', label='Forger99') greenline = lines.Line2D([], [], color='darkgreen', label='Hannay19') redline = lines.Line2D([], [], color='red', label='Hannay19TP') purpleline = lines.Line2D([], [], color='purple', label='Jewett99')
plt.legend(handles=[blueline, purpleline, greenline, redline], loc='upper center', bboxtoanchor=(0.5, 1.12), ncol=4) plt.title("Actogram for a Simulated Shift Worker", pad=35) plt.tight_layout() plt.show() ```

Contributing
We welcome contributions to circadian via issues, pull requests, or comments! Please see our contributing guidelines for more information.
Citation
If you find circadian useful, please cite as:
bibtex
@software{franco_tavella_2023_8206871,
author = {Franco Tavella and
Kevin Hannay and
Olivia Walch},
title = {{Arcascope/circadian: Refactoring of readers and
metrics modules}},
month = aug,
year = 2023,
publisher = {Zenodo},
version = {v1.0.2},
doi = {10.5281/zenodo.8206871},
url = {https://doi.org/10.5281/zenodo.8206871}
}
Head to https://doi.org/10.5281/zenodo.8206871 for more information on the latest release.
Owner
- Name: Arcascope Inc
- Login: Arcascope
- Kind: organization
- Website: http://www.arcascope.com/
- Twitter: arcascope
- Repositories: 1
- Profile: https://github.com/Arcascope
GPS for your body's clock
Citation (CITATION.cff)
cff-version: 1.2.0 message: "If you use this software, please cite it as below." authors: - family-names: "Franco" given-names: "Tavella" - family-names: "Kevin" given-names: "Hannay" - family-names: "Olivia" given-names: "Walch" title: "circadian by Arcascope" version: 1.0.2 doi: 10.5281/zenodo.8206871 date-released: 2023-08-02 url: "https://github.com/Arcascope/circadian"
GitHub Events
Total
- Release event: 1
- Watch event: 5
- Push event: 7
- Pull request review comment event: 2
- Pull request event: 4
- Pull request review event: 4
- Fork event: 3
- Create event: 1
Last Year
- Release event: 1
- Watch event: 5
- Push event: 7
- Pull request review comment event: 2
- Pull request event: 4
- Pull request review event: 4
- Fork event: 3
- Create event: 1
Issues and Pull Requests
Last synced: 7 months ago
All Time
- Total issues: 10
- Total pull requests: 35
- Average time to close issues: 7 months
- Average time to close pull requests: about 1 month
- Total issue authors: 2
- Total pull request authors: 4
- Average comments per issue: 1.2
- Average comments per pull request: 0.17
- Merged pull requests: 31
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 1
- Average time to close issues: N/A
- Average time to close pull requests: about 1 month
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- ftavella (9)
- Zeming-LI-Andy (1)
Pull Request Authors
- ftavella (29)
- kintany (2)
- Chukwuemeka-Ike (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 28 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 6
- Total maintainers: 2
pypi.org: circadian
Tools for the simulation and analysis of circadian rhythms
- Homepage: https://github.com/Arcascope/circadian
- Documentation: https://circadian.readthedocs.io/
- License: Apache Software License 2.0
-
Latest release: 1.0.2
published over 2 years ago
Rankings
Dependencies
- fastai/workflows/quarto-ghp master composite
- fastai/workflows/nbdev-ci master composite
- actions/checkout v3 composite
- actions/setup-python v3 composite
- pypa/gh-action-pypi-publish 27b31702a0e7fc50959f5ad993c78deac1bdfc29 composite
- fastcore ==1.5.29 development
- ipython ==8.14.0 development
- jupyter ==1.0.0 development
- matplotlib ==3.7.2 development
- nbdev ==2.3.12 development
- numpy ==1.24.4 development
- pandas ==2.0.3 development
- scipy ==1.11.1 development
- setuptools ==65.5.0 development