annotate VCF2Hapmap/vcf2FastaAndHapmap.sh @ 1:420b57c3c185 draft

Uploaded
author dereeper
date Fri, 10 Jul 2015 04:39:30 -0400
parents
children 10627af23f10
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
1 #!/bin/bash
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
2
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
3 tool_path=$(dirname $0)
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
4
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
5
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
6
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
7 filein=$1
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
8 fileout_label=$2
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
9 fileout=$3
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
10 option=$4
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
11
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
12 option_text=''
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
13
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
14
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
15 if [ "$option" != "none" ]
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
16 then fileout_seq=$5
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
17 fileout_fa1=$6
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
18 filefasta=$7
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
19 if [ "$option" == "fasta_gff" ]
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
20 then filegff=$8
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
21 fi
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
22 fi
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
23
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
24 if [ "$option" == "fasta" ]
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
25 then option_text="--reference $filefasta"
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
26 fi
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
27
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
28 if [ "$option" == "fasta_gff" ]
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
29 then option_text="--reference $filefasta --gff $filegff"
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
30 fi
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
31
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
32
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
33 perl $tool_path/VCF2FastaAndHapmap.pl --vcf $filein --out $fileout_label $option_text
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
34
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
35
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
36 cp $fileout_label.hapmap $fileout ; rm $fileout_label.hapmap
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
37
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
38 if [ "$option" == "fasta_gff" ]
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
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 ;
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
40 fi
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
41
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
42 if [ "$option" == "fasta" ]
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
43 then cp $fileout_label.flanking.txt $fileout_seq ; rm $fileout_label.flanking.txt ;
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
44 fi
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
45