Skip to contents

The standard way to measure sleep in Drosophila, calling any five-minute stretch of immobility “sleep”, flattens what is almost certainly a richer biological signal. FlyDreamR fits a hidden Markov model to your DAM activity data to recover that signal, classifying each minute of recording into distinct sleep and wake states rather than applying a single arbitrary threshold.

This vignette is a quick roadmap. If you want to get straight to analysis, pick the vignette that matches your goal.

The default HMM has four states. You can fit three or five states with n_states, remove suspected dead flies during data preparation, and review fit failures in QualityReport.

Installation (typical options)

From GitHub (recommended)

# Install from GitHub (devtools or remotes)
install.packages(c('devtools','remotes'), repos='https://cloud.r-project.org')
remotes::install_github('orijitghosh/FlyDreamR', upgrade = 'never')

Then load the package:

Getting help

  • Check documentation: ?HMMbehavr
  • View examples: example(HMMplot)

Citation

If you use FlyDreamR in your research, please cite:

Ghosh A, Harbison ST. Inferring the genetic basis of sleep states in Drosophila melanogaster using hidden Markov models. bioRxiv. 2026: 2026.2001.2014.699526.