Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Installation
The CLI is distributed with the rest of the OpenCGA code. The OpenCGA code can be cloned in your machine by executing in your terminal:
Code Block | ||||
---|---|---|---|---|
| ||||
$ git clone https://github.com/opencb/opencga.git |
Alternatively, you can download tar.gz files with the code for the latest tags/releases of OpenCGA from:
https://github.com/opencb/opencga/releases
Once you have downloaded the CLI code has been downloaded a properly configured (please refer to the Command Line Interface (CLI) section for further information), it is ready for start querying HGVA. We will focus on those commands, subcommands and parameters of the CLI which are of more interest for HGVA users, giving examples of their use and pin pointing certain peculiarities of the parameters for HGVA. Data is hierarchically organised in Projects and Studies. Please, have a look at Datasets and Studies in order to understand how data is organized: Projects, Studies and Cohorts . For details on the query parameters, please refer to the Swagger documentation at:code, follow the instructions at the How to Build section of the OpenCGA repository:
https://github.com/opencb/opencga
The CLI interface is accessible through the opencga.sh script:
Code Block | ||||
---|---|---|---|---|
| ||||
$ cd opencga
opencga$ cd build
opencga/build$ cd bin
opencga/build/bin$ ./opencga.sh
Program: OpenCGA (OpenCB)
Version: 0.9.0-dev
Git commit: a1ab0decf97556241b446d23cc596ecb5a3f997c
Description: Big Data platform for processing and analysing NGS data
Usage: opencga.sh [-h|--help] [--version] <command> [options]
Commands:
users User commands
projects Project commands
studies Study commands
files Files commands
jobs Jobs commands
individuals Individuals commands
samples Samples commands
variables Variable set commands
cohorts Cohorts commands
tools Tools commands
panels Panels commands |
Configuration
As previously said, the CLI makes intensive use of the RESTful API. Thus, the only configuration detail needed for the CLI to work is a URL where the Web Services API is hosted. The configuration file client-configuration.yml is used for this purpose. You shall find a template of this file at the build/conf directory:
Code Block | ||||
---|---|---|---|---|
| ||||
$ ll opencga/build/conf/client-configuration.yml
-rw-r--r-- 1 fjlopez fjlopez 290 Oct 24 17:49 opencga/build/conf/client-configuration.yml |
Edit this file with any text editor and set the rest → host attribute to "http://bioinfodev.hpc.cam.ac.uk/hgva-1.0":
Code Block | ||
---|---|---|
| ||
--- ## number of seconds that session remain open sessionDuration: 12000 ## REST client configuration options rest: host: "http://bioinfodev.hpc.cam.ac.uk/hgva-1.0 |
"
batchQuerySize: 200
timeout: 10000
defaultLimit: 2000
## gRPC configuration options
grpc:
host: "localhost:9091" |
Examples
The CLI provides commands, subcommands and parameters to access its functionality. Commands of most interest for HGVA users are projects, studies and samples. Please, refer to the tutorial Using the Command Line for further information.
Getting information about genomic variants
Getting variant data from a given study:
An extensive list of filtering parameters allow great flexibility on the queries (check Swagger documentation link above). For example, get TTN variants from the Genome of the Netherlands study, which is framed within the reference_grch37 project. We will also limit the number of returned results to 3:
Getting information about projects
Getting all metadata from a particular project:
http://bioinfodev.hpc.cam.ac.uk/hgva-1.0/webservices/rest/v1/projects/{projects}/info
For example, getting all metadata for the reference_grch37 project:
http://bioinfodev.hpc.cam.ac.uk/hgva-1.0/webservices/rest/v1/projects/reference_grch37/info
Getting all metadata from all studies associated to a particular project:
http://bioinfodev.hpc.cam.ac.uk/hgva-1.0/webservices/rest/v1/projects/{projects}/studies
For example, getting all studies and their metadata for the cancer_grch37 project:
http://bioinfodev.hpc.cam.ac.uk/hgva-1.0/webservices/rest/v1/projects/cancer_grch37/studies
Getting information about studies
Get all available studies and their metadata. Please note, of special interest will be here the field alias which contains the study identifier to be used as an input whenever a study must be passed as a parameter:
http://bioinfodev.hpc.cam.ac.uk/hgva-1.0/webservices/rest/v1/studies/search
For example, getting all metadata for all available studies:
http://bioinfodev.hpc.cam.ac.uk/hgva-1.0/webservices/rest/v1/studies/search
Getting summary data from a particular study:
http://bioinfodev.hpc.cam.ac.uk/hgva-1.0/webservices/rest/v1/studies/{project}:{study}/summary
For example, getting summary data for study 1kG_phase3 which is framed within project reference_grch37:
Getting all available metadata for a particular study:
http://bioinfodev.hpc.cam.ac.uk/hgva-1.0/webservices/rest/v1/studies/{project}:{study}/info
For example, getting all metadata for study GONL which is framed within the project reference_grch37:
http://bioinfodev.hpc.cam.ac.uk/hgva-1.0/webservices/rest/v1/studies/reference_grch37:GONL/info
Getting all samples metadata for a given study:
http://bioinfodev.hpc.cam.ac.uk/hgva-1.0/webservices/rest/v1/studies/{project}:{study}/samples
For example, getting all samples metadata for study 1kG_phase3 which is framed within project reference_grch37. Please, note that not all studies contain samples data, e.g. GONL, ExAC, among others, only provide variant lists and aggregated frequencies, i.e. no sample genotypes.
Getting information about samples
Get all metadata for a particular sample:
For example, get all metadata for sample HG00096 of the 1kG_phase3 study which is framed within the reference_grch37 project:
Getting information about cohorts
Getting all samples metadata in a given cohort:
For example, get all samples metadata for cohort GBR from study 1kG_phase3 which is framed within project reference_grch37:
Table of Contents:
Table of Contents |
---|