comparison plink.sh @ 4:6d1122b57344 draft

Uploaded
author dereeper
date Thu, 02 Nov 2017 05:42:47 -0400
parents fe39a4677281
children
comparison
equal deleted inserted replaced
3:2bc9b3ee5eea 4:6d1122b57344
1 #!/bin/bash
2
3
4 tool_path=$(dirname $0)
5
6 filein=$1
7 fileout_label=$(date "+%Y%m%d%H%M%S")
8 fileout=$2
9 filelog=$3
10 frequency=$4
11 max_freq=$5
12 allow_missing=$6
13 type=${7}
14 bound_start=${8}
15 bound_end=${9}
16
17 cp -rf $filein input$$.vcf
18
19 if [ "${10}" != "None" ]
20 then samples="--samples ${10}"
21 fi
22
23 if [ "${11}" != "None" ]
24 then chromosomes="--chromosomes ${11}"
25 fi
26
27 if [ "$bound_start" -gt "$bound_end" ]
28 then tmp=$bound_start ; bound_start=$bound_end ; bound_end=$tmp ; echo "Warning : Lower bound must be lower than greater bound!" >&2
29 fi
30
31
32 export="VCF"
33
34 perl $tool_path/Plink.pl --input input$$.vcf --out $fileout_label --export $export --frequency $frequency --max_freq $max_freq --allow_missing $allow_missing --type $type --bounds $bound_start','$bound_end $samples $chromosomes
35
36
37 #echo ${16} >>$fileout_label.log
38 #echo ${15} >>$fileout_label.log
39 #echo ${17} >>$fileout_label.log
40 #echo ${18} >>$fileout_label.log
41
42 if [ "$export" = "VCF" ]
43 then cp $fileout_label.vcf $fileout ; rm $fileout_label.vcf
44 else cp $fileout_label.bed $fileout; cp $fileout_label.bed ${15} ; cp $fileout_label.bim ${18} ;rm $fileout_label.bed $fileout_label.fam $fileout_label.bim
45 fi
46
47 cp $fileout_label.log $filelog
48 rm $fileout_label.log
49