annotate VCF2Hapmap/vcf2FastaAndHapmap.sh @ 10:c6640c49fd01 draft

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