-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmrg_batch.sh
44 lines (35 loc) · 1.19 KB
/
mrg_batch.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
#!/bin/sh
############ Notice #################
#Step2-1: Merge each annotation file (GTF file) generated from the assembly step in each sample together using Cuffmerge
echo "Merge each annotation file generated by each sample together";
############ Parameters #################
#Reading defined parameters
TSSfolder=$0;TSSfolder=${TSSfolder:0:${#TSSfolder}-12};
original_data=$1;outpath=$2;
public_gtf=$3
sequence=$4
MultiProcessor=$5
func=mrg
inpath=${2}/tmp/gtf/
codepath=${2}/code/
outpath=${2}/tmp/${func}/
Current_path=($(pwd))
mkdir $outpath
############ Merging transcipts annotation step #################
#Loading all replicates in Group A and B
#Merging all transcripts annotations together
cat ${TSSfolder}header.txt > ${codepath}a01_${func}.sh
cat>>${codepath}a01_${func}.sh<<EOF
cd $inpath
list=(\$(ls -F | grep /\$ | sort -n))
for i in \${list[*]}
do
cat>>${outpath}gtf_asm.txt<<EOFF
${inpath}\${i}transcripts.gtf
EOFF
done
cd ${outpath} ##required by cuffmerge
cuffmerge -p ${MultiProcessor} -g ${public_gtf} -s ${sequence} ${outpath}gtf_asm.txt -o ${outpath}
cp ${outpath}merged_asm/merged.gtf ${2}/merged.gtf
EOF
#Output: GTF format; Exons of transcripts annotation in each row