annotate plink.sh @ 4:6d1122b57344 draft

Uploaded
author dereeper
date Thu, 02 Nov 2017 05:42:47 -0400
parents fe39a4677281
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
1 #!/bin/bash
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
2
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
3
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
4 tool_path=$(dirname $0)
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
5
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
6 filein=$1
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
7 fileout_label=$(date "+%Y%m%d%H%M%S")
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
8 fileout=$2
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
9 filelog=$3
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
10 frequency=$4
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
11 max_freq=$5
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
12 allow_missing=$6
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
13 type=${7}
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
14 bound_start=${8}
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
15 bound_end=${9}
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
16
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
17 cp -rf $filein input$$.vcf
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
18
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
19 if [ "${10}" != "None" ]
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
20 then samples="--samples ${10}"
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
21 fi
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
22
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
23 if [ "${11}" != "None" ]
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
24 then chromosomes="--chromosomes ${11}"
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
25 fi
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
26
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
27 if [ "$bound_start" -gt "$bound_end" ]
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
28 then tmp=$bound_start ; bound_start=$bound_end ; bound_end=$tmp ; echo "Warning : Lower bound must be lower than greater bound!" >&2
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
29 fi
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
30
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
31
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
32 export="VCF"
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
33
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
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
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
35
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
36
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
37 #echo ${16} >>$fileout_label.log
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
38 #echo ${15} >>$fileout_label.log
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
39 #echo ${17} >>$fileout_label.log
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
40 #echo ${18} >>$fileout_label.log
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
41
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
42 if [ "$export" = "VCF" ]
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
43 then cp $fileout_label.vcf $fileout ; rm $fileout_label.vcf
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
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
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
45 fi
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
46
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
47 cp $fileout_label.log $filelog
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
48 rm $fileout_label.log
fe39a4677281 Uploaded
dereeper
parents:
diff changeset
49