-
Notifications
You must be signed in to change notification settings - Fork 0
/
doit06.bash
executable file
·55 lines (40 loc) · 1.49 KB
/
doit06.bash
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
#! /bin/bash
. doit-preamble.bash
# ------------------------------------------------------------------------
# Step 6. Make count tables
# ------------------------------------------------------------------------
echo 1>&2 '# Making count tables'
rm -rf ${COUNTS}
mkdir -p ${COUNTS}
init_FEATURECOUNTS_ARGS
FEATURECOUNTS_ARGS+=" -t gene"
FEATURECOUNTS_ARGS+=" -g gene_id"
FEATURECOUNTS_ARGS+=" -f" # count at feature level
fgrep $'\t'gene$'\t' ${INPUTS}/annotation-host.gtf \
| ./scripts/sanitize-gtf-for-featureCounts \
> ${COUNTS}/annotation-host.gtf
fgrep $'\t'gene$'\t' ${INPUTS}/annotation-bacteria.gtf \
| ./scripts/sanitize-gtf-for-featureCounts \
> ${COUNTS}/annotation-bacteria.gtf
cat ${COUNTS}/annotation-host.gtf ${COUNTS}/annotation-bacteria.gtf \
> ${COUNTS}/annotation-both.gtf
(
for i in $SAMPLES_INDICES ; do
echo featureCounts $FEATURECOUNTS_ARGS \
-a ${COUNTS}/annotation-both.gtf \
-o ${COUNTS}/both_$i.txt \
${STAR}/aligned_$i.bam
echo featureCounts $FEATURECOUNTS_ARGS \
-a ${COUNTS}/annotation-host.gtf \
-o ${COUNTS}/host_$i.txt \
${STAR}/aligned_$i.bam
echo featureCounts $FEATURECOUNTS_ARGS \
-a ${COUNTS}/annotation-bacteria.gtf \
-o ${COUNTS}/bacteria_$i.txt \
${STAR}/aligned_$i.bam
done
) | run_commands
# ------------------------------------------------------------------------
# Done.
# ------------------------------------------------------------------------
echo 1>&2 '# Done.'