|
30 | 30 | from .imputation.imputegl.networkx_graph import Graph
|
31 | 31 | import os
|
32 | 32 |
|
33 |
| -def graph_freqs(conf_file = "", for_em = False, em_pop=None ): |
| 33 | + |
| 34 | +def graph_freqs(conf_file="", for_em=False, em_pop=None): |
34 | 35 | if conf_file == "":
|
35 |
| - conf_file = os.path.dirname(os.path.realpath(__file__)) + '/conf/minimal-configuration.json' |
| 36 | + conf_file = ( |
| 37 | + os.path.dirname(os.path.realpath(__file__)) |
| 38 | + + "/conf/minimal-configuration.json" |
| 39 | + ) |
36 | 40 |
|
| 41 | + generate_neo4j_multi_hpf.generate_graph( |
| 42 | + config_file=conf_file, em_pop=em_pop, em=for_em |
| 43 | + ) |
37 | 44 |
|
38 |
| - generate_neo4j_multi_hpf.generate_graph(config_file=conf_file, em_pop=em_pop, |
39 |
| - em=for_em) |
40 | 45 |
|
41 |
| -def impute(conf_file = ""): |
| 46 | +def impute(conf_file=""): |
42 | 47 | project_dir_in_file, project_dir_graph = "", ""
|
43 | 48 | if conf_file == "":
|
44 |
| - conf_file = os.path.dirname(os.path.realpath(__file__)) + '/conf/minimal-configuration.json' |
45 |
| - project_dir_graph = os.path.dirname(os.path.realpath(__file__)) + '/imputation/graph_generation/' |
46 |
| - project_dir_in_file = os.path.dirname(os.path.realpath(__file__)) + '/' |
| 49 | + conf_file = ( |
| 50 | + os.path.dirname(os.path.realpath(__file__)) |
| 51 | + + "/conf/minimal-configuration.json" |
| 52 | + ) |
| 53 | + project_dir_graph = ( |
| 54 | + os.path.dirname(os.path.realpath(__file__)) |
| 55 | + + "/imputation/graph_generation/" |
| 56 | + ) |
| 57 | + project_dir_in_file = os.path.dirname(os.path.realpath(__file__)) + "/" |
47 | 58 | runfile.run_impute(conf_file, project_dir_graph, project_dir_in_file)
|
48 | 59 |
|
49 |
| -def impute_instance(config, graph, count_by_prob= None): |
| 60 | + |
| 61 | +def impute_instance(config, graph, count_by_prob=None): |
50 | 62 | imputation = Imputation(graph, config, count_by_prob)
|
51 | 63 | return imputation
|
52 | 64 |
|
| 65 | + |
53 | 66 | def graph_instance(config):
|
54 | 67 | graph = Graph(config)
|
55 |
| - graph.build_graph(config["node_file"], config["top_links_file"], config["edges_file"]) |
| 68 | + graph.build_graph( |
| 69 | + config["node_file"], config["top_links_file"], config["edges_file"] |
| 70 | + ) |
56 | 71 | return graph
|
57 |
| - |
58 |
| - |
|
0 commit comments