Skip to content

Commit

Permalink
reorganizing configs
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuahwu committed Jul 5, 2023
1 parent 5e19e4c commit 9a25d96
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 76 deletions.
8 changes: 2 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/

./CAPTURE_analysis/
./CAPTURE_data/

*.mat
*.sh
*.out
Expand All @@ -34,14 +31,13 @@ $RECYCLE.BIN/
!/tutorials/
/tutorials/*
!/tutorials/tutorial.ipynb
/configs/*
!/configs/tutorial.yaml

/dappy/wandb/
/dappy/models/
/dappy/artifcats/

!configs/param_configs/fitsne.yaml
!configs/path_configs/example_path.yaml

*.egg-info

# Windows shortcuts
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ conda env create -f environment.yml
conda activate dappy
pip install -e .
```
Note that `pip` and `setuptools` must be updated to the most recent versions.

To begin gaining familiarity with the functionality of this package, run through the code in `tutorial/tutorial.ipynb`.

Expand Down
26 changes: 0 additions & 26 deletions configs/path_configs/example_path.yaml

This file was deleted.

37 changes: 37 additions & 0 deletions configs/tutorial.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Folder path of data location
data_path: '/home/exx/Desktop/GitHub/CAPTURE_data/ensemble_healthy/'

# File path of predictions file
pose_path: '/home/exx/Desktop/GitHub/CAPTURE_data/ensemble_healthy/predictions.mat'

# File path of metadata file
meta_path: '/home/exx/Desktop/GitHub/CAPTURE_data/ensemble_healthy/metadata.csv'

# Output folder of all plots
out_path: '/home/exx/Desktop/GitHub/results/ensemble_healthy/'

# Path of list of behavior heuristics
heuristics_path: '/home/exx/Desktop/GitHub/dappy/src/dappy/behavior_heuristics.py'

# File path of skeletal specifications
skeleton_path: '/home/exx/Desktop/GitHub/dappy/src/dappy/skeletons.py'

# Key of skeleton in the skeletons file
skeleton_name: 'mouse20_notail'

label: 'fitsne'

analysis: 'embed'

downsample: 10

single_embed:
method: 'fitsne'
perplexity: 50
lr: 'auto'
sigma: 15

transform_embed:
method: 'knn'
k: 5
sigma: 15
56 changes: 12 additions & 44 deletions tutorials/tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,23 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Neurodegenerative diseases (like Parkinson's) are characterized by a wide variety of behavioral defects or movement deficits. However, behavior and movement have historically been difficult to quantify and measure."
"Neurodegenerative diseases (like Parkinson's) are characterized by a wide variety of behavioral defects or movement deficits. However, behavior and movement have historically been difficult to quantify and measure. Recent developments in hardware and machine learning have enabled more objective behavioral metrics by providing continuous 3D measurements of naturalistic animal behavior through multi-view videos. These new modalities of data offer a means by which we can comprehensively characterize behavioral phenotypes of neural (dys)-function. We present `dappy` to establish an open-source API with easy access to machine learning methods for the analysis of 3D pose sequences."
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"This notebook implements a Python version of CAPTURE (Marshall, 2020), which was based on earlier work MotionMapper (Berman, 2014) for the analysis of behavioral data, which can interface with future frameworks."
"This notebook implements a Python version of [CAPTURE (Marshall, 2020)](https://www.cell.com/neuron/fulltext/S0896-6273(20)30894-1?_returnURL=https%3A%2F%2Flinkinghub.elsevier.com%2Fretrieve%2Fpii%2FS0896627320308941%3Fshowall%3Dtrue), which was based on earlier work [MotionMapper (Berman, 2014)](https://royalsocietypublishing.org/doi/full/10.1098/rsif.2014.0672) for the analysis of behavioral data, which can interface with future frameworks."
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"First, we import the necessary modules."
]
},
{
Expand All @@ -35,7 +43,6 @@
"metadata": {},
"outputs": [],
"source": [
"import this\n",
"from dappy import features, read, write\n",
"import dappy.DataStruct as ds\n",
"import dappy.visualization as vis\n",
Expand All @@ -61,7 +68,7 @@
"outputs": [],
"source": [
"analysis_key = \"tutorial\"\n",
"config = read.config(\"../../dappy/configs/\" + analysis_key + \".yaml\")\n",
"config = read.config(\"../../configs/\" + analysis_key + \".yaml\")\n",
"\n",
"pose, ids = read.pose_h5(config[\"data_path\"] + \"pose_aligned.h5\")\n",
"\n",
Expand All @@ -72,45 +79,6 @@
"meta, meta_by_frame = read.meta(config[\"meta_path\"], id=ids)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([[1. , 0.5217, 0. , 0.5 ],\n",
" [1. , 0.5217, 0. , 0.5 ],\n",
" [1. , 0.5217, 0. , 0.5 ],\n",
" [1. , 0.5217, 0. , 0.5 ],\n",
" [1. , 0.5217, 0. , 0.5 ],\n",
" [1. , 0.5217, 0. , 0.5 ],\n",
" [0.4348, 1. , 0. , 0.5 ],\n",
" [0.1739, 1. , 0. , 0.5 ],\n",
" [0. , 1. , 0.6087, 0.5 ],\n",
" [0. , 1. , 0.8696, 0.5 ],\n",
" [0. , 1. , 1. , 0.5 ],\n",
" [0. , 0.2609, 1. , 0.5 ],\n",
" [0. , 0.3478, 1. , 0.5 ],\n",
" [0. , 0.5217, 1. , 0.5 ],\n",
" [0.4348, 0. , 1. , 0.5 ],\n",
" [0.4348, 0. , 1. , 0.5 ],\n",
" [0.1739, 0. , 1. , 0.5 ],\n",
" [0.9565, 0. , 1. , 0.5 ],\n",
" [1. , 0. , 0.7826, 0.5 ],\n",
" [1. , 0. , 0.5217, 0.5 ]], dtype=float32)"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"connectivity.colors"
]
},
{
"attachments": {},
"cell_type": "markdown",
Expand Down Expand Up @@ -488,7 +456,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.8.13"
},
"orig_nbformat": 4,
"vscode": {
Expand Down

0 comments on commit 9a25d96

Please sign in to comment.