Contains a set of modules to analyze and visualize data from block1 and block2 of the experiment from 2021 September.
This repository is based on python and therefore requires conda and python-pip for installations. The following repositories are project-dependencies that have to been build inside the underlying environment:
- Environment installations using Conda, including the python environment and c++ dependencies
conda env create -n toolbox --file environment.yml conda activate toolbox
- Python package installations using python-pip
# conda environment should be activated python -m venv .venv # python virtual environment creation source .venv/bin/activate pip install -r requirements.txt
- Fishproviz project-dependencies installation
# working directory should be equal to <path/to/fishtoolbox> # conda environment should be activated # python venv should be activated cd .. git clone git@github.com:lukastaerk/Fish-Tracking-Visualization.git cd Fish-Tracking-Visualization python setup.py install
- Motionmapper project-dependencies installation
# working directory should be equal to <path/to/fishtoolbox> # conda environment should be activated # python venv should be activated cd .. git clone git@github.com:lukastaerk/motionmapperpy.git cd motionmapperpy python setup.py install
- Start on the GPU
sbatch scripts/hpc-python.sh - NOTEBOOK
conda activate rapids-22.04- Type
ifconfigand get theinetentry foreth0, i.e. the IP address of the node srun --pty --partition=ex_scioi_gpu --gres=gpu:1 --time=0-02:00 bash -ito start a new shell with a GPUssh -L localhost:5000:localhost:5000 user.name@[IP address]on your local machinejupyter-lab --no-browser --port=5000
- set the BLOCK variable to BLOCK1 or BLOCK2 in
config.py - set the projectPath variable to the path of a new folder in
config.pythis is where the data will be stored - setup fishprovis with the correct paths and area configurations.
- export the preprocessed data with
python3 -m data_factory.processing - repeat for the other block
parameters = set_parameters()to get the parameters that are used throughout the fishtoolbox
load_trajectory_data_concatload the x y coordinates, projections (the three features), time index, areaload_zVals_concatload the umap dataload_clusters_concatload cluster labels for individuals and day paramerter.kmeans = 5 to specify the clustering that you want to load.
There are three ways in this module to compute plasticity.
compute_cluster_entropycomputes the cluster entropy for each individual and day. Using the watershed regions or kmeans clusters, by providing the function to load the corresponding clusters.compute_coefficient_of_variationcomputes the coefficient of variation for each individual and day.
Records function to export averaged step length to a csv file and melted them into a long format table for statistical analysis (Repeatability).
From means of features (step, angle, wall distance), e.g. batches of 60 data frames. Produce a long table, recording block number, id.
The research question is how many samples are needed to get a good estimate of the repeatability. Provided a table with means of a feature (step length) over a number of consecutive data frames, we can sample from this table a number of minutes for a number of days. Further we look at the effect when sampling the time of the day only once for all days versus sampling the time of the day for each day.
- ethnogram_of_clusters
- check the new area files, see if there are significant updates for any of them, what is the difference, do we need an refined get_area_function(fishkey,day) ?