-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmrg.sh
44 lines (34 loc) · 1.16 KB
/
mrg.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
#!/bin/sh
############ Notice #################
#Step2-1: Merge each annotation file (GTF file) generated from the assembly step in each sample together using Cuffmerge
echo -e "
====================================================
[$(date +%R:%S)] Merge each annotation file generated by each sample together\n";
############ Parameters #################
#Reading defined parameters
TSSfolder=$0;TSSfolder=${TSSfolder:0:${#TSSfolder}-6};
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
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
#Merging all transcripts annotations together
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
#Output: GTF format; Exons of transcripts annotation in each row