-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeeptools_plotprofile
More file actions
executable file
·71 lines (64 loc) · 2.01 KB
/
deeptools_plotprofile
File metadata and controls
executable file
·71 lines (64 loc) · 2.01 KB
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
if [[ -z $1 ]]; then
echo "Usage: "
echo -e "\t\$1: The bwfile (single mode) or '\$bwfile \$output_dir \$sample_label \$thread' for xargs multicore mode."
echo -e "\t\$2: The output_dir."
echo -e "\t\$3: The sample_label."
echo -e "\t\$4: The thread for each single run."
exit 100
fi
bwfile=$1
output_dir=$2
sample_label=$3
thread=$4
gtf=~/Genomes/GENCODE/Human/hg38/gtf/gencode.v40.annotation.gtf
# 2 mode
n=$(echo ${bwfile} | awk -F " |\t" '{print NF}')
if [[ $n -eq 4 ]]; then
# multiple
output_dir=$(echo ${bwfile} | cut -d " " -f2)
sample_label=$(echo ${bwfile} | cut -d " " -f3)
thread=$(echo ${bwfile} | cut -d " " -f4)
bwfile=$(echo ${bwfile} | cut -d " " -f1)
echo "multiple mode: $sample_label"
elif [[ $n -eq 1 ]]; then
# single
echo "single mode: $sample_label"
else
echo "The \$1 is wrong, please check"
exit 100
fi
# create the directory
mkdir -p ${output_dir}/{1.raw_data,2.data,3.pic}/{1.TSS,2.Body}
# TSS
if true; then
output=${output_dir}/1.raw_data/1.TSS/${sample_label}_point_tss.gz
mat=${output_dir}/2.data/1.TSS/${sample_label}_point_tss.mat
pic=${output_dir}/3.pic/1.TSS/${sample_label}_point_tss.png
computeMatrix reference-point \
--scoreFileName ${bwfile} --regionsFileName ${gtf} \
--outFileName ${output} \
--samplesLabel ${sample_label} \
--binSize 200 -a 2000 -b 2000 \
--referencePoint TSS --averageTypeBins median \
--numberOfProcessors ${thread} --skipZeros
plotProfile -m ${output} \
--outFileNameData ${mat} \
-out ${pic}
fi
# body
if true; then
output=${output_dir}/1.raw_data/2.Body/${sample_label}_body.gz
mat=${output_dir}/2.data/2.Body/${sample_label}_body.mat
pic=${output_dir}/3.pic/2.Body/${sample_label}_body.png
computeMatrix scale-regions \
--scoreFileName ${bwfile} --regionsFileName ${gtf} \
--outFileName ${output} \
--samplesLabel ${sample_label} \
--binSize 200 -a 2000 -b 2000 -m 5000 \
--averageTypeBins median \
--numberOfProcessors ${thread} --skipZeros
plotProfile -m ${output} \
--outFileNameData ${mat} \
-out ${pic}
fi