-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgtf_batch.sh
54 lines (42 loc) · 1.33 KB
/
gtf_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
44
45
46
47
48
49
#!/bin/sh
############ Notice #################
#Step1: Assembly of novel transcripts by Reference Annotation Based Transcript (RABT) method using Cufflinks in each sample based on RNA-seq reads and reference annotation
echo "Assembly of novel transcripts by Reference Annotation Based Transcript (RABT) method";
############ Parameters #################
#Reading defined parameters
TSSfolder=$0;TSSfolder=${TSSfolder:0:${#TSSfolder}-12};
original_data=$1;outpath=$2;
public_gtf=$3
MultiProcessor=$4
func=gtf
codepath=${2}/code/
outpath=${2}/tmp/${func}/
mkdir $codepath
mkdir $outpath
#Current_path record
Current_path=($(pwd))
############ De novo assembly step #################
#Loading all replicates in Group A and B
list=($(echo ${original_data} | tr "," "\n"))
#For each replicate using RABT method to assemble
j=1
for i in ${list[*]}
do
mkdir ${outpath}${j}/
#Auto detection and change the relative path into absolute path for GTF
tmp=${i%/*};
if [ x${tmp} != "x" ]
then
gtffolder=($(cd ${tmp} ; pwd)/)
else
gtffolder=($(pwd)/)
fi
i=${gtffolder}${i##*/}
cd ${Current_path}
cat ${TSSfolder}header.txt > ${codepath}a00_${func}_${j}.sh
cat>>${codepath}a00_${func}_${j}.sh<<EOF
cufflinks -N -p ${MultiProcessor} -g ${public_gtf} -o ${outpath}${j} ${i}
EOF
j=$[ $j + 1 ]
done
#Output: GTF format; Exons of transcripts annotation in each row