-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRNAseq.total_table_maker.sh
More file actions
78 lines (43 loc) · 2.44 KB
/
RNAseq.total_table_maker.sh
File metadata and controls
78 lines (43 loc) · 2.44 KB
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
#Juan Santos. 2022 Oct
##################################################################################
#working directory where all the sample directories are allocated
working_dir="/media/diskc/project_RNAseq_tmp"
mkdir $working_dir/summary_output;
#this defines the samples to be analysed (dir names)
sample_list="mutant_rep1 mutant_rep2 mutant_rep3 wt_rep1 wt_rep2 wt_rep3";
#sample_list="test_rep1";
##################################################################################
####### Step 0. Makes a dir to place all the counting tables
mkdir $working_dir/summary_output;
####### Step 1. Copying and gathering gene expression counting files together
for sample in $sample_list ; do
cp $working_dir/REPLICATES_TOTAL/${sample}/abund.stringtie.txt $working_dir/summary_output/${sample}.abund.stringtie.txt;
cp $working_dir/REPLICATES_TOTAL/${sample}/counts.htseq.txt $working_dir/summary_output/${sample}.counts.htseq.txt;
done
wait
####### Step 2. Copying and gathering gene expression counting files together
cd $working_dir/summary_output;
#### this makes a table with raw read count values from htseq-count
grep '^AT' mutant_rep1.counts.htseq.txt|sort| cut -f 1 > tmp_ids
grep '^AT' mutant_rep1.counts.htseq.txt|sort| cut -f 2 > tmp1
grep '^AT' mutant_rep2.counts.htseq.txt|sort| cut -f 2 > tmp2
grep '^AT' mutant_rep3.counts.htseq.txt|sort| cut -f 2 > tmp3
grep '^AT' wt_rep1.counts.htseq.txt|sort| cut -f 2 > tmp4
grep '^AT' wt_rep2.counts.htseq.txt|sort| cut -f 2 > tmp5
grep '^AT' wt_rep3.counts.htseq.txt|sort| cut -f 2 > tmp6
paste tmp_ids tmp1 tmp2 tmp3 tmp4 tmp5 tmp6 >tmp_total;
echo -e "id\tmutant_rep1\tmutant_rep2\tmutant_rep3\twt_rep1\twt_rep2\twt_rep3">tmp_header;
cat tmp_header tmp_total>total.gene.counts.txt;
rm tmp*;
#### this makes a table with TPM values form stringtie
grep '^AT' mutant_rep1.abund.stringtie.txt|sort| cut -f 1 > tmp_ids
grep '^AT' mutant_rep1.abund.stringtie.txt|sort| cut -f 9 > tmp1
grep '^AT' mutant_rep2.abund.stringtie.txt|sort| cut -f 9 > tmp2
grep '^AT' mutant_rep3.abund.stringtie.txt|sort| cut -f 9 > tmp3
grep '^AT' wt_rep1.abund.stringtie.txt|sort| cut -f 9 > tmp4
grep '^AT' wt_rep2.abund.stringtie.txt|sort| cut -f 9 > tmp5
grep '^AT' wt_rep3.abund.stringtie.txt|sort| cut -f 9 > tmp6
paste tmp_ids tmp1 tmp2 tmp3 tmp4 tmp5 tmp6 >tmp_total;
echo -e "id\tmutant_rep1\tmutant_rep2\tmutant_rep3\twt_rep1\twt_rep2\twt_rep3">tmp_header;
cat tmp_header tmp_total>total.gene.TPM.txt;
rm tmp*;