Isabl Docs
Search…
Other CLI commands
☄️Isabl comes with a bunch of built-in commands to run from the terminal.

Getting Super Powers

The python package of isabl-cli comes with a lot of useful functions that allows you to achieve mainly 3 type of needs:
    1.
    Create and Execute analyses (See Running Applications)
    2.
    Retrieve information (See Retrieving Data)
    3.
    and, Import and manage files into your workspace (See Importing Data)
1
$ isabl --help
2
3
Usage: isabl [OPTIONS] COMMAND [ARGS]...
4
5
Run Isabl command line tools.
6
7
Options:
8
--version Show the version and exit.
9
--help Show this message and exit.
10
11
Commands:
12
apps-grch37 GRCh37 applications.
13
apps-grcm38 GRCm38 applications.
14
get-bams Get storage directories, use `pattern` to
15
match...
16
get-bed Get a BED file for a given Sequencing...
17
get-count Get count of database instances.
18
get-data Get file paths for experiments raw data.
19
get-metadata Retrieve metadata for multiple instances.
20
get-outdirs Get analyses outdirs, use `pattern` to match...
21
get-paths Get storage directories, use `pattern` to
22
match...
23
get-reference Retrieve reference data from assemblies...
24
get-results Get analyses results.
25
import-bedfiles Register targets and baits BED files in a...
26
import-data Find and import experiments data from many...
27
import-reference-data Register reference data for assemblies...
28
import-reference-genome Register an assembly reference genome.
29
login Login with isabl credentials.
30
merge-individual-analyses Merge analyses by individual.
31
merge-project-analyses Merge analyses by project.
32
patch-results Update the results field of many analyses.
33
process-finished Process and update finished analyses.
34
rerun-signals Rerun failed signals.
35
run-failed-analyses Command to run failed analyses in batch.
36
run-signals Run any arbitrary signal on analyses or...
37
run-web-signals Run signals triggered from the frontend.
38
Copied!
Some of these commands are only available for the admin user, like:
    To manage files and data (See Importing Data):import-data, import-bedfiles, import-reference-data, import-reference-genome
    To change permissions of finished analyses: process-finished
    To update the linked results of completed analyses: patch-results

Create your custom CLI Commands

You can customize your available commands, by extending the isabl-cli. The following are examples of cases where you want to create commands that execute more than one app at the same time, or create a method for a common metadata query:
my_commands/cli.py
1
import datetime
2
import click
3
from isabl_cli import options
4
from isabl_cli import commands
5
from my_apps import apps
6
7
8
@click.command()
9
@options.PAIRS
10
@options.PAIRS_FROM_FILE
11
@options.SKIP
12
@options.COMMIT
13
@options.FORCE
14
@options.RESTART
15
@options.QUIET
16
def triple_caller(commit, force, quiet, restart, skip, pairs, pairs_from_file):
17
"""
18
Command to run THE 3-CALLER pipeline.
19
"""
20
for pipe in [
21
apps.CallerOneGRCh37,
22
apps.CallerTwoGRCh37,
23
apps.CallerThreeGRCh37,
24
]:
25
pipe().run(
26
tuples=pairs + pairs_from_file,
27
commit=commit,
28
force=force,
29
restart=restart,
30
verbose=not quiet,
31
run_args=dict(skip=skip),
32
)
33
34
35
@click.command()
36
@click.pass_context
37
def get_succeded_kids_analyses(ctx):
38
"""
39
Command to print information from all Succeded Analyses executed on
40
Pediatric Children (age <= 18) of MSK Kids.
41
"""
42
current_year = datetime.datetime.now().year
43
filters = dict(
44
status="SUCCEEDED",
45
targets__center__name="MSK Kids",
46
targets__sample__individual__birth_year__gte=(current_year - 18),
47
)
48
fields = [
49
"targets__sample__individual__system_id",
50
"pk",
51
"status",
52
"application__name",
53
"application__version",
54
]
55
ctx.invoke(
56
commands.get_metadata,
57
identifiers=None,
58
endpoint="analyses",
59
field=[i.split("__") for i in fields],
60
filters=filters,
61
no_headers=False,
62
json_=False,
63
use_fx=False,
64
)
65
Copied!
Then you can add the commands to your CLI Settings (Learn how to customize your cli):
1
CUSTOM_COMMANDS = [
2
my_commands.cli.triple_caller,
3
my_commands.cli.get_succeded_kids_analyses
4
]
Copied!
Now your custom commands will be available:
1
$ isabl --help
2
3
Usage: isabl [OPTIONS] COMMAND [ARGS]...
4
5
Run Isabl command line tools.
6
7
Options:
8
--version Show the version and exit.
9
--help Show this message and exit.
10
11
Commands:
12
13
...
14
15
triple_caller Command to run THE 3-CALLER pipeline.
16
get-succeded-kids-analyses Command to print metadata of all Succeded...
Copied!
Last modified 1yr ago