Download the latest version from here
This repo was created to share the code used to create the entropy analysis workflow. Features include:
- Bash script to install python library requirements for each script
- Bash script to start the main script webgui
- Webgui using the streamlit library
- Extraction of settings used per participant and session
- Interactive clipping of datasets of dramatic jumps in cadence
- Calculation of effort
- Conversion of dynamic files to be used with the MatLab entropy scripts
- Exploration of entropy results
Screenshot of the first page with general instructions for each step.
Basic overview of each step, for both Windows and MacOS:
Step 1
: Click save at the bottom of the pageStep 2a
andStep 2b
: Clip files as needed, then click save at the bottom of the pageStep 3
: Follow instructions to edit and run MatLab scriptStep 4
: Basic data exploration, optional
- Run
install_windows.bat
and follow instructions to install miniconda and visual studio code, then the pip libraries- Copy paste the first link (miniconda), and download Python 3.8
- Copy paste the second link (VScode), downloaded the latest version
- Close the black window (terminal)
- Double click on
install_windows.bat
again- Type
2
, enter - Wait for installation to finish, message will say "Click startme.bat"
- Type
- Make sure the MatLab files are in the proper place:
entropy_script.m
in thedynamic_bike
folder- The following MatLab files in the
dynamic_bike/src/matlab
folder:ApSamEn.m
Convert_Data.m
MatchCounter.c
- Download and install miniconda, Python 3.8 version:
- Macbook Pro/Macbook: click here to download
- Macbook M1: click here to download
- For both versions: once installation is finished, open the terminal and type in
conda init
. If successful, close the terminal. If an error is written, contact Peter
- Download the latest version of the dynamic bike script, extract the folder to the Desktop
- Make sure the MatLab files are in the proper place:
entropy_script.m
in thedynamic_bike
folder- The following MatLab files in the
dynamic_bike/src/matlab
folder:ApSamEn.m
Convert_Data.m
MatchCounter.c
- Open the Terminal, then copy paste the following and press enter:
cd ~/Desktop/dynamic_biking/src
yes | pip install -r requirements.txt
streamlit run new_bike.py
- Launch the script script by double clicking on
start_me_windows.bat
- On first launch it will ask for email, you can press enter without typing anything. Won't be asked again afterwards
- It should open a browser window by itself, if it doesn't then copy and paste one of the two links shown. All dynamic bike files should be placed in
input
folder
To start the script, open the terminal and copy-paste the following:
cd ~/Desktop/dynamic_biking/src
streamlit run new_bike.py
- On first launch it will ask for email, you can press enter without typing anything. Won't be asked again afterwards
- It should open a browser window by itself, if it doesn't then copy and paste one of the two links shown. All dynamic bike files should be placed in
input
folder
The scripts used in MatLab for ApEn, SamEn, SpecEn analysis require the MinGW compiler (all entropy analysis) and the Signal Processing Toolbox (SpecEn analysis only). This requires logging into MatLab using an account.
- Open MatLab
- Click
APPS
tab - Click
Get More Apps
- In the search box click
Clear Filters
and then search for MinGW - Click
MATLAB Support for MinGW-w64 C/C++ Compiler
in the results - Click
Install
- Open MatLab
- Click
APPS
tab - Click
Get More Apps
- In the search box click
Clear Filters
and then search for Signal Processing Toolbox - Click
Signal Processing Toolbox
in the results - Click
Install
(orTrial
)
If SpecEn analysis is not needed, the Signal Processing Toolbox does not need to be installed. In that case the MatLab script needs to be modified:
Prevent the script from creating SpecEn columns:
Line 27
: deletespec_HR
but leave the,...
at the endLine 28
: deletespec_Cadence
but leave the,...
at the endLine 29
: deletespec_Power
but leave the};
at the end
Prevent the script from calculating SpecEn:
Lines 67 - 71
: add%
at the beginning
Prevent the script from looking for SpecEn columns:
Line 73
: replacecell(1,18);
withcell(1,15);
- Delete entire
Lines 81, 86, 91
that end withspec(number);
- Renumber
Lines 74 - end
so thatres_day1{1,num}
are sequential each line
Run the script and it should work without the need for Signal Processing Toolbox, with the tradeoff that SpecEn will not be calculated
This repo does not contain the MatLab scripts required for ApEn, SamEn, and SpecEn analysis of dynamic bike cadence. The scripts contained in this repo are self contained, but all MatLab scripts must be moved to the dynamic_biking/src/matlab
folder, with the exception of entropy_script.m
that should be moved to the dynamic_biking
folder, before entropy analysis can proceed.
The dynamic bike scripts expect the following organization:
dynamic_biking # place entropy_script.m in here
|-- .gitignore # list of file extensions that will not be uploaded to github
|-- README.md # this readme file
|-- [0] install.bat # run first, guides user through conda and pip installation
|-- [1] start_me.bat # runs the main script
|-- entropy_script.m # loops through bike files and uses matlab scripts to calculate entropies
|-- src
|-- homepage.txt # edit to update instructions on the homepage
|-- matlab_troubleshooting.txt # edit to add solutions to problems encountered in matlab
|-- new_bike.py # main script that runs each script as needed
|-- requirements.txt # contains libraries required by all scripts
|-- helpers
|-- entropy_eda.py # script for step 4
|-- entropy_format.py # script for step 2
|-- helper_functions.py # contains various functions used by all steps
|-- session_info.py # script for step 1
|-- images # contains screenshots used in step 3
|-- matlab_code.png
|-- matlab_error.png
|-- matlab_menu.png
|-- matlab # place all other matlab scripts in here
|-- ApSamEn.m # code for entropy calculation
|-- Convert_Data.m # not sure what this does
|-- MatchCounter.c # will create MatchCounter.mexw64 on each run