-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path08_heterotypic_promoters_single_CPU.sh
98 lines (76 loc) · 2.49 KB
/
08_heterotypic_promoters_single_CPU.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
97
98
#!/bin/bash
function error_exit() {
echo "ERROR: $1" >&2
usage
exit 1
}
print_red(){
RED='\033[0;31m'
NC='\033[0m' # No Color
printf "${RED}$1${NC}\n"
}
print_green(){
GREEN='\033[0;32m'
NC='\033[0m' # No Color
printf "${GREEN}$1${NC}\n"
}
print_orange(){
ORANGE='\033[0;33m'
NC='\033[0m' # No Color
printf "${ORANGE}$1${NC}\n"
}
print_fluorescent_yellow(){
FLUORESCENT_YELLOW='\033[1;33m'
NC='\033[0m' # No Color
printf "${FLUORESCENT_YELLOW}$1${NC}\n"
}
print_white(){
WHITE='\033[1;37m'
NC='\033[0m' # No Color
printf "${WHITE}$1${NC}"
}
output=results/08_heterotypic_promoters_single_CPU
indexoutput=data/homotypic_promoters
gene_input_file=data/gene.txt
print_green "Searching for heterotypic motif hits with single CPU..."
outputTemp=$output/single
mkdir -p $outputTemp
# remove genes not present in pre-computed pmet index
grep -Ff $indexoutput/universe.txt $gene_input_file > $gene_input_file"temp"
scripts/pmet \
-d . \
-g $gene_input_file"temp" \
-i 4 \
-p $indexoutput/promoter_lengths.txt \
-b $indexoutput/binomial_thresholds.txt \
-c $indexoutput/IC.txt \
-f $indexoutput/fimohits \
-o $output/single
# rm $gene_input_file"temp"
Rscript 05_heatmap.R \
Overlap \
$output/heatmap.png \
$output/motif_output.txt
##################################### pmetParallel ##################################
print_green "Searching for heterotypic motif hits with single CPU..."
outputTemp=$output/parallel
mkdir -p $outputTemp
# remove genes not present in pre-computed pmet index
grep -Ff $indexoutput/universe.txt $gene_input_file > $gene_input_file"temp"
scripts/pmetParallel \
-d . \
-g $gene_input_file"temp" \
-i 4 \
-p $indexoutput/promoter_lengths.txt \
-b $indexoutput/binomial_thresholds.txt \
-c $indexoutput/IC.txt \
-f $indexoutput/fimohits \
-t 2 \
-o $outputTemp
cat $outputTemp/*.txt > $outputTemp/motif_output.txt
rm $outputTemp/temp*.txt
rm $gene_input_file"temp"
Rscript 05_heatmap.R \
Overlap \
$outputTemp/heatmap.png \
$outputTemp/motif_output.txt