-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhet_multiple_vcf.py
More file actions
37 lines (26 loc) · 1.09 KB
/
het_multiple_vcf.py
File metadata and controls
37 lines (26 loc) · 1.09 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
import os
import sys
import time
# get starting time of program
program_start_time = time.time()
# check for correct number of arguments
if not len(sys.argv) == 2:
print("Bad Inputs. Command is: python Pipeline.py [FILE]")
exit()
current_path = "/vol/storage/ba/scripts/"
data_file = open(sys.argv[1])
# the format is: name, read download link, reference genome download link, new line
lines = data_file.readlines()
data_file.close()
names = []
number_of_lines = len(lines)
# get all the names and corresponding download links
for i in range(number_of_lines):
# name and remove newline character
if (i % 4 == 0):
names.append(lines[i][:-1])
for i in range(len(names)):
print("Now working on: " + names[i])
if not os.path.exists("/vol/storage/pipeline/" + names[i] + "/mito/" + names[i] + ".hetinfo"):
os.system("python " + current_path + "get_het_vcf.py /vol/storage/pipeline/" + names[i] + "/standard_vcf/output.vcf.gz -o /vol/storage/pipeline/" + names[i] + "/mito/" + " -n " + names[i])
print("Finished! It took " + str((time.time() - program_start_time) / 3600) + " hours to complete")