Command-line interface#
metakb#
metakb [OPTIONS] COMMAND [ARGS]...
Manage MetaKB data.
To reset the graph, prepare normalizers if unavailable, invalidate cached data, then load MetaKB data:
$ metakb clear-db
$ metakb check-normalizers || metakb load-normalizers
$ metakb update --refresh_source_caches
Other commands are available for more granular control over the update process.
Options
- --version#
Show the version and exit.
check-normalizers#
metakb check-normalizers [OPTIONS] [[gene|disease|therapy]]...
Perform basic checks on DB health and table population for normalizers. Exits with status code 1 if >= 1 DB schema is uninitialized or critical tables appear empty for one or more of the concept normalizer services.
$ metakb check-normalizers
$ echo $?
1 # indicates failure
To select specific normalizer services, provide one or more arguments:
$ metakb check-normalizers therapy disease
Specific failures and descriptions are logged at level ERROR.
Options
- -u, --normalizer_db_url <normalizer_db_url>#
URL endpoint of normalizer database. If not given, the individual normalizers will revert to their own defaults.
Arguments
- [[gene|disease|therapy]]...#
Optional argument(s)
clear-db#
metakb clear-db [OPTIONS]
Clear graph DB.
$ metakb clear-db
Note that the Neo4j database URL, username, and password can either be set by a CLI
options, or by the environment variable METAKB_DB_URL. For example:
$ metakb clear-db --db_url=bolt://username:password@localhost:7687
Options
- -u, --db_url <db_url>#
Connection string for the application Neo4j database.
harvest#
metakb harvest [OPTIONS] [[civic|moa|cbioportal|fda_poda|mci]]...
Perform harvest.
If provided SOURCE(s), only perform harvest on those sources:
$ metakb harvest civic
Otherwise, harvest all known sources.
Options
- -r, --refresh_source_caches#
True if source caches (e.g. CIViCPy) should be updated prior to data regeneration. Note this will take several minutes. False if local cache should be used
Arguments
- [[civic|moa|cbioportal|fda_poda|mci]]...#
Optional argument(s)
load#
metakb load [OPTIONS] COMMAND [ARGS]...
Load transformed source data into the MetaKB database.
all#
metakb load all [OPTIONS]
Load the latest transformed data artifacts for each source into the MetaKB database.
$ metakb load all
Note that the Neo4j database URL, username, and password can either be set by a CLI
options, or by the environment variable METAKB_DB_URL. For example:
$ metakb load all --db_url=bolt://username:password@localhost:7687
Options
- -u, --db_url <db_url>#
Connection string for the application Neo4j database.
- -q, --quiet#
Suppress non-error output.
- -y, --yes#
Skip confirmation prompts.
files#
metakb load files [OPTIONS] [CDM_FILE]...
Load specific transformed data artifacts into the MetaKB database.
$ metakb load files path/to/file1.json path/to/file2.json
Note that the Neo4j database URL, username, and password can either be set by a CLI
options, or by the environment variable METAKB_DB_URL. For example:
$ metakb load files --db_url=bolt://username:password@localhost:7687 myfile.json
Options
- -u, --db_url <db_url>#
Connection string for the application Neo4j database.
- -q, --quiet#
Suppress non-error output.
- -y, --yes#
Skip confirmation prompts.
Arguments
- [CDM_FILE]...#
Optional argument(s)
sources#
metakb load sources [OPTIONS] [[civic|moa|cbioportal|fda_poda|mci]]...
Load latest transformed artifacts for the named source(s) into the MetaKB database.
$ metakb load sources moa civic
Note that the Neo4j database URL, username, and password can either be set by a CLI
options, or by the environment variable METAKB_DB_URL. For example:
$ metakb load sources --db_url=bolt://username:password@localhost:7687 civic
Options
- -u, --db_url <db_url>#
Connection string for the application Neo4j database.
- -q, --quiet#
Suppress non-error output.
- -y, --yes#
Skip confirmation prompts.
Arguments
- [[civic|moa|cbioportal|fda_poda|mci]]...#
Optional argument(s)
snapshot#
metakb snapshot [OPTIONS] COMMAND [ARGS]...
Create and manage snapshots of MetaKB data.
create#
metakb snapshot create [OPTIONS]
Create a MetaKB snapshot
Options
- -u, --db_url <db_url>#
Connection string for the application Neo4j database.
- -f, --file <file>#
Destination path for the snapshot JSON file.
- -q, --quiet#
Suppress non-error output.
transform#
metakb transform [OPTIONS] [[civic|moa|cbioportal|fda_poda|mci]]...
Transform MetaKB SOURCE(s).
If provided names of SOURCEs, perform transform on those sources only:
$ metakb transform civic
Otherwise, transform all available sources.
Options
- -n, --normalizer_db_url <normalizer_db_url>#
URL endpoint of normalizer database. If not given, the individual normalizers will revert to their own defaults.
Arguments
- [[civic|moa|cbioportal|fda_poda|mci]]...#
Optional argument(s)
transform-file#
metakb transform-file [OPTIONS] HARVEST_FILE
{civic|moa|cbioportal|fda_poda|mci}
Transform an individual harvested data file. Source name must be specified as well.
$ metakb transform-file path/to/file.json civic
Options
- -n, --normalizer_db_url <normalizer_db_url>#
URL endpoint of normalizer database. If not given, the individual normalizers will revert to their own defaults.
Arguments
- HARVEST_FILE#
Required argument
- SOURCE_NAME#
Required argument
update#
metakb update [OPTIONS] [[civic|moa|cbioportal|fda_poda|mci]]...
Execute data harvest and transformation from resources and upload to graph datastore.
To harvest and transform source data into fresh CDM files, and then load them to the graph:
$ metakb update
Note that the Neo4j database URL, username, and password can either be set by a CLI
options, or by the environment variable METAKB_DB_URL. For example:
$ metakb update --db_url=bolt://username:password@localhost:7687
Provide one or more SOURCE arguments to limit data harvest and transformation to just those source(s):
$ metakb update moa
Options
- -u, --db_url <db_url>#
Connection string for the application Neo4j database.
- -n, --normalizer_db_url <normalizer_db_url>#
URL endpoint of normalizer database. If not given, the individual normalizers will revert to their own defaults.
- -r, --refresh_source_caches#
True if source caches (e.g. CIViCPy) should be updated prior to data regeneration. Note this will take several minutes. False if local cache should be used
- -q, --quiet#
Suppress non-error output.
- -y, --yes#
Skip confirmation prompts.
Arguments
- [[civic|moa|cbioportal|fda_poda|mci]]...#
Optional argument(s)
update-normalizers#
metakb update-normalizers [OPTIONS] [[gene|disease|therapy]]...
Reload gene, disease, and therapy normalizer data.
Forces delete of each prior to fetching and loading new data. If errors are encountered, attempts to complete updates of other normalizers before exiting.
Providing no arguments will attempt to update all three:
$ metakb update-normalizers
Providing individual normalizer names as arguments will update only those normalizers:
$ metakb update-normalizers disease therapy
Options
- -n, --normalizer_db_url <normalizer_db_url>#
URL endpoint of normalizer database. If not given, the individual normalizers will revert to their own defaults.
Arguments
- [[gene|disease|therapy]]...#
Optional argument(s)