forked from Ensembl/ensembl-vep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phaplo
55 lines (44 loc) · 1.56 KB
/
phaplo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
if [ "$1" == "-h" ]; then
echo "Usage: `basename $0` [my.vcf]"
exit 0
fi
#make sure there is an inputfile
if [ $# -eq 0 ]
then
echo "No arguments supplied"
echo "Use -h for info"
exit 1
fi
#grab the header
head -n 10000 $1 | grep "^#" >header
#grab the non header lines
grep -v "^#" $1 >variants
#split into chunks with 1000 lines
split --number=10 variants
#put the headers back on
cat xaa header > xaa.header &
cat xab header > xab.header &
cat xac header > xac.header &
cat xad header > xad.header &
cat xae header > xae.header &
cat xaf header > xaf.header &
cat xag header > xag.header &
cat xah header > xah.header &
cat xai header > xai.header &
cat xaj header > xaj.header &
wait
#run haplo
haplo -i xaa.header -o xaa.haplo.vcf --cache --dir /mnt/home/stephen/.vep/ &
haplo -i xab.header -o xab.haplo.vcf --cache --dir /mnt/home/stephen/.vep/ &
haplo -i xac.header -o xac.haplo.vcf --cache --dir /mnt/home/stephen/.vep/ &
haplo -i xad.header -o xad.haplo.vcf --cache --dir /mnt/home/stephen/.vep/ &
haplo -i xae.header -o xae.haplo.vcf --cache --dir /mnt/home/stephen/.vep/ &
haplo -i xaf.header -o xaf.haplo.vcf --cache --dir /mnt/home/stephen/.vep/ &
haplo -i xag.header -o xag.haplo.vcf --cache --dir /mnt/home/stephen/.vep/ &
haplo -i xah.header -o xah.haplo.vcf --cache --dir /mnt/home/stephen/.vep/ &
haplo -i xai.header -o xai.haplo.vcf --cache --dir /mnt/home/stephen/.vep/ &
haplo -i xaj.header -o xaj.haplo.vcf --cache --dir /mnt/home/stephen/.vep/ &
wait
vcf-concat xa*.haplo.vcf > $1.haplo.vcf
rm -f header variants xa*.haplo.vcf *.header