JavaScript
Example:
Fetching the first 10 variants of the Study of interest using a token
import {OpenCGAClient} from "./opencga-client.js";
const HOST = ""; // add your host
const STUDY = ""; // add your study of interest
const TOKEN = ""; // add a valid token
const client = new OpenCGAClient({
host: HOST,
version: "v2",
cookies: {active: false},
token: TOKEN
});
(async () => {
try {
const restResponse = await client.variants().query({study: STUDY, limit:10});
console.table(restResponse.getResults());
} catch (response) {
if (response instanceof RestResponse) {
console.error(response.getEvents())
} else {
console.error(response)
}
}
})();Fetching the first 10 variants of the Study of interest using OpenCGA credentials.
Last updated
Was this helpful?