-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathclean_test.py
executable file
·71 lines (64 loc) · 1.53 KB
/
clean_test.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env python
# Copyright 2018 John Lees and Nick Croucher
"""Clean test files"""
import os
import sys
import shutil
def deleteDir(dirname):
if os.path.isdir(dirname):
shutil.rmtree(dirname)
sys.stderr.write("Cleaning up tests\n")
dirty_files = [
"example_db.info.csv",
"example_external_clusters.csv",
"batch12_external_clusters.csv",
"example_lineage_scheme.pkl",
"lineage_creation_output.csv",
"lineage_querying_output.csv"
]
with open("references.txt", 'r') as ref_file:
for line in ref_file:
dirty_files.append(line.rstrip().split("\t")[1])
# clean up
outputDirs = [
"example_db",
"example_qc",
"example_dbscan",
"example_refine",
"example_threshold",
"example_lineages",
"example_use",
"example_query",
"example_single_query",
"example_query_stable",
"example_query_update",
"example_query_update_2",
"example_query_update_fast",
"example_lineage_query",
"example_viz",
"example_viz_subset",
"example_viz_query",
"example_lineage_viz",
"example_viz_query_lineages",
"example_mst",
"example_sparse_mst",
"example_mandrake",
"example_iterate",
"example_refs",
"example_api",
"batch1",
"batch2",
"batch3",
"batch12",
"batch123",
"batch123_viz",
"strain_1_lineage_db",
"strain_2_lineage_db",
"lineage_querying_output",
"example_network_qc"
]
for outDir in outputDirs:
deleteDir(outDir)
for ref in dirty_files:
if os.path.isfile(ref):
os.remove(ref)