Skip to content

Commit

Permalink
Refactor "to_bel" to "bel"
Browse files Browse the repository at this point in the history
  • Loading branch information
ddomingof committed Oct 8, 2018
1 parent 79ae0d0 commit 3b516f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Installation |pypi_version| |python_versions| |pypi_license|
How to use
----------

Each database has three main commands: "download", "to_bel", and "summarize":
Each database has three main commands: "download", "bel", and "summarize":

1. **Download content**

Expand All @@ -48,11 +48,11 @@ running the command ('database' can be either KEGG, Reactome, or WikiPathways):
Once the raw files are downloaded, you can run the following to command to generate BELGraphs that will be exported
as Python pickles files for further analysis. Furthermore, the conversion to BEL can be tuned differently for each
database by using specific commands. For example, KEGG parameters are shown when running
`python3 -m pathme kegg to_bel --help`.
`python3 -m pathme kegg bel --help`.

.. code-block:: python
python3 -m pathme 'database' to_bel
python3 -m pathme 'database' bel
2. **Summarize**

Expand All @@ -75,7 +75,7 @@ in the exporting command. Example:

.. code-block:: python
python3 -m pathme kegg to_bel --flatten=True
python3 -m pathme kegg bel --flatten=True
References
Expand Down
8 changes: 3 additions & 5 deletions src/pathme/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def download(connection):
@kegg.command()
@click.option('-f', '--flatten', is_flag=False)
@click.option('-e', '--export-folder', default=KEGG_BEL, show_default=True)
def to_bel(flatten, export_folder):
def bel(flatten, export_folder):
"""Convert KEGG to BEL."""
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(name)s - %(message)s")
log.setLevel(logging.INFO)
Expand Down Expand Up @@ -129,7 +129,7 @@ def download():
@click.option('-c', '--connection', help="Defaults to {}".format(DEFAULT_CACHE_CONNECTION))
@click.option('-d', '--debug', is_flag=True, default=False, help='Debug mode')
@click.option('-x', '--only-canonical', default=True, help='Parse only canonical pathways')
def to_bel(connection, debug, only_canonical):
def bel(connection, debug, only_canonical):
"""Convert WikiPathways to BEL."""
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s - %(levelname)s - %(name)s - %(message)s")

Expand Down Expand Up @@ -223,7 +223,7 @@ def download():

@reactome.command()
@click.option('-v', '--verbose', is_flag=True)
def to_bel(verbose):
def bel(verbose):
"""Convert Reactome to BEL."""
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s - %(levelname)s - %(name)s - %(message)s")
if verbose:
Expand All @@ -236,8 +236,6 @@ def to_bel(verbose):

resource_file = os.path.join(REACTOME_FILES, 'Homo_sapiens.owl')

# TODO: Fix

reactome_to_bel(resource_file, hgnc_manager)

log.info('Reactome exported in %.2f seconds', time.time() - t)
Expand Down

0 comments on commit 3b516f0

Please sign in to comment.