-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprocessCounts.sh
executable file
·42 lines (37 loc) · 1.06 KB
/
processCounts.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
#!/bin/bash
if [ "$1" = "help" ] || [ -z "$1" ]
then
echo ""
echo "--------------------------------------------------------------------------------------"
echo " To run this script, use the following syntax:"
echo " bash" $0 "<1> or <2>"
echo " where 1 is for first strand and 2 is for reverse strands, 0 for unstranded counts"
echo "--------------------------------------------------------------------------------------"
echo ""
echo ""
echo ""
exit 1
elif [ "$1" = "1" ]
then
for i in *ReadsPerGene.out.tab
do
awk 'NR > 4 {print $1 "\t" $3}' $i > $i.rawCounts
done
mkdir rawCounts
mv *.rawCounts rawCounts
elif [ "$1" = "2" ]
then
for i in *ReadsPerGene.out.tab
do
awk 'NR > 4 {print $1 "\t" $4}' $i > $i.rawCounts
done
mkdir rawCounts
mv *.rawCounts rawCounts
else
for i in *ReadsPerGene.out.tab
do
awk 'NR > 4 {print $1 "\t" $2}' $i > $i.rawCounts
done
mkdir rawCounts
mv *.rawCounts rawCounts
fi