-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest.py
More file actions
54 lines (39 loc) · 1.18 KB
/
test.py
File metadata and controls
54 lines (39 loc) · 1.18 KB
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
#!/usr/bin/python
import os.path
import sys
import optparse
import vcfClass
from vcfClass import *
import tools
from tools import *
if __name__ == "__main__":
main()
def main():
# Parse the command line options
usage = "Usage: vcfPytools.py test [options]"
parser = optparse.OptionParser(usage = usage)
parser.add_option("-i", "--in",
action="store", type="string",
dest="vcfFile", help="input vcf file")
parser.add_option("-o", "--out",
action="store", type="string",
dest="output", help="output vcf file")
(options, args) = parser.parse_args()
# Check that a single vcf file is given.
if options.vcfFile == None:
parser.print_help()
print >> sys.stderr, "\nAt least one vcf file (--in, -i) is required for performing intersection."
exit(1)
outputFile, writeOut = setOutput(options.output)
v = vcf() # Define vcf object.
# Open the vcf files.
v.openVcf(options.vcfFile)
# Read in the header information.
v.parseHeader(options.vcfFile, False)
# Perform testing.
while v.getRecord():
continue
# Close the vcf files.
v.closeVcf(options.vcfFile)
# End the program.
return 0