-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathread_depth_calcu.sh
More file actions
41 lines (28 loc) · 859 Bytes
/
read_depth_calcu.sh
File metadata and controls
41 lines (28 loc) · 859 Bytes
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
# dm6 pair-end read depth calculate
# !/bin/bash
end=$1
length=$2
genome_len=$3
function printHelp(){
echo "Version: 1.0"
echo
echo
echo "Required Arguments:"
echo
echo " $ 1 paired-end is 2 and single is 1"
echo " $ 2 reads length is default 150 bp or others"
echo " $ 3 dm6 genome length is 146638899"
echo
}
echo "calculating the sequencing depth ~~~"
echo Start time: `date`
echo "practice makes perfect!"
echo "contact with the author: jl_chen@csu.edu.cn"
ls *gz > sample.txt
for i in $(cat sample.txt);do
zcat $i |wc |awk '{print ("'${end}'"*"'${length}'"*($1/4))}' > seq_len.txt
done
for i in $(cat seq_len.txt );do
cat $i | while read line ;do awk '{print $1/"'${genome_len}'" }' > read_depth.txt
done
echo End time: `date`