-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbatch_influenza.sh
executable file
·43 lines (31 loc) · 1.01 KB
/
batch_influenza.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
#!/bin/bash
# set directory where smaltalign.sh is located
script_dir="/analyses/Diagnostics/Repositories/SmaltAlign/"
# set sample directory to the directory where this file is
sample_dir=$(dirname "$(readlink -f "$0")")
# set SmaltAlign parameters
n=10000000 # number of reads (default 200000)
i=4 # iterations (default 4)
source activate SmaltAlign
for filename in $sample_dir/*.fastq.gz; do
name=$(echo "$filename" | cut -f 1 -d '.')
for segment in {1..8}; do
mkdir -p $name/segment$segment
done
cd $name
# choose best reference for each sample and segment
$script_dir/select_ref.py $filename
for segment in {1..8}; do
( cd segment$segment
# run smaltalign.sh with the previously selected best reference
${script_dir}/smaltalign.sh \
-r ../segment-$segment.fasta \
-n $n \
-i $i $filename
Rscript ${script_dir}/cov_plot.R ./
Rscript ${script_dir}/wts_influenza.R ./
cd ../ ) &
done
wait
cd ../
done