9
|
1 #!/bin/bash
|
|
2
|
|
3 tool_path=$(dirname $0)
|
|
4
|
|
5
|
|
6
|
|
7 filein=$1
|
|
8 fileout_label=$(date "+%Y%m%d%H%M%S")
|
|
9 fileout=$2
|
|
10 option=$3
|
|
11
|
|
12 option_text=''
|
|
13
|
|
14
|
|
15 if [ "$option" != "none" ]
|
|
16 then fileout_seq=$4
|
|
17 fileout_fa1=$5
|
|
18 filefasta=$6
|
|
19 if [ "$option" == "fasta_gff" ]
|
|
20 then filegff=$7
|
|
21 fi
|
|
22 fi
|
|
23
|
|
24 if [ "$option" == "fasta" ]
|
|
25 then option_text="--reference $filefasta"
|
|
26 fi
|
|
27
|
|
28 if [ "$option" == "fasta_gff" ]
|
|
29 then option_text="--reference $filefasta --gff $filegff"
|
|
30 fi
|
|
31
|
|
32
|
|
33 perl $tool_path/VCF2FastaAndHapmap.pl --vcf $filein --out $fileout_label $option_text
|
|
34
|
|
35
|
|
36 cp $fileout_label.hapmap $fileout ; rm $fileout_label.hapmap
|
|
37
|
|
38 if [ "$option" == "fasta_gff" ]
|
|
39 then cp $fileout_label.flanking.txt $fileout_seq ; rm $fileout_label.flanking.txt ; cp $fileout_label.gene_alignment.fas $fileout_fa1 ; rm $fileout_label.gene_alignment.fas ;
|
|
40 fi
|
|
41
|
|
42 if [ "$option" == "fasta" ]
|
|
43 then cp $fileout_label.flanking.txt $fileout_seq ; rm $fileout_label.flanking.txt ;
|
|
44 fi
|
|
45
|