https://github.com/kelvins/chronobiology
:clock10: Go package that provides chronobiology functions
https://github.com/kelvins/chronobiology
biological-data-analysis biological-rhythms chronobiology go golang
Last synced: 8 months ago
JSON representation
:clock10: Go package that provides chronobiology functions
- Host: GitHub
- URL: https://github.com/kelvins/chronobiology
- Owner: kelvins
- License: mit
- Created: 2016-09-08T00:13:39.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-07T03:54:33.000Z (over 8 years ago)
- Last Synced: 2025-01-04T06:17:36.440Z (10 months ago)
- Topics: biological-data-analysis, biological-rhythms, chronobiology, go, golang
- Language: Go
- Homepage:
- Size: 104 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Chronobiology GoLang Package
==========================[](LICENSE)
[](https://travis-ci.org/kelvins/chronobiology)
[](https://coveralls.io/github/kelvins/chronobiology?branch=master)
[](https://goreportcard.com/report/github.com/kelvins/chronobiology)
[](https://godoc.org/github.com/kelvins/chronobiology)This is an open source package developed to provide **chronobiology** functions in **GoLang**.
You can use go get command:
go get github.com/kelvins/chronobiology
----------
GoLang
---------------------------------
**Go**, also known as **GoLang**, is an open source programming language that makes it easy to build simple, reliable, and efficient software.The Go programming language was developed by **Google** and released in 2009. To know more about the **GoLang** please visit the official [web site][1].

----------
Chronobiology
---------------------------------Basically, **chronobiology** is a field of biology that studies the periodic phenomena in living organisms and their adaptation to solar and lunar rhythms. These cycles are known as **biological rhythms**.
Chronobiological studies include but are not limited to comparative anatomy, physiology, genetics, molecular biology and behavior of organisms within biological rhythms mechanics.
----------
The project
---------------------------------
The **objective** of this project is to provide an easy way to access some **chronobiology** functions that can perform **data analysis** in **time series** using **GoLang**.Some analyzes and features that we pretend to provide with the package:
- [X] Convert the data based on the epoch
- [X] Filter data by date/time
- [X] Calculate Average Day
- [X] Fill gaps in data
- [X] The followed hours of highest activity (e.g. M10)
- [X] The followed hours of lowest activity (e.g. L5)
- [X] Relative Amplitude (RA)
- [X] Intradaily Variability (IV)
- [X] Interdaily Stability (IS)Functions provided in the version 1.5:
``` go
// Convert the data and dateTime slices to the new epoch passed by parameter
func ConvertDataBasedOnEpoch(dateTime []time.Time, data []float64, newEpoch int) (newDateTime []time.Time, newData []float64, err error){}// Function that finds the epoch of a time series (seconds)
func FindEpoch(dateTime []time.Time) (epoch int){}// Function that finds the highest activity average of the followed X hours (defined by parameter)
func HigherActivity(hours int, dateTime []time.Time, data []float64) (higherActivity float64, onsetHigherActivity time.Time, err error){}// Function that finds the lowest activity average of the followed X hours (defined by parameter)
func LowerActivity(hours int, dateTime []time.Time, data []float64) (lowerActivity float64, onsetLowerActivity time.Time, err error){}// Function that finds the highest activity average of the followed 10 hours
func M10(dateTime []time.Time, data []float64) (higherActivity float64, onsetHigherActivity time.Time, err error){}// Function that finds the lowest activity average of the following 5 hours
func L5(dateTime []time.Time, data []float64) (lowerActivity float64, onsetLowerActivity time.Time, err error){}// Function that calculates the relative amplitude based on the formula (M10-L5)/(M10+L5)
func RelativeAmplitude(highestAverage float64, lowestAverage float64) (RA float64, err error){}// Function that calculates the intradaily variability
func IntradailyVariability(dateTime []time.Time, data []float64) (iv []float64, err error){}// Function that calculates the interdaily stability
func InterdailyStability(dateTime []time.Time, data []float64) (is []float64, err error){}// Function created to filter the data based on the startTime and endTime passed as parameter
func FilterDataByDateTime(dateTime []time.Time, data []float64, startTime time.Time, endTime time.Time) (newDateTime []time.Time, newData []float64, err error){}// Function that searches for gaps in the time series and fills it with a specific value passed as parameter (usually zero)
func FillGapsInData(dateTime []time.Time, data []float64, value float64) (newDateTime []time.Time, newData []float64, err error){}// Creates an average day based on the time series
func AverageDay(dateTime []time.Time, data []float64) (newDateTime []time.Time, newData []float64, err error) {}
```**Note**: The functions were developed to work with default epoch of 60 seconds (or a divisible or multiple of 60, e.g.: 15, 30, 120). The results can be inaccurate if you use another epoch, for example 17 or 33 seconds.
**References**: Witting W, Kwa IH, Eikelenboom P, Mirmiran M, Swaab DF. Alterations in the circadian rest-activity rhythm in aging and Alzheimer's disease. Biol Psychiatry 1990;27:563-72. ([https://www.ncbi.nlm.nih.gov/pubmed/2322616][2])
----------
This project was created under the **MIT license**. Feel free to contribute by commenting, suggesting, creating issues or sending pull requests. Any help is welcome.
If you want more information about this project please contact-me: kelvinpfw@hotmail.com
[1]: https://golang.org
[2]: https://www.ncbi.nlm.nih.gov/pubmed/2322616