Main tasks#

We can run the main tasks that OpenVariant offers as a Python package, also, with a shell command. In Introduction section you can check which are the different commands and their options.

In the following examples we will see a little snip on these tasks.


Cat command#

A simple case of the command:

[1] - 
%%bash
openvar cat ../datasets/sample2
ACAP3   1p36.33 MESO
ACTRT2  1p36.32 MESO
AGRN    1p36.33 MESO
ANKRD65 1p36.33 MESO
ATAD3A  1p36.33 MESO
ATAD3B  1p36.33 MESO
ATAD3C  1p36.33 MESO
AURKAIP1        1p36.33 MESO
B3GALT6 1p36.33 MESO
ACAP3   1p36.33 ACC
ACTRT2  1p36.32 ACC
AGRN    1p36.33 ACC
ANKRD65 1p36.33 ACC
ATAD3A  1p36.33 ACC
ATAD3B  1p36.33 ACC
ATAD3C  1p36.33 ACC
AURKAIP1        1p36.33 ACC
B3GALT6 1p36.33 ACC

Using it with some flags:

[2] - 
%%bash
openvar cat ../datasets/sample2 --output ./output_cat_cmd.tsv --header

Count command#

A simple case of the command:

[3] - 
%%bash
openvar count ../datasets/sample2 -q
TOTAL   18

Using it with some flags:

[4] - 
%%bash
openvar count ../datasets/sample2 --group_by "SYMBOL" --cores 4 -q
ACAP3   2
ACTRT2  2
AGRN    2
ANKRD65 2
ATAD3A  2
ATAD3B  2
ATAD3C  2
AURKAIP1        2
B3GALT6 2
TOTAL   18
[5] - 
%%bash
openvar count ../datasets/sample2 --group_by "SYMBOL" --where "CANCER == 'ACC'" --cores 4 -q
ACAP3   1
ACTRT2  1
AGRN    1
ANKRD65 1
ATAD3A  1
ATAD3B  1
ATAD3C  1
AURKAIP1        1
B3GALT6 1
TOTAL   9

Group by command#

A simple case of the command:

[6] - 
%%bash
openvar groupby ../datasets/sample2 -g "CANCER" --show --header -q
SYMBOL  CYTOBAND        CANCER
ACC     ACAP3   1p36.33 ACC
ACC     ACTRT2  1p36.32 ACC
ACC     AGRN    1p36.33 ACC
ACC     ANKRD65 1p36.33 ACC
ACC     ATAD3A  1p36.33 ACC
ACC     ATAD3B  1p36.33 ACC
ACC     ATAD3C  1p36.33 ACC
ACC     AURKAIP1        1p36.33 ACC
ACC     B3GALT6 1p36.33 ACC
MESO    SYMBOL  CYTOBAND        CANCER
MESO    ACAP3   1p36.33 MESO
MESO    ACTRT2  1p36.32 MESO
MESO    AGRN    1p36.33 MESO
MESO    ANKRD65 1p36.33 MESO
MESO    ATAD3A  1p36.33 MESO
MESO    ATAD3B  1p36.33 MESO
MESO    ATAD3C  1p36.33 MESO
MESO    AURKAIP1        1p36.33 MESO
MESO    B3GALT6 1p36.33 MESO

Using it with some flags:

[7] - 
%%bash
openvar groupby ../datasets/sample2 -g "CANCER" --where "SYMBOL == 'ATAD3C'" --cores 4 --show -q
MESO    ATAD3C  1p36.33 MESO
ACC     ATAD3C  1p36.33 ACC
[8] - 
%%bash
openvar groupby ../datasets/sample2 -g "CANCER" --script  "grep -E -i '^(B3|ATA)'" --show --cores 4 -q
ACC     ATAD3A  1p36.33 ACC
ACC     ATAD3B  1p36.33 ACC
ACC     ATAD3C  1p36.33 ACC
ACC     B3GALT6 1p36.33 ACC
MESO    ATAD3A  1p36.33 MESO
MESO    ATAD3B  1p36.33 MESO
MESO    ATAD3C  1p36.33 MESO
MESO    B3GALT6 1p36.33 MESO

Plugin command#

Plugin is slightly different than the others commands.

On this one we have only one single action: create. The plugin will use the environment variable OPENVAR_PLUGIN directory where to store new plugins.

by default:

OPENVAR_PLUGIN=/home/user/.local/share/openvariant

default directory can be changed by exporting a new path to OPENVAR_PLUGIN variable.

i.e.

export OPENVAR_PLUGIN=/my/plugin/path/
[ ] - 
%%bash
openvar plugin create --name add_date