-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVEPcaller.py
55 lines (33 loc) · 1.35 KB
/
VEPcaller.py
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
#!/usr/bin/env python
import os
import sys
import commands
import glob
def find_vep():
#locates the VEP executable
print 'Locating VEP installation...'
find_veploc = commands.getstatusoutput('find ~/ -name variant_effect_predictor.pl -print 2>/dev/null')
veploc = find_veploc[1]
print 'Done!'
return veploc
def vepcaller(filename, veploc):
#the port 3377 is for hg19
print 'Running VEP on %s...' % filename
noextension = filename[0:-4]
command = veploc + " --port 3337 --cache --refseq --symbol -i " + filename + " -o " + noextension + "_annotated.vcf"
os.system(command)
print 'Done!'
return
def main():
veploc = find_vep()
#grabs all of the monoallelic potential variant files, and potential rna-editing files
monoallelic_files = glob.glob('*_RNA-hom_WES-het.vcf')
RNA_editing_files = glob.glob('*_RNA-het_WES-hom.vcf')
full_merge = glob.glob('*_merged.vcf')
#annotates each file in the lists above
for monoallelic in monoallelic_files:
vepcaller(monoallelic, veploc)
for RNA_editing in RNA_editing_files:
vepcaller(RNA_editing, veploc)
if __name__ == "__main__":
main()