-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstar.alignment.loop.sh
49 lines (37 loc) · 1.06 KB
/
star.alignment.loop.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
43
44
45
46
47
48
49
#!/bin/sh -l
# star.alignment.loop.sh
# BiX - beta
#
# Created by BiX on 11/14/17.
#
#SBATCH -J star.align
#SBATCH -o out.star.align
#SBATCH -e err.star.align
#SBATCH -n 10
#SBATCH -t 23:59:59
#SBATCH --nodes=2
#SBATCH --mem-per-cpu=20000
# create a list of input fastq files
ls -1 *R1* > Read1.list # for SE library
# ls -1 *R2* > Read2.list # for PE library (un-comment line 21 and 22 and comment line 19 for PE usage)
paste -d" " Read1.list Read2.list > Reads.list # for SE and PE library
fastqs=( `cat "Reads.List" ` ) # reads each line as element of fastqs array
for i in "${fastqs[@]}"
do
# set appropriate outFileNamePrefix schema
iSUB=`echo "$i" | cut -d' ' -f1`
FASTQ="$i"
# set appropriate ref genome index
DIR=../genomes/ucsc/Homo_sapiens/hg19/genomeDir
STAR \
--runThreadN 12 \
--genomeDir $DIR \
--readFilesIn $FASTQ \
--readFilesCommand zcat \
--outSAMstrandField intronMotif \
--outFilterIntronMotifs RemoveNoncanonical \
--outSAMtype BAM SortedByCoordinate \
--outFileNamePrefix "$iSUB". \
--limitBAMsortRAM 61675612266
--quantMode GeneCounts
done