/
6.1.runSnpEffect.sh
88 lines (54 loc) · 1.38 KB
/
6.1.runSnpEffect.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
# mlasserre[at]pasteur[dot]edu[dot]uy
# help: run SNPeffect for batch strains
if [ -z "$1" ]
then
echo "
Runs snpEffect for a batch of strains of M. bovis
--------------- HELP ------------------
It uses:
- snpEffect (version 4.2 (build 2015-12-05))
Usage: bash <7.1.runSnpEffect.sh> <1:configFile.conf> <snpEff location> <snpEff.config location>
WARNING:
- Use complete paths
- snpEff.config local is located in ~/Software/snpEff/snpEff.config. For external use, you need to set up snpEff.
configFile example:
<path_to_folder1>
<path_to_folder2>
...
<path_to_folderN>
"
else
if [ -z $2 ]
then
echo "You need to provide the path where snpEff is located as a 2nd argument"
else
if [ -z $3 ]
then
echo "You need to provide the path where the snpEff.config file is located as a 3rd argument"
else
current=$(pwd)
while read i;
do
linea=( $i )
path=${linea[0]}
cd $path
current2=$(pwd) ##
cepa=$(basename $path)
echo "
::::::::: Cepa $cepa :::::::::
"
cd 5.SNPcalling/5.1.VarScan
vcf=$(echo BOTH.IndelSNP.varScan.$cepa.output)
cd ..
mkdir -p 5.4.snpEffect
cd 5.4.snpEffect
cp -s ../5.1.VarScan/$vcf ./$vcf.vcf
chrom=$(tail -1 $vcf.vcf | awk '{print $1}')
sed "s/^$chrom/Chromosome/" $vcf.vcf > $vcf.sedded.vcf
java -Xmx4g -jar $2 -ud 0 -v -d -c $3 -s stats.html GCA_000195835.1.29 $vcf.sedded.vcf > $cepa.snpEffect.vcf
done < $1
cd $current
fi
fi
fi