-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path07_quantification_htseq.sh
More file actions
executable file
·46 lines (39 loc) · 1.37 KB
/
07_quantification_htseq.sh
File metadata and controls
executable file
·46 lines (39 loc) · 1.37 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
#!/usr/bin/env bash
#SBATCH --cpus-per-task=1
#SBATCH --mem-per-cpu=8G
#SBATCH --time=03:00:00
#SBATCH --partition=pall
#SBATCH --job-name=quantification_htseq
#SBATCH --mail-user=lea.frei@students.unibe.ch
#SBATCH --mail-type=begin,end,fail
#SBATCH --output=/data/users/lfrei/rna_seq/output/output_htseq_%j.o
#SBATCH --error=/data/users/lfrei/rna_seq/errors/error_htseq_%j.e
#SBATCH --array=0-5
#load module
module load UHTS/Analysis/HTSeq/0.9.1
INPUT_DIR=/data/users/lfrei/rna_seq/alignment_results
OUTPUT_DIR=/data/users/lfrei/rna_seq/quantification_results
GTF_REFERENCE_DIR=/data/users/lfrei/rna_seq/assembly_results
mkdir -p $OUTPUT_DIR
#create file array
cd $INPUT_DIR
FILES=( $(ls | grep '.sam$') )
sample_name="${FILES[$SLURM_ARRAY_TASK_ID]%%.sam}"
#run htseq-count on each of the 6 samples to count by gene
htseq-count --mode=union \
--format=sam \
--nonunique=none \
--stranded=reverse \
--type=exon \
--idattr=gene_id \
${FILES[$SLURM_ARRAY_TASK_ID]} \
$GTF_REFERENCE_DIR/all_merged.gtf > $OUTPUT_DIR/${sample_name}_by_gene.tsv
#run htseq-count on each of the 6 samples to count by transcript
htseq-count --mode=union \
--format=sam \
--nonunique=none \
--stranded=reverse \
--type=exon \
--idattr=transcript_id \
${FILES[$SLURM_ARRAY_TASK_ID]} \
$GTF_REFERENCE_DIR/all_merged.gtf > $OUTPUT_DIR/${sample_name}_by_transcript.tsv