Skip to content

Commit

Permalink
Update cli.py
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
cthoyt committed Apr 1, 2020
1 parent 2eebfd5 commit ebf1126
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/pathme/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

import click
import networkx as nx
from pybel import to_pickle
from pybel.struct.mutation import collapse_all_variants, collapse_to_genes, remove_isolated_list_abundances
from pybel.struct.summary import count_functions

import pathme.kegg.cli
import pathme.reactome.cli
import pathme.wikipathways.cli
from pybel import to_pickle
from pybel.struct.mutation import collapse_all_variants, collapse_to_genes, remove_isolated_list_abundances
from pybel.struct.summary import count_functions
from .constants import CX_DIR, KEGG_BEL, PPI_DIR, REACTOME_BEL, SPIA_DIR, UNIVERSE_DIR, WIKIPATHWAYS_BEL
from .export_utils import export_helper, get_universe_graph, iterate_universe_graphs

Expand Down Expand Up @@ -57,8 +57,8 @@ def export():
show_default=True,
)

no_flatten = click.option('--no-flatten', is_flag=True, help='Do not flatten complex/reactions nodes')
no_normalize_names = click.option('--no-normalize-names', is_flag=True, help='Do not normalize names')
no_flatten_option = click.option('--no-flatten', is_flag=True, help='Do not flatten complex/reactions nodes')
no_normalize_names_option = click.option('--no-normalize-names', is_flag=True, help='Do not normalize names')


@export.command()
Expand Down Expand Up @@ -99,8 +99,8 @@ def ppi(kegg_path, reactome_path, wikipathways_path, output):
@reactome_path_option
@wikipathways_path_option
@click.option('-o', '--output', help='Output directory', default=CX_DIR, show_default=True)
@no_flatten
@no_normalize_names
@no_flatten_option
@no_normalize_names_option
def cx(kegg_path, reactome_path, wikipathways_path, output, no_flatten, no_normalize_names):
"""Export BEL Pickles to CX."""
try:
Expand All @@ -111,11 +111,11 @@ def cx(kegg_path, reactome_path, wikipathways_path, output, no_flatten, no_norma

click.echo(f'Results will be exported to {output}')
for source, path, graph in iterate_universe_graphs(
kegg_path=kegg_path,
reactome_path=reactome_path,
wikipathways_path=wikipathways_path,
flatten=(not no_flatten),
normalize_names=(not no_normalize_names),
kegg_path=kegg_path,
reactome_path=reactome_path,
wikipathways_path=wikipathways_path,
flatten=(not no_flatten),
normalize_names=(not no_normalize_names),
):
with open(os.path.join(output, f"{path.strip('.pickle')}.cx.json"), 'w') as file:
to_cx_file(graph, file)
Expand All @@ -126,8 +126,8 @@ def cx(kegg_path, reactome_path, wikipathways_path, output, no_flatten, no_norma
@reactome_path_option
@wikipathways_path_option
@click.option('-o', '--output', help='Output directory', default=UNIVERSE_DIR, show_default=True)
@no_flatten
@no_normalize_names
@no_flatten_option
@no_normalize_names_option
def universe(kegg_path, reactome_path, wikipathways_path, output, no_flatten, no_normalize_names):
"""Export harmonized PathMe universe."""
logging.basicConfig(level=logging.info, format="%(asctime)s - %(levelname)s - %(name)s - %(message)s")
Expand Down

0 comments on commit ebf1126

Please sign in to comment.