-
Notifications
You must be signed in to change notification settings - Fork 3
/
do_step3.psh
33 lines (23 loc) · 642 Bytes
/
do_step3.psh
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
#!/bin/bash
name=$1
rm -f ${name}.subsam
function do_str1 {
export LANG=C
cut -f 1 ${name}.final | while read line
do
grep -i -w "^$line" cand_sam/${name}_?_Nmm.sam | cut -d ':' -f 2 >> ${name}.subsam
done
}
do_str1
function do_str2 {
for i in A C G T
do
myjoin -F 1 -f 1 -m ${name}.final cand_sam/${name}_${i}_Nmm.sam | cut -f 6- >> ${name}.subsam
done
}
do_str2
awk '{print $1,$2,$3,$4,$4+length($5)-3-1}' OFS="\t" ${name}.subsam > ${name}.region # remove NGG
# GC
sed 's/AGG$//' cand_fa/${name}_A.fa > ${name}.seq
infoseq -nohead -only -name -pgc ${name}.seq > ${name}.gc # infoseq in EMBOSS (v6.6.0)
Rscript do_moving.r $name