1515import pathme .kegg .cli
1616import pathme .reactome .cli
1717import pathme .wikipathways .cli
18- from .constants import CX_DIR , KEGG_BEL , REACTOME_BEL , SPIA_DIR , UNIVERSE_DIR , WIKIPATHWAYS_BEL
19- from .export_utils import get_universe_graph , iterate_universe_graphs , spia_export_helper
18+ from .constants import CX_DIR , KEGG_BEL , PPI_DIR , REACTOME_BEL , SPIA_DIR , UNIVERSE_DIR , WIKIPATHWAYS_BEL
19+ from .export_utils import export_helper , get_universe_graph , iterate_universe_graphs
2020
2121logger = logging .getLogger (__name__ )
2222
@@ -69,14 +69,31 @@ def export():
6969def spia (kegg_path , reactome_path , wikipathways_path , output ):
7070 """Export BEL Pickles to SPIA Excel."""
7171 click .echo (f'Results will be exported to { output } ' )
72- spia_export_helper (
72+ export_helper (
7373 kegg_path = kegg_path ,
7474 reactome_path = reactome_path ,
7575 wikipathways_path = wikipathways_path ,
7676 output = output ,
7777 )
7878
7979
80+ @export .command ()
81+ @kegg_path_option
82+ @reactome_path_option
83+ @wikipathways_path_option
84+ @click .option ('-o' , '--output' , help = 'Output directory' , default = PPI_DIR , show_default = True )
85+ def ppi (kegg_path , reactome_path , wikipathways_path , output ):
86+ """Export BEL Pickles to PPI-like tsv file."""
87+ click .echo (f'Results will be exported to { output } ' )
88+ export_helper (
89+ kegg_path = kegg_path ,
90+ reactome_path = reactome_path ,
91+ wikipathways_path = wikipathways_path ,
92+ output = output ,
93+ format = 'ppi' ,
94+ )
95+
96+
8097@export .command ()
8198@kegg_path_option
8299@reactome_path_option
@@ -94,11 +111,11 @@ def cx(kegg_path, reactome_path, wikipathways_path, output, no_flatten, no_norma
94111
95112 click .echo (f'Results will be exported to { output } ' )
96113 for source , path , graph in iterate_universe_graphs (
97- kegg_path = kegg_path ,
98- reactome_path = reactome_path ,
99- wikipathways_path = wikipathways_path ,
100- flatten = (not no_flatten ),
101- normalize_names = (not no_normalize_names ),
114+ kegg_path = kegg_path ,
115+ reactome_path = reactome_path ,
116+ wikipathways_path = wikipathways_path ,
117+ flatten = (not no_flatten ),
118+ normalize_names = (not no_normalize_names ),
102119 ):
103120 with open (os .path .join (output , f"{ path .strip ('.pickle' )} .cx.json" ), 'w' ) as file :
104121 to_cx_file (graph , file )
0 commit comments