forked from fungs/mglex
/
mglex-cli
executable file
·39 lines (30 loc) · 1.39 KB
/
mglex-cli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env python3
# This file is subject to the terms and conditions of the GPLv3 (see file 'LICENSE' as part of this source code package)
u"""
This is the mglex command line interface which executes the sub-commands.
Usage:
mglex-cli [--version] [--help] <command> [<args>...]
-h, --help Show this screen
-v, --version Show version
Here are the commands to run:
train Train a model (set maximum-likelihood parameters)
classify Calculate likelihood of data under a model
buildmatrix Construct a responsibility matrix for grouped data
evaluate Evaluate classifications using a reference (true) responsibility matrix
significance Give a null model log-likelihood distribution and calculate p-values for unseen data
bincompare Compare bins by likelihood values
See 'mglex-cli <command> --help' for more information on a specific command.
"""
import sys
import importlib
import mglex.cli
__author__ = "code@fungs.de"
from mglex import __version__
if __name__ == "__main__":
from docopt import docopt
arguments = docopt(__doc__, version=__version__, options_first=True)
try:
command = importlib.import_module(".".join(("mglex", "cli", arguments["<command>"])))
command.main(arguments["<args>"])
except ImportError:
sys.stderr.write("Command '%s' does not exist.\n" % arguments["<command>"])