forked from DeepGraphLearning/KnowledgeGraphEmbedding
-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate_paitent_focoused_kg.bash
74 lines (69 loc) · 1.69 KB
/
generate_paitent_focoused_kg.bash
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
#!/bin/bash
## bash script to run, data geneaioon and preprocessing files
# Generate data for training and testing
module purge
module load python/intel/3.8.6
DATA_PATH='./data'
CODE_PATH="./codes/paitent_graph_generation"
echo "Generating triplets ..."
python $CODE_PATH'/generate_triplets.py'
echo "done"
echo "Pre-processing data ..."
python $CODE_PATH'/generate_graph.py'
echo "done "
echo "moving data"
rm -rf $DATA_PATH'/paitent_focoused_kg'
if [ $? -ne 0 ]; then
exit 1
fi
cp -r $CODE_PATH'/generated_data' $DATA_PATH'/paitent_focoused_kg'
if [ $? -ne 0 ]; then
exit 1
fi
cd $DATA_PATH'/paitent_focoused_kg/all_triplets'
if [ $? -ne 0 ]; then
exit 1
fi
mv ./* ..
cd ..
rm -r ./all_triplets
if [ $? -ne 0 ]; then
exit 1
fi
cd ..
cd ..
pwd
# data/paitent_focoused_kg/patient_cancer_type_triplets
# cp -r $DATA_PATH/paitent_focoused_kg/patient_cancer_type_triplets $DATA_PATH
# if [ $? -ne 0 ]; then
# exit 1
# fi
cp -r $DATA_PATH/paitent_focoused_kg/pid_age_triplets/ $DATA_PATH
if [ $? -ne 0 ]; then
exit 1
fi
cp -r $DATA_PATH/paitent_focoused_kg/pid_drugs_triplets/ $DATA_PATH
if [ $? -ne 0 ]; then
exit 1
fi
cp -r $DATA_PATH/paitent_focoused_kg/pid_mutation_missense_variant_triplets/ $DATA_PATH
if [ $? -ne 0 ]; then
exit 1
fi
cp -r $DATA_PATH/paitent_focoused_kg/pid_mutation_non_missense_variant_triplets/ $DATA_PATH
if [ $? -ne 0 ]; then
exit 1
fi
cp -r $DATA_PATH/paitent_focoused_kg/pid_race_triplets/ $DATA_PATH
if [ $? -ne 0 ]; then
exit 1
fi
cp -r $DATA_PATH/paitent_focoused_kg/pid_sex_triplets/ $DATA_PATH
if [ $? -ne 0 ]; then
exit 1
fi
cp -r $DATA_PATH/paitent_focoused_kg/pid_treatment_triplets/ $DATA_PATH
if [ $? -ne 0 ]; then
exit 1
fi
echo "done"