Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TASK-5864 - Variant link route does not work #894

Merged
merged 16 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 8 additions & 25 deletions src/core/clients/opencga/opencga-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,8 @@ export class OpenCGAClient {
// check that a session exists
// TODO should we check the session has not expired?
if (_this._config.token) {
_this.users().info(_this._config.userId)
_this.users()
.info(_this._config.userId)
.then(async response => {
console.log("Creating session");
const session = {
Expand All @@ -370,7 +371,6 @@ export class OpenCGAClient {
session.server = {
host: _this._config.host,
version: _this._config.version,
// serverVersion: _this._config.serverVersion,
};
session.opencgaClient = _this;
const userConfig = await this.updateUserConfig("IVA", {
Expand All @@ -392,7 +392,6 @@ export class OpenCGAClient {
.search({limit: 100})
.then(async function (response) {
try {
// session.projects = response.responses[0].results;
for (const project of response.responses[0].results) {
const projectIndex = session.projects.findIndex(proj => proj.fqn === project.fqn);
if (projectIndex < 0) {
Expand Down Expand Up @@ -425,29 +424,12 @@ export class OpenCGAClient {
// FIXME line above should check cohort.internal instead
// .filter(cohort => cohort.internal.index?.status === "READY");

// Check if lastStudy form User Configuration matches
if (session.user?.configs?.IVA?.lastStudy === study.fqn) {
session.project = project;
session.study = study;
}

// Keep track of the studies to fetch Disease Panels
studies.push(study.fqn);
}
}
}

// If the user doesn't have his own default study then we select the first project and study as default
if (!session.project && !session.study) {
for (const project of session.projects) {
if (project.studies?.length > 0) {
session.project = project;
session.study = project.studies[0];
break;
}
}
}

// Fetch the CellBase sources for each Project
const cellbaseSourcesPromises = [];
const indexesMap = [];
Expand Down Expand Up @@ -482,11 +464,12 @@ export class OpenCGAClient {
console.log("Fetching disease panels");
const panelPromises = [];
for (const study of studies) {
const promise = _this.panels().search({
study: study,
limit: 2000,
include: "id,name,stats,source,genes.id,genes.name,genes.modeOfInheritance,genes.confidence,regions.id"
});
const promise = _this.panels()
.search({
study: study,
limit: 1000,
include: "id,name,stats,source,genes.id,genes.name,genes.modeOfInheritance,genes.confidence,regions.id"
});
panelPromises.push(promise);
}
const panelResponses = await Promise.all(panelPromises);
Expand Down
6 changes: 3 additions & 3 deletions src/sites/iva/conf/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ const hosts = [
];

const opencga = {
host: hosts[2].url,
host: hosts[1].url,
version: "v2",
cookie: {
prefix: "iva-" + hosts[2].id,
prefix: "iva-" + hosts[1].id,
secure: true,
},
sso: {
Expand Down Expand Up @@ -316,7 +316,7 @@ const SUITE = {
},
menu: [
{
id: "browser",
id: "variant-browser",
name: "Variant Browser",
icon: "img/tools/icons/variant_browser.svg",
visibility: "public",
Expand Down
Loading
Loading