-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathimpute_script_np.sh
executable file
·88 lines (68 loc) · 3.09 KB
/
impute_script_np.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
#!/bin/bash
#######################################
# README!
#
# INPUT_LIST needs to be a file where each line contains the following fields
# <sequence name> <name with file path of fasta file>
# The file paths need to be either absolute or relative to this script.
#
# the NETWORK_DIR must contain each of the networks, as well as the pkl file
# with normalisation values, split up in folders named i<iteration>-{ss,rest}.
#
#######################################
SECONDS=0
SAVE_DIR='./out/'
INPUT_LIST='./file_list'
NETWORK_DIR='./network_files/'
#######################################
# Iteration 0
#######################################
ITER=0
###################
# SS
###################
echo "doing iteration ${ITER} - SS"
#SECONDS=0
python2 ./spider3_impute_np.py --saved_network_dir "${NETWORK_DIR}i${ITER}-ss" --input_file_list ${INPUT_LIST} -o 'ss' 'ss8' -s ${SAVE_DIR} --save_ext ".i${ITER}s"
#echo ${SECONDS}
###################
# REST
###################
echo "doing iteration ${ITER} - ASA THETA TAU PHI PSI HSEa CN"
#SECONDS=0
python2 ./spider3_impute_np.py --saved_network_dir "${NETWORK_DIR}i${ITER}-rest" --input_file_list ${INPUT_LIST} -o 'asa' 'ttpp' 'hsea' 'cn' -s ${SAVE_DIR} --save_ext ".i${ITER}r"
#echo ${SECONDS}
###################
# combine
###################
echo "combining both prediction files"
python2 ./script/combine_outputs_from_file_list.py ${INPUT_LIST} "${SAVE_DIR}" ".i${ITER}s" ".i${ITER}r" ".i${ITER}c" header="spd3 output - iteration ${ITER}"
###################
# convert to readable - optional.
###################
#cat ${INPUT_LIST} | awk '{ print $1 }' | xargs -I{} -P4 ./script/convert_raw_output_to_readable.py ${SAVE_DIR}{}.i${ITER}c ${SAVE_DIR}{}.i${ITER}
#######################################
# Iteration 1
#######################################
ITER=1
###################
# SS
###################
echo "doing iteration ${ITER} - SS"
python2 ./spider3_impute_np.py --saved_network_dir "${NETWORK_DIR}i${ITER}-ss" --input_file_list ${INPUT_LIST} -o 'ss' 'ss8' -s ${SAVE_DIR} --save_ext ".i${ITER}s" --input_ext ".i$(( ITER - 1 ))c" --input_dir "${SAVE_DIR}"
###################
# REST
###################
echo "doing iteration ${ITER} - ASA THETA TAU PHI PSI HSEa CN"
python2 ./spider3_impute_np.py --saved_network_dir "${NETWORK_DIR}i${ITER}-rest" --input_file_list ${INPUT_LIST} -o 'asa' 'ttpp' 'hsea' 'cn' -s ${SAVE_DIR} --save_ext ".i${ITER}r" --input_ext ".i$(( ITER - 1 ))c" --input_dir "${SAVE_DIR}"
###################
# combine
###################
echo "combining both prediction files"
python2 ./script/combine_outputs_from_file_list.py ${INPUT_LIST} "${SAVE_DIR}" ".i${ITER}s" ".i${ITER}r" ".i${ITER}c" header="spd3 output - iteration ${ITER}"
###################
# convert to readable - optional.
###################
#cat ${INPUT_LIST} | awk '{ print $1 }' | xargs -I{} -P4 ./script/convert_raw_output_to_readable.py ${SAVE_DIR}{}.i${ITER}c ${SAVE_DIR}{}.i${ITER}
cat ${INPUT_LIST} | awk -v a=${SAVE_DIR} -v b=${ITER} '{ print a$1".i"b"c "$2" "a$1".i"b }' | xargs -I{} -P4 python2 script/convert_raw_output_to_readable_online.py {}
echo "Time taken - ${SECONDS} seconds"