Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

The Java client provides an API to the whole OpenCGA RESTful layer. We will here only focus on those methods which are of most interest for HGVA users.

Getting the Java client code

As previously said, the Java client code is distributed together with the rest of the OpenCGA code

The OpenCGA code can be cloned in your machine by executing in your terminal:

$ 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 code, follow the instructions at the How to Build section of the OpenCGA repository:

https://github.com/opencb/opencga

That will generate the .jar containing the Java client library. If you are using Maven as a build and dependency manager you shall find the client .jar file at:

$ ll opencga/build/libs/opencga-client-1.0.0-rc3.jar 
-rw-r--r-- 1 user user 40K Jan  4 17:34 opencga/build/libs/opencga-client-1.0.0-rc3.jar
$ ll ~/.m2/repository/org/opencb/opencga/opencga-client/1.0.0-rc3/opencga-client-1.0.0-rc3.jar 
-rw-r--r-- 1 user user 40K Jan  4 17:34 /home/user/.m2/repository/org/opencb/opencga/opencga-client/1.0.0-rc3/opencga-client-1.0.0-rc3.jar

Getting information about genomic variants

Getting variant data from a given study:

http://bioinfodev.hpc.cam.ac.uk/hgva-1.0/webservices/rest/v1/analysis/variant/query?studies={project}:{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:

http://bioinfodev.hpc.cam.ac.uk/hgva-1.0/webservices/rest/v1/analysis/variant/query?gene=TTN&studies=GONL&limit=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:

http://bioinfodev.hpc.cam.ac.uk/hgva-1.0/webservices/rest/v1/studies/reference_grch37:1kG_phase3/summary

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.

http://bioinfodev.hpc.cam.ac.uk/hgva-1.0/webservices/rest/v1/studies/reference_grch37:1kG_phase3/samples

Getting information about samples

Get all metadata for a particular sample:

http://bioinfodev.hpc.cam.ac.uk/hgva-1.0/webservices/rest/v1/samples/{sample}/info?study={project}:{study}

For example, get all metadata for sample HG00096 of the 1kG_phase3 study which is framed within the reference_grch37 project:

http://bioinfodev.hpc.cam.ac.uk/hgva-1.0/webservices/rest/v1/samples/HG00096/info?study=reference_grch37:1kG_phase3

Getting information about cohorts

Getting all samples metadata in a given cohort:

http://bioinfodev.hpc.cam.ac.uk/hgva-1.0/webservices/rest/v1/cohorts/{cohort}/samples?study={project}:{study}

For example, get all samples metadata for cohort GBR from study 1kG_phase3 which is framed within project reference_grch37:

http://bioinfodev.hpc.cam.ac.uk/hgva-1.0/webservices/rest/v1/cohorts/GBR/samples?study=reference_grch37:1kG_phase3

Table of Contents:


  • No labels