Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = .git*,*.css,.codespellrc
check-hidden = true
ignore-regex = ^\s*"image/\S+": ".*
ignore-words-list = idel,dum,sav,alph
25 changes: 25 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Codespell configuration is within .codespellrc
---
name: Codespell

on:
push:
branches: [master]
pull_request:
branches: [master]

permissions:
contents: read

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Annotate locations with typos
uses: codespell-project/codespell-problem-matcher@v1
- name: Codespell
uses: codespell-project/actions-codespell@v2
2 changes: 1 addition & 1 deletion analyses/RunLength_2017_04_08/InstallMex.m
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
Flags = cat(2, Flags, {'-compatibleArrayDims'});
end

% Define endianess directive:
% Define endianness directive:
if isLittleEndian
Flags = cat(2, Flags, {'-D_LITTLE_ENDIAN'});
else % Does Matlab run on a big endian machine currently?!
Expand Down
2 changes: 1 addition & 1 deletion analyses/RunLength_2017_04_08/RunLength.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])

// Create 3rd output as post-processing: ----------------------------------
// Collecting the indices on the fly might be faster, but doing this
// afterwards allowes to allocate the correct number of elements directly:
// afterwards allows to allocate the correct number of elements directly:
if (nlhs == 3) {
if (isColumn) {
plhs[2] = mxCreateDoubleMatrix(nb, 1, mxREAL);
Expand Down
4 changes: 2 additions & 2 deletions analyses/RunLength_2017_04_08/RunLength_M.m
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@

if vectorized % Vectorized: --------------------------------
len = length(n); % Number of bins
d = cumsum(n); % Cummulated run lengths
d = cumsum(n); % Cumulated run lengths
index = zeros(1, d(len)); % Pre-allocate
index(d(1:len-1)+1) = 1; % Get the indices where the value changes
index(1) = 1; % First element is treated as "changed" also
index = cumsum(index); % Cummulated indices
index = cumsum(index); % Cumulated indices
x = b(index);

else % Loop: --------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion analyses/RunLength_2017_04_08/uTest_RunLength.m
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function uTest_RunLength(doSpeed)
end
end

% Test coding with limitting counter to 255:
% Test coding with limiting counter to 255:
for k = [1,2,3, 250:260, 500:520, 750:800] % Around multiples of 255
x0 = myCast(ones(1, k), aType);
[b, n] = RunLength(x0, 'byte');
Expand Down
2 changes: 1 addition & 1 deletion analyses/getkin.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
% BOUT_LENRH,BOUT_SPEEDRH,BOUT_LENLH,BOUT_SPEEDLH] = GETKIN(MSRAWDATA,LABELS,GROUP_NUM,FPS)
%
% INPUTS:
% MSRAWDATA Matrix of the positons of the 6-body parts outlining the rodent over time videotaped from the bottom looking up.
% MSRAWDATA Matrix of the positions of the 6-body parts outlining the rodent over time videotaped from the bottom looking up.
% Rows represents time.
% Columns 1 & 2 tracks snout; columns 3 to 6 tracks the two front paws; Columns 7 to 10 tracks the two hind paws;
% Columns 11 & 12 tracks the base of the tail. Tested on tracking data generated by DeepLabCut 2.0.
Expand Down
2 changes: 1 addition & 1 deletion bsoid/action_gif2.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
%
% [T,B,B_EX] = ACTION_GIF2(PNGPATH,GRP,N,N_LEN,FILEPATHOUTRESULTS) outputs classified behaviors based on DeepLabCut analysis
% PNGPATH The path to frame-by-frame video from FFmpeg.
% GRP Statistically different gropus based on unsupervised GMM model fitting of action space data. This is the output from BSOID.
% GRP Statistically different groups based on unsupervised GMM model fitting of action space data. This is the output from BSOID.
% N Number of sampled video you desire. Default 3.
% N_LEN Lower bound for consecutive frames (10fps, 50ms each) for which the video will be generated from. Default 6 (300ms).
% X X times speed. Default 0.5.
Expand Down
2 changes: 1 addition & 1 deletion bsoid/bsoid_assign.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
% Otherwise, set it to 0 for individual segmentation/.csv file. Default is 1.
% SMTH_HSTRY BOXCAR smoothing using number of frames from before. Default ~40ms before.
% SMTH_FUTR BOXCAR smoothing using number of frames from after. Default ~40ms after.
% KCLASS Maximum number of assigment classes that the Gaussian Mixture Model will try to parse out. Default 50.
% KCLASS Maximum number of assignment classes that the Gaussian Mixture Model will try to parse out. Default 50.
%
% OUTPUTS:
% F_10FPS Compiled features that were used to cluster, 10fps temporal resolution.
Expand Down
2 changes: 1 addition & 1 deletion bsoid/bsoid_fsml.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
% [LABELS_FSALL,F_10FPS_FS] = BSOID_FSML(DATA,BEHV_MDL,FPS,SMTH_HSTRY,SMTH_FUTR) outputs classified behaviors matching your camera's frame-rate
%
% INPUTS:
% DATA_TEST Matrix of the positons of the 6-body parts outlining the rodent over time videotaped from the bottom looking up.
% DATA_TEST Matrix of the positions of the 6-body parts outlining the rodent over time videotaped from the bottom looking up.
% Rows represents time.
% Columns 1 & 2 tracks snout; columns 3 to 6 tracks the two front paws; Columns 7 to 10 tracks the two hind paws;
% Columns 11 & 12 tracks the base of the tail. Tested on tracking data generated by DeepLabCut 2.0.
Expand Down
2 changes: 1 addition & 1 deletion bsoid/bsoid_mdl2.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
% CV_IT Number of times to run cross-validation on. Default is 30.
%
% OUTPUTS:
% BEHV_MDL Trained Multi-Class Support Vector Machine (SVM) classifier, based on Guassian kernels.
% BEHV_MDL Trained Multi-Class Support Vector Machine (SVM) classifier, based on Gaussian kernels.
% CV_AMEAN Cross-validated accuracy mean.
% CV_ASEM Cross-validated accuracy standard error of the mean.
% ACC_FIG Accuracy box plot figure showing all the cross validated data points.
Expand Down
2 changes: 1 addition & 1 deletion bsoid/bsoid_svm.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
% [LABELS,F_10FPS_TEST] = BSOID_SVM(DATA_TEST,FPS,MDL) outputs classified behaviors using the output from bsoid_mdl.
%
% INPUTS:
% DATA_TEST Matrix of the positons of the 6-body parts outlining the rodent over time videotaped from the bottom looking up.
% DATA_TEST Matrix of the positions of the 6-body parts outlining the rodent over time videotaped from the bottom looking up.
% Rows represents time.
% Columns 1 & 2 tracks snout; columns 3 to 6 tracks the two front paws; Columns 7 to 10 tracks the two hind paws;
% Columns 11 & 12 tracks the base of the tail. Tested on tracking data generated by DeepLabCut 2.0.
Expand Down
2 changes: 1 addition & 1 deletion bsoid_app/bsoid_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def streamlit_run(pyfile):
layout='wide', initial_sidebar_state='auto')
local_css("./bsoid_app/bsoid_utilities/style.css")
title = "<div> <span class='bold'><span class='h1'>B-SOID</span></span> " \
" <span class='h2'>anaylsis 📊</span></span> </div>"
" <span class='h2'>analysis 📊</span></span> </div>"
st.markdown(title, unsafe_allow_html=True)
st.markdown('Step 1: Pick the directory and workspace to analyze.')
st.markdown('Step 2: Once input, select the type of results to analyze using the sidebar modules.')
Expand Down
2 changes: 1 addition & 1 deletion bsoid_figs/figS4.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import subprocess


print('\n \n \n FRAMSHIFT NEURAL DIFFERNCES \n \n \n')
print('\n \n \n FRAMSHIFT NEURAL DIFFERENCES \n \n \n')
path = '/Volumes/Elements/Manuscripts/B-SOiD/bsoid_natcomm/workspace/neuralbehavior_durs.mat'
fig_format = 'png'
outpath = '/Volumes/Elements/Manuscripts/B-SOiD/bsoid_natcomm/figure_panels/neural_data/'
Expand Down
2 changes: 1 addition & 1 deletion bsoid_figs/subroutines/utilities/detect_peaks.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def detect_peaks(x, mph=None, mpd=1, threshold=0, edge='rising',
Returns
-------
ind : 1D array_like
indeces of the peaks in `x`.
indices of the peaks in `x`.

Notes
-----
Expand Down
2 changes: 1 addition & 1 deletion bsoid_py/config/GLOBAL_CONFIG.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
################### THINGS YOU PROBABLY DONT'T WANT TO CHANGE ###################
################### THINGS YOU PROBABLY DON'T WANT TO CHANGE ###################

import logging
import sys
Expand Down
2 changes: 1 addition & 1 deletion bsoid_py/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def bsoid_tsne(data: list, bodyparts=BODYPARTS, fps=FPS, comp=COMP):
:param fps: scalar, argument specifying camera frame-rate in LOCAL_CONFIG
:param comp: boolean (0 or 1), argument to compile data or not in LOCAL_CONFIG
:return f_10fps: 2D array, features
:retrun f_10fps_sc: 2D array, standardized features
:return f_10fps_sc: 2D array, standardized features
:return trained_tsne: 2D array, trained t-SNE space
"""
win_len = np.int(np.round(0.05 / (1 / fps)) * 2 - 1)
Expand Down
2 changes: 1 addition & 1 deletion bsoid_py/utils/likelihoodprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def main(folders: list):
:param folders: list, data folders
:return filenames: list, data filenames
:return data: list, filtered data list
:retrun perc_rect: 1D array, percent filtered per BODYPART
:return perc_rect: 1D array, percent filtered per BODYPART
"""
filenames, data, perc_rect = import_folders(folders)
return filenames, data, perc_rect
Expand Down
2 changes: 1 addition & 1 deletion bsoid_umap/config/GLOBAL_CONFIG.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
################### THINGS YOU PROBABLY DONT'T WANT TO CHANGE ###################
################### THINGS YOU PROBABLY DON'T WANT TO CHANGE ###################

import logging
import sys
Expand Down
2 changes: 1 addition & 1 deletion bsoid_umap/utils/likelihoodprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def main(folders: list):
:param folders: list, data folders
:return filenames: list, data filenames
:return data: list, filtered data list
:retrun perc_rect: 1D array, percent filtered per BODYPART
:return perc_rect: 1D array, percent filtered per BODYPART
"""
filenames, data, perc_rect = import_folders(folders)
return filenames, data, perc_rect
Expand Down
2 changes: 1 addition & 1 deletion docs/bsoid_mdl.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function [OF_mdl,CV_amean,CV_asem,acc_fig] = bsoid_mdl(f_10fps,grp,hldout,cv_it,

- `CV_AMEAN` Cross-validated accuracy mean.

- `CV_ASEM` Cross-validated accuracy standard error fo the mean.
- `CV_ASEM` Cross-validated accuracy standard error of the mean.

- `ACC_FIG` Box plot showing classifier performance with individual data points representing a randomly subsampled test set from the hold out portion.

Expand Down
4 changes: 2 additions & 2 deletions googlecolab/bsoid_v1_2_1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@
" :param folders: list, data folders\n",
" :return filenames: list, data filenames\n",
" :return data: list, filtered data list\n",
" :retrun perc_rect: 1D array, percent filtered per BODYPART\n",
" :return perc_rect: 1D array, percent filtered per BODYPART\n",
" \"\"\"\n",
" filenames, data, perc_rect = import_folders(folders)\n",
" return filenames, data, perc_rect\n",
Expand Down Expand Up @@ -774,7 +774,7 @@
" :param fps: scalar, argument specifying camera frame-rate in LOCAL_CONFIG\n",
" :param comp: boolean (0 or 1), argument to compile data or not in LOCAL_CONFIG\n",
" :return f_10fps: 2D array, features\n",
" :retrun f_10fps_sc: 2D array, standardized features\n",
" :return f_10fps_sc: 2D array, standardized features\n",
" :return trained_tsne: 2D array, trained t-SNE space\n",
" \"\"\"\n",
" win_len = np.int(np.round(0.05 / (1 / fps)) * 2 - 1)\n",
Expand Down