annotate VCFToolFilter/vcfToolsFilter.sh @ 18:7ba803afa41b draft

Uploaded
author dereeper
date Thu, 26 Feb 2015 16:02:46 -0500
parents 8d2d0b6c3521
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
1 #!/bin/bash
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
2
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
3 tool_path=$(dirname $0)
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
4
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
5 filein=$1
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
6 fileout_label=$2
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
7 fileout=$3
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
8 filelog=$4
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
9 export=$5
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
10 frequency=$6
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
11 max_freq=$7
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
12 allow_missing=$8
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
13 nb_alleles_min=$9
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
14 nb_alleles_max=${10}
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
15 type=${11}
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
16 bound_start=${12}
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
17 bound_end=${13}
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
18
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
19
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
20 if [ "${14}" != "None" ]
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
21 then samples="--samples ${14}"
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
22 fi
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
23
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
24 if [ "${15}" != "None" ]
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
25 then chromosomes="--chromosomes ${15}"
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
26 fi
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
27
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
28 if [ "$bound_start" -gt "$bound_end" ]
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
29 then tmp=$bound_start ; bound_start=$bound_end ; bound_end=$tmp ; echo "Warning : Lower bound must be lower than greater bound!" >&2
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
30 fi
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
31
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
32 if [ "$nb_alleles_min" -gt "$nb_alleles_max" ]
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
33 then tmp=$nb_alleles_min ; nb_alleles_min=$nb_alleles_max ; nb_alleles_max=$tmp ; echo "Warning : Minimum number of alleles must be lower than maximum number of allele!" >&2
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
34 fi
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
35
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
36 perl $tool_path/VCFToolsFilter.pl --input $filein --out $fileout_label --export $export --frequency $frequency --max_freq $max_freq --allow_missing $allow_missing --nb_alleles $nb_alleles_min','$nb_alleles_max --type $type --bounds $bound_start','$bound_end $samples $chromosomes
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
37
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
38 if [ "$export" = "VCF" ]
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
39 then cp $fileout_label.recode.vcf $fileout ; rm $fileout_label.recode.vcf
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
40 elif [ "$export" = "freq" ]
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
41 then cp $fileout_label.frq $fileout ; rm $fileout_label.frq
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
42 else cp $fileout_label.ped $fileout; cp $fileout_label.map ${16} ; rm $fileout_label.ped $fileout_label.map
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
43 fi
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
44
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
45 cp vcftools.log $filelog
8d2d0b6c3521 Uploaded
dereeper
parents:
diff changeset
46 rm vcftools.log