"A python based toolkit to download and anlyse data from the Ethoscope hardware system."
Project description
ethoscopy
A data-analysis toolbox utilising Pandas, Seaborn, and Plotly to curate, clean, analyse, and visualise behavioural time series data. Whilst the toolbix was created around the data produced from an Ethoscope (a Drosophila monitoring system), if the users data follows the same structure for time series data all methods can be utilised.
Head to the tutorial for an in-depth walk through.
- currently the above tutorial is out of date. Use the jupyter notebooks to learn how to use the package
- I promise to update the tutorial soon so it is aligned with the 2.0 version
For more information on the Ethoscope system, click here - If using in conjenction with Ethoscope data this software contains functions for loading the Ethoscope data into ethocopy from .db files both locally and in remote ftp servers.
At its core ethoscopy is a subclass of the data manipulation tool Pandas. The dataframe object has been altered to contain a linked metadata dataframe which contains experimental information. This secondary dataframe can be used to filter the data containing dataframe, as well as a store of information per specimen during analysis.
Ethoscopy contains methods to perform common analytical techniques per specimen in the data table, such as removing dead specimens, interpolating missing values, or calculating sleep from movement. Addtionally, specialist anlysing tools have been implemented for analysing circadian rhythm, such as periodograms, and for generating hidden Markov models (HMM) to understand latent behavioural states. HMMs are trained utilising hmmlearn in the background and come accompanied with a range of visualisation tools to understand the generated model.
-- Update to 2.0 --
This new update sees a whole refactoring of the code base to make everything more streamline and keep the package up to date with the new versions of pandas and numpy. Gone are seperate classes for periodograms and HMM based analysis, all are under one class behavpy(). Addtioanlly, now the user can choose between plotter packages, Seaborn and Plotly, and choose a desired colour pallete. The previous used package Plotly can balloon the size of jupyter notebooks, putting a strain on storage, despite being great for data exploration. If you just want static plots, use Seaborn. But be wary of comparison, the backend for Plotly plots is all calculated in ethoscopy applying z-score and bootstrapping to quantification plots, whereas Seaborn based plots will use the Seaborn internal tools for errors and averaging.
The latest update is backwards compatible with all previously saved behavpy dataframes. However, post loading they should be re-initiated as the new behavpy class.
Addtionally, the concat method ( behavpy_object.concat() ) for combining dataframes has been shifted to a function that is imported automatically. Call etho.concat(df1, df2) or etho.concat(*[df1, df2]) instead. There are other minor changes to method and argument names, which are reflected in their docstrings and in the tutorial.
Getting Started
Ethoscopy can be installed via pip from PyPi
We recommned installing ethoscopy into a virtual environment due to specific package versions.
python pip install ethoscopy
Example of use
Ethoscopy is primarily made to work in a Jupyter notebook environment and should be imported in as so:
import ethoscopy as etho
Generate a behavpy dataframe object as so:
data = pandas_dataframe
metadata = pandas_dataframe
df = etho.behavpy(data, metadata, check = True, canvas = 'plotly', palette = 'Set2')
# select only the data from specimens in experimental group 2
filtered_df = df.xmv('experimental_column', 'group_2')
License
This project is licensed under the GNU-3 license
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ethoscopy-2.0.tar.gz
.
File metadata
- Download URL: ethoscopy-2.0.tar.gz
- Upload date:
- Size: 13.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.13.1 Linux/6.1.127-2-MANJARO
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60bd91d9afb5cae62f54d0961dbc694ce025bbbfeb7069dec6afc64ccc32bf86 |
|
MD5 | a5b2c6e411d5856442a544bafcba12be |
|
BLAKE2b-256 | a9da70921ba00df26be36afc08e9db7837bdf323611cc8e97a44bac9c4e595c2 |
File details
Details for the file ethoscopy-2.0-py3-none-any.whl
.
File metadata
- Download URL: ethoscopy-2.0-py3-none-any.whl
- Upload date:
- Size: 13.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.1 CPython/3.13.1 Linux/6.1.127-2-MANJARO
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35b8b65a3475c33d972556490020085e1c4827250aaeb1ab08fcd2f85c8a84a5 |
|
MD5 | 9778507c28e351cb96d80a4e6c1da491 |
|
BLAKE2b-256 | 5c5d39b891e8acbd946e74456621387ffabb3bb3da30a1414d6b1a40d3e373c9 |