0
|
1 #!/bin/bash
|
|
2
|
|
3 if [ "$#" -ne 1 ]; then
|
|
4 echo "[usage:] expression.sh bam.file"
|
|
5 exit 1;
|
|
6 fi
|
|
7
|
|
8 INPUT_BAM=$1
|
|
9 SAMPLE_ID="sample"
|
|
10 SAMTOOLS=$GALAXY_HOME/package/DAUMSOFT/RNA-seq/Normalization/samtools
|
|
11 HTSEQ_COUNT=$GALAXY_HOME/package/DAUMSOFT/RNA-seq/Normalization/htseq-count
|
|
12 GTF=$GALAXY_HOME/package/DAUMSOFT/RNA-seq/Normalization/gencode.v22.annotation.gtf
|
|
13 EXPRESSION_R=$GALAXY_HOME/package/DAUMSOFT/RNA-seq/Normalization/expression.r
|
|
14
|
|
15 HTSEQ_COUNT_OUT=./$SAMPLE_ID".htseq-count.out"
|
|
16 EXPRESSION_OUT=./out
|
|
17 EXPRESSION_OUT_TMP=./out_tmp
|
|
18
|
|
19 rm -rf $EXPRESSION_OUT
|
|
20 rm -rf $EXPRESSION_OUT_TMP
|
|
21
|
|
22 mkdir $EXPRESSION_OUT
|
|
23 mkdir $EXPRESSION_OUT_TMP
|
|
24
|
|
25
|
|
26 $SAMTOOLS view -F 4 $INPUT_BAM |
|
|
27 $HTSEQ_COUNT \
|
|
28 -m intersection-nonempty \
|
|
29 -i gene_id \
|
|
30 -r pos \
|
|
31 -s no \
|
|
32 - $GTF > $HTSEQ_COUNT_OUT
|
|
33
|
|
34 Rscript $EXPRESSION_R $HTSEQ_COUNT_OUT
|
|
35
|
|
36 mv $EXPRESSION_OUT_TMP/$SAMPLE_ID".txt" $EXPRESSION_OUT/
|
|
37
|