-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy path5_Cuffmerge_wrapper.sh
executable file
·62 lines (52 loc) · 1.5 KB
/
5_Cuffmerge_wrapper.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
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
# Note: this may be called by 4_RSeQC_Multiple.sh, 4_DO_RSeQC_Multiple.sh
# Arguments:
# $1 = number of threads to run on
# $2 = file of files to merge
# $3 = reference gtf (optional)
# $4 = reference fasta (optional)
CUFFMERGE=/nfs/users/nfs_t/ta6/RNASeqPipeline/software/cufflinks-2.2.1.Linux_x86_64/cuffmerge
NUMTHREADS=$1
INPUTFILE=$2
REFgtf=$3
REFfasta=$4
# Add gtf_to_sam and other accessorty cufflinks scripts to my path
export PATH=$PATH:/nfs/users/nfs_t/ta6/RNASeqPipeline/software/cufflinks-2.2.1.Linux_x86_64/
if [ ! -f $CUFFMERGE ] ; then
echo "Sorry Cuffmerge not available"
exit 1
fi
if [ -z $NUMTHREADS ] ; then
echo "Please set number of threads to run on, setting = 0 will get genome & rRNA gtf but not run cufflinks (ARG 1/4)"
exit 1
fi
if [ $NUMTHREADS -lt 1 ] ; then
echo "Number of threads must be at least 1."
exit 1
fi
if [ -z $INPUTFILE ] ; then
echo "Please set provide a file with a list of gtf files to merge (ARG 2/4)"
exit 1
fi
ARGrefgtf=""
if [ ! -z $REFgtf ] ; then
if [ -s $REFgtf ] ; then
ARGrefgtf="-g $REFgtf"
else
echo "Reference GTF is empty or does not exist, will not be used";
fi
fi
ARGreffa=""
if [ ! -z $REFfasta ] ; then
if [ -s $REFfasta ] ; then
ARGreffa="-s $REFfasta"
else
echo "Reference FASTA is empty of does not exist, will not be used";
fi
fi
# Cuffmerge options:
# -o outprefix->redirects stdout
# -g ref-gtf
# -p number of threads
# -s ref-sequence
$CUFFMERGE $ARGrefgtf $ARGreffa --num-threads $NUMTHREADS $INPUTFILE