-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.txt
128 lines (87 loc) · 6.21 KB
/
script.txt
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#first script
#==============================================================================================================================================
echo " Before we begin please insert the following infromation [this script was created for 2 catecories, with 4 replicates each with the initials of Mp_C and Mp_G ] "
read -p '-The location of the fna file: ' fna
read -p '-The location of the genomic.gff file : ' genomic
read -p '-Name the first group you are testing : ' group1
read -p '-Name the second group you are testing : ' group2
echo " You have stated the your fna file is located in $fna , the genomic $genomic and the two categories under study are the following $group1,$group2"
echo "
LETS BEGIN THIS TRIP TO RNA-SEQ LAND :) !!!
(@@) ( ) (@) ( ) @@ () @ O @
( )
(@@@@)
( )
(@@@)
==== ________ ___________
_D _| |_______/ \__I_I_____===__|_________|
|(_)--- | H\________/ | | =|___ ___| ________________
/ | | H | | | | ||_| |_|| _|
| | | H |__--------------------| [___] | =|
| ________|___H__/__|_____/[][]~\_______| | -|
|/ | |-----------I_____I [][] [] D |=======|____|_________________
__/ =| o |=-O=====O=====O=====O \ ____Y___________|__|___________________
|/-=|___|= || || || |_____/~\___/ |_D__D__D_| |_D_
\_/ \__/ \__/ \__/ \__/ \_/ \_/ \_/ \_/
"
#==============================================================================================================================================
# First of all group the two reads and then turn them into sam files with hisat
echo "=========================================================================================================================================="
for i in $(ls);do
if [[ $i =~ .*\1.fastq$ ]];then
echo "------------------------------------------------------"
echo "The files ${i:0:6}2.fastq and $i are being processed "
hisat2 --dta-cufflinks -p 20 -x $fna -1 $i -2 ${i:0:6}2.fastq -S ${i:0:5}.sam > ${i:0:4}.stdout_stderr 2>&1
echo "The file ${i:0:5}.sam is ready "
fi
done
#==============================================================================================================================================
#Now turn the sam filles to bam files
echo "=========================================================================================================================================="
for i in $(ls);do
if [[ $i =~ .*\sam$ ]];then
echo "---------------------------------------------------------"
echo "The file $i is being processed "
samtools view -b --threads 20 $i > ${i:0:5}.bam
echo "The file ${i:0:5}.bam is ready "
fi
done
#===============================================================================================================================================
#Turn the bam files to sortes bam files
echo "=========================================================================================================================================="
for i in $(ls);do
if [[ $i =~ .*\bam$ ]];then
echo "---------------------------------------------------------"
echo "The file $i is being processed "
samtools sort -m 512M --threads 1 $i -o ${i:0:5}.s.bam
echo "The file ${i:0:5}.s.bam is ready "
fi
done
#================================================================================================================================================
#Run cufflinks
echo "=========================================================================================================================================="
for i in $(ls);do
if [[ $i =~ .*\.s.bam$ ]];then
echo "---------------------------------------------------------"
echo "The file $i is being processed "
cufflinks -p 20 --library-type fr-firststrand -o ${i:0:5}.gtf -G $genomic $i
echo "The file ${i:0:5}.gtf is ready "
fi
done
#================================================================================================================================================
#
echo "=========================================================================================================================================="
find . -name "transcripts.gtf" > manifest.txt
#================================================================================================================================================
#
echo "=========================================================================================================================================="
echo "------------------------------------------------------ STARTING TO MERGE -----------------------------------------------------------------"
echo "=========================================================================================================================================="
cuffmerge -o cuffmerge_out -p 20 -g $genomic -s $fna manifest.txt > cuffmerge.stdout_stderr 2>&1
echo "------------------------------------------------------ MERGING COMPLETED ------------------------------------------------------------------"
echo "=========================================================================================================================================="
echo "------------------------------------------------------ STARTING CUFFDIFF ------------------------------------------------------------------"
cuffdiff -o cuffdiffoutput01 -p 20 -L $group1,$group2 cuffmerge_out/transcripts.gtf Mp_C1.s.bam,Mp_C2.s.bam,Mp_C3.s.bam,Mp_C4.s.bam Mp_G1.s.bam,Mp_G2.s.bam,Mp_G3.s.bam,Mp_G4.s.bam > cuffdiff.stdout_stderr 2>&1
echo "=========================================================================================================================================="
echo "------------------------------------------------------ CUFFDIFF COMPLETED -----------------------------------------------------------------"
echo "=========================================================================================================================================="