-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
54 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ dependencies = [ | |
"numpy", | ||
"pandas", | ||
"pyarrow>=1.0", | ||
"click>=7", | ||
] | ||
|
||
[project.urls] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import click | ||
|
||
from ..version import __version__ | ||
|
||
CONTEXT_SETTINGS = {"help_option_names": ["-h", "--help"]} | ||
|
||
|
||
class UnsortedGroup(click.Group): | ||
"""A click Group that lists commands in the order they were added.""" | ||
|
||
def list_commands(self, ctx): | ||
return list(self.commands) | ||
|
||
|
||
@click.version_option(__version__, "-V", "--version") | ||
@click.group(context_settings=CONTEXT_SETTINGS, cls=UnsortedGroup) | ||
def cli(): | ||
""" | ||
Type -h or --help after any subcommand for more information. | ||
""" | ||
|
||
|
||
# Load and register cli subcommands | ||
from . import ( # noqa: E402,F401 | ||
dump, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import click | ||
|
||
from .. import api | ||
from . import cli | ||
|
||
|
||
@cli.command() | ||
@click.argument("momics", metavar="MOMICS_PATH") | ||
@click.option( | ||
"--table", | ||
"-t", | ||
help="Which table to dump.", | ||
type=click.Choice(["chroms", "tracks"]), | ||
default="chroms", | ||
show_default=True, | ||
) | ||
def dump(momics, table): | ||
if table == "tracks": | ||
print(api.Momics(momics).tracks()) | ||
if table == "chroms": | ||
print(api.Momics(momics).chroms()) |
File renamed without changes.