3
|
1 #!/bin/bash
|
|
2
|
|
3 tool_path=$(dirname $0)
|
|
4
|
|
5 filein=$1
|
|
6 fileout_label=$(date "+%Y%m%d%H%M%S")
|
|
7 step=$2
|
|
8 window=$3
|
|
9 filelog=$4
|
|
10 fileout_taj=$5
|
|
11 fileout_tstv=$6
|
|
12 fileout_windowed=$7
|
|
13 fileout_snp=$8
|
|
14 group=$9
|
|
15 if [ "$group" != "none" ]
|
|
16 then fileout_fst=${10}
|
|
17 fileout_fst_marker=${11}
|
|
18 fileout_taj_combined=${12}
|
|
19 fileout_windowed_combined=${13}
|
|
20 fi
|
|
21
|
|
22
|
|
23 cp $filein ${filein}.vcf
|
|
24 if [ "$group" != "none" ]
|
|
25 then perl $tool_path/VCFToolsSlidingWindow.pl --input ${filein}.vcf --out $fileout_label --step $step --window $window --group $group
|
|
26 else perl $tool_path/VCFToolsSlidingWindow.pl --input ${filein}.vcf --out $fileout_label --step $step --window $window
|
|
27 fi
|
|
28
|
|
29 mv ${fileout_label}.vcftools.log $filelog
|
|
30 mv ${fileout_label}.Tajima.D ${fileout_taj}
|
|
31 mv ${fileout_label}.TsTv ${fileout_tstv}
|
|
32 mv ${fileout_label}.windowed.pi ${fileout_windowed}
|
|
33 mv ${fileout_label}.snpden ${fileout_snp}
|
|
34
|
|
35 if [ "$group" != "none" ]
|
|
36 then mv ${fileout_label}.fst.txt ${fileout_fst}
|
|
37 mv ${fileout_label}.fst.by_marker.genes.txt ${fileout_fst_marker}
|
|
38 mv ${fileout_label}.combined.dtajima.txt ${fileout_taj_combined}
|
|
39 mv ${fileout_label}.combined.pi.txt ${fileout_windowed_combined}
|
|
40 fi
|
|
41
|
|
42 rm -f ${filein}.vcf ${filein}.vcf.*
|
|
43
|