forked from jingwen/TIFseq2
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.sh
executable file
·41 lines (34 loc) · 973 Bytes
/
main.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
#!/bin/bash
module load bcl2fastq
module load samtools
OPTIND=1
while getopts "hd:i:o:j:x:p:" opt; do
case $opt in
h)
echo "Usage: main.sh -d <sequence index info> -i <input directory> -o <output directory> -j 4 -x 2,1 -p <polyA tail size>"
exit 0
;;
d) index=$OPTARG;;
i) indir=$OPTARG;;
o) outdir=$OPTARG;;
x) idx_mis=$OPTARG;;
p) polyA=$OPTARG;;
j) thread=$OPTARG;;
esac
done
indir=${indir%/}
outdir=${outdir%/}
sampleSheet=$outdir/sampleSheet.csv
fastq=$outdir/fastq
if [ ! -d "$indir" ];then
echo "Input directory does not exist!"
exit 0
fi
if [ ! -d "$outdir" ];then
echo "Output directory does not exist! Generate directory."
mkdir $outdir
fi
prep_sampleSheet.awk $index > $sampleSheet
bcl2fastq -R $indir -o $fastq --sample-sheet $sampleSheet --no-lane-splitting --barcode-mismatches $idx_mis
demultiplex_stats.awk $fastq/Stats/DemultiplexingStats.xml > $fastq/demultiplex_stat.txt
preprocess.sh -I $fastq -O $outdir -j $thread -A $polyA