-
Notifications
You must be signed in to change notification settings - Fork 98
Javascript client
The javascript client that can query Opencga webservices can be found in the jsorolla repository (https://github.com/opencb/jsorolla) in the next-v2.0.0 branch in https://github.com/opencb/jsorolla/tree/next-v2.0.0/src/lib/clients.
An example of how to start using opencga client can be found here.
Opencga client is divided into two separate classes OpenCGAClient and OpenCGAClientConfig. OpenCGAClient receives an instance of OpenCGAClientConfig in order to initialize everything. After that, doing queries is really easy:
`
opencgaClientConfig = new OpenCGAClientConfig(host, version); opencgaClient = new OpenCGAClient(opencgaClientConfig); `
Query users opencgaClient.users() will return the [https://github.com/opencb/jsorolla/blob/next- v2.0.0/src/lib/clients/opencga-client.js#L244](user client) containing the following methods:
- create
- login
- logout
- changeEmail
- update
- ...
In order to login, the command line to be run will be something like:
opencgaClient.users().login(userId, password);
All the methods of the OpenCGAClient will return a promise (see https://developers.google.com/web/fundamentals/getting-started/primers/promises). Basically, the way to work with this will be something like:
opencgaClient.users().login(userId, password).then(function(response) { console.log(response); }).catch(function(response) { console.log("Error response:" + response); });
OpenCGA is an open source project and it is freely available.
General
- Home
- Architecture
- Data Models
- RESTful Web Services
- Configuration
- Download and Installation
- Tutorials
OpenCGA Catalog
OpenCGA Storage
About