annotate VCF2Hapmap/vcf2FastaAndHapmap.sh @ 4:10627af23f10 draft

planemo upload
author gandres
date Tue, 15 Dec 2015 05:18:02 -0500
parents 420b57c3c185
children
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
4
10627af23f10 planemo upload
gandres
parents: 1
diff changeset
8 fileout_label=$(date "+%Y%m%d%H%M%S")
10627af23f10 planemo upload
gandres
parents: 1
diff changeset
9 fileout=$2
10627af23f10 planemo upload
gandres
parents: 1
diff changeset
10 option=$3
1
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" ]
4
10627af23f10 planemo upload
gandres
parents: 1
diff changeset
16 then fileout_seq=$4
10627af23f10 planemo upload
gandres
parents: 1
diff changeset
17 fileout_fa1=$5
10627af23f10 planemo upload
gandres
parents: 1
diff changeset
18 filefasta=$6
1
420b57c3c185 Uploaded
dereeper
parents:
diff changeset
19 if [ "$option" == "fasta_gff" ]
4
10627af23f10 planemo upload
gandres
parents: 1
diff changeset
20 then filegff=$7
1
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