forked from VandinLab/ALLSTAR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathallstar.sh
executable file
·71 lines (65 loc) · 1.35 KB
/
allstar.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
#!/bin/bash
# set default values
num_cores=1
top_k_rules=5
graph_path='PPI/FIsInGene_122921_with_annotations.txt'
max_rule_length=4
alpha=0.05
threshold_manhattan=0.01
y_value=0
# parse command-line arguments
while getopts ":p:f:s:k:y:g:l:a:t:" opt; do
case $opt in
p)
num_cores=$OPTARG
;;
f)
file_path=$OPTARG
;;
s)
split=$OPTARG
;;
k)
top_k_rules=$OPTARG
;;
y)
y_value=$OPTARG
;;
g)
graph_path=$OPTARG
;;
l)
max_rule_length=$OPTARG
;;
a)
alpha=$OPTARG
;;
t)
threshold_manhattan=$OPTARG
;;
esac
done
# get current timestamp
timestamp=$(date +"%Y-%m-%d_%H-%M-%S")
# Get the filename using basename
filename=$(basename "$file_path")
# set output file name
output_file_name="results/ALLSTAR_runs/ALLSTAR_${filename}_${timestamp}.txt"
echo "Calculating. Raw results in $output_file_name"
# run ALLSTAR in calculus mode with the specified number of cores
mpiexec -n $num_cores python py/allstar.py \
-f $file_path \
-s $split \
-k $top_k_rules \
-y $y_value \
-g $graph_path \
-l $max_rule_length \
-a $alpha \
-t $threshold_manhattan \
-o $output_file_name \
--calculus_mode
echo "Parsing results."
python py/allstar.py \
-o $output_file_name \
--parse_mode
echo "Analysis completed."