-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_analyses.sh
executable file
·96 lines (65 loc) · 2.8 KB
/
run_analyses.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/bash
# This script runs all the analyses for the ontology use case, generating
# annotated provenance records with Alpaca.
#
# When experimental data is used, the reduced Reach2Grasp datasets in NIX
# must be present. The `i140703-001_no_raw.nix` file must be downloaded
# according to the `README.md` file. The path to the dataset is defined in the
# variable $DATA_I below. The script can be run directly if the dataset is
# copied to the `data` folder with respect to the repository root or the
# symbolic link was created. If using the dataset by providing the path to the
# local GIN repository folder, please change $DATA_I accordingly.
#
# Outputs will be stored into the `analyses` subfolder in the `outputs` folder
# with respect to the root of the repository. To change, please modify the
# $OUTPUT_FOLDER variable below.
DATA_I=./data/i140703-001_no_raw.nix
OUTPUT_FOLDER=./outputs/analyses
# Specific output subfolders
PSD_OUTPUT=$OUTPUT_FOLDER/reach2grasp
SURROGATE_ISIH_OUTPUT=$OUTPUT_FOLDER/reach2grasp
ARTIFICIAL_ISIH_OUTPUT=$OUTPUT_FOLDER/isi_histograms
LOG_FOLDER=./outputs/logs
# Clean-up
rm -rf $OUTPUT_FOLDER
mkdir -p $OUTPUT_FOLDER
mkdir $PSD_OUTPUT
mkdir $SURROGATE_ISIH_OUTPUT
mkdir $ARTIFICIAL_ISIH_OUTPUT
rm -rf LOG_FOLDER
mkdir -p $LOG_FOLDER
# Store information on the environment
(python --version && pip list && pip freeze) > $LOG_FOLDER/environment.txt
# Code path
ANALYSES_CODE=./code/analyses
# Setup PYTHONPATH
PYTHONPATH=$(pwd)/code
export PYTHONPATH
# Run PSD analyses
echo "1. PSD analyses"
PSD_CODE_ROOT=$ANALYSES_CODE/psd_by_trial
PSD_SCRIPT=psd_by_trial.py
PSD_OUTPUT_1=$PSD_OUTPUT/psd_by_trial
mkdir $PSD_OUTPUT_1
python $PSD_CODE_ROOT/elephant_welch/$PSD_SCRIPT --output_path=$PSD_OUTPUT_1 $DATA_I
PSD_OUTPUT_2=$PSD_OUTPUT/psd_by_trial_2
mkdir $PSD_OUTPUT_2
python $PSD_CODE_ROOT/elephant_multitaper/$PSD_SCRIPT --output_path=$PSD_OUTPUT_2 $DATA_I
PSD_OUTPUT_3=$PSD_OUTPUT/psd_by_trial_3
mkdir $PSD_OUTPUT_3
python $PSD_CODE_ROOT/scipy/$PSD_SCRIPT --output_path=$PSD_OUTPUT_3 $DATA_I
# Run ISI histograms obtained from spike trains generated by different
# surrogate methods
echo "2. Surrogate ISIH analyses"
SURROGATE_CODE_ROOT=$ANALYSES_CODE/surrogate_isih
SURROGATE_SCRIPT=compute_isi_histograms.py
SURROGATE_OUTPUT_1=$SURROGATE_ISIH_OUTPUT/surrogate_isih_1
mkdir $SURROGATE_OUTPUT_1
python $SURROGATE_CODE_ROOT/surrogate_1/$SURROGATE_SCRIPT --output_path=$SURROGATE_OUTPUT_1 $DATA_I
SURROGATE_OUTPUT_2=$SURROGATE_ISIH_OUTPUT/surrogate_isih_2
mkdir $SURROGATE_OUTPUT_2
python $SURROGATE_CODE_ROOT/surrogate_2/$SURROGATE_SCRIPT --output_path=$SURROGATE_OUTPUT_2 $DATA_I
# Run ISI histograms obtained from artificially-generated spike trains
echo "3. Artificial ISIH analyses"
python $ANALYSES_CODE/isi_histograms/isi_analysis.py --output_path=$ARTIFICIAL_ISIH_OUTPUT
echo "All done"