Skip to content

Commit

Permalink
Merge branch 'release-2.12.x' into TASK-5674
Browse files Browse the repository at this point in the history
  • Loading branch information
jmjuanes authored Apr 4, 2024
2 parents f3b1147 + 06a5c68 commit 6605204
Show file tree
Hide file tree
Showing 13 changed files with 153 additions and 181 deletions.
19 changes: 18 additions & 1 deletion src/core/bioinfo/bioinfo-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,23 @@ export default class BioinfoUtils {
});
}

static getIdName(id, name) {
let text = "";
if (name) {
text = name;
}

if (id) {
if (name) {
text += ` (${id})`;
} else {
text = id;
}
}

return text;
}

// Generate Variant ID in Varsome format
// https://varsome.com/how-do-i-create-link-varsome/
static getVariantInVarsomeFormat(variantId) {
Expand Down Expand Up @@ -255,7 +272,7 @@ export default class BioinfoUtils {

static getOboLink(ontologyId) {
const ontologyShort = ontologyId.replace(":", "_");
return `http://purl.obolibrary.org/obo/${ontologyShort}`;
return `https://purl.obolibrary.org/obo/${ontologyShort}`;
}

static getHpoLink(hpoTerm) {
Expand Down
3 changes: 1 addition & 2 deletions src/webcomponents/clinical/clinical-analysis-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -695,11 +695,10 @@ export default class ClinicalAnalysisGrid extends LitElement {
events: {
"click a": this.onActionClick.bind(this)
},
visible: !this._config.columns?.hidden?.includes("actions"),
visible: this.gridCommons.isColumnVisible("actions"),
});
}

// _columns = UtilsNew.mergeTable(_columns, this._config.columns || this._config.hiddenColumns, !!this._config.hiddenColumns);
this._columns = this.gridCommons.addColumnsFromExtensions(this._columns, this.COMPONENT_ID);
return this._columns;
}
Expand Down
2 changes: 1 addition & 1 deletion src/webcomponents/cohort/cohort-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ export default class CohortGrid extends LitElement {
events: {
"click a": this.onActionClick.bind(this),
},
visible: !this._config.columns?.hidden?.includes("actions"),
visible: this.gridCommons.isColumnVisible("actions"),
});
}

Expand Down
13 changes: 8 additions & 5 deletions src/webcomponents/commons/filters/sample-genotype-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,20 @@ export default class SampleGenotypeFilter extends LitElement {
id: "0/1", name: "HET"
},
{
id: "1/1", name: "HOM ALT"
id: "1/1", name: "HOM_ALT"
},
{
separator: true
},
{
id: "./.", name: "Missing"
id: "1/2", name: "BIALLELIC (1/2)"
},
{
id: "NA", name: "NA"
}
// {
// id: "./.", name: "Missing"
// },
// {
// id: "NA", name: "NA"
// }
]
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/webcomponents/disease-panel/disease-panel-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ export default class DiseasePanelGrid extends LitElement {
events: {
"click a": this.onActionClick.bind(this),
},
visible: !this._config.columns?.hidden?.includes("actions"),
visible: this.gridCommons.isColumnVisible("actions"),
});
}

Expand Down
17 changes: 12 additions & 5 deletions src/webcomponents/family/family-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,19 +185,27 @@ export default class FamilyGrid extends LitElement {
...this.query
};

// Calculate the number of cases to fetch
const casesLimit = this.table?.bootstrapTable("getOptions")?.pageSize || this._config.pageSize || 10;

// Store the current filters
this.lastFilters = {...this.filters};
this.opencgaSession.opencgaClient.families()
.search(this.filters)
.then(familyResponse => {
// Fetch Clinical Analysis ID per Family in 1 single query
const familyIds = familyResponse.responses[0].results.map(family => family.id).join(",");
const familyIds = familyResponse.responses[0].results
.map(family => family.id)
.join(",");

if (familyIds) {
this.opencgaSession.opencgaClient.clinical()
this.opencgaSession.opencgaClient
.clinical()
.search({
family: familyIds,
study: this.opencgaSession.study.fqn,
include: "id,proband.id,family.members,family.id"
include: "id,proband.id,family.members,family.id",
limit: casesLimit * 10
})
.then(caseResponse => {
familyResponse.getResults().forEach(family => {
Expand Down Expand Up @@ -541,11 +549,10 @@ export default class FamilyGrid extends LitElement {
events: {
"click a": this.onActionClick.bind(this)
},
visible: !this._config.columns?.hidden?.includes("actions")
visible: this.gridCommons.isColumnVisible("actions")
});
}

// _columns = UtilsNew.mergeTable(_columns, this._config.columns || this._config.hiddenColumns, !!this._config.hiddenColumns);
this._columns = this.gridCommons.addColumnsFromExtensions(this._columns, this.COMPONENT_ID);
return this._columns;
}
Expand Down
2 changes: 1 addition & 1 deletion src/webcomponents/file/file-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ export default class OpencgaFileGrid extends LitElement {
events: {
"click a": this.onActionClick.bind(this)
},
visible: !this._config.columns?.hidden?.includes("actions")
visible: this.gridCommons.isColumnVisible("actions")
});
}

Expand Down
18 changes: 13 additions & 5 deletions src/webcomponents/individual/individual-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,19 +189,28 @@ export default class IndividualGrid extends LitElement {
...this.query
};

// Calculate the number of cases to fetch
const casesLimit = this.table?.bootstrapTable("getOptions")?.pageSize || this._config.pageSize || 10;

// Store the current filters
this.lastFilters = {...this.filters};
this.opencgaSession.opencgaClient.individuals()
.search(this.filters)
.then(individualResponse => {
// Fetch Clinical Analysis ID per individual in 1 single query
const individualIds = individualResponse.getResults().map(individual => individual.id).filter(Boolean).join(",");
const individualIds = individualResponse.getResults()
.map(individual => individual.id)
.filter(Boolean)
.join(",");

if (individualIds) {
this.opencgaSession.opencgaClient.clinical()
this.opencgaSession.opencgaClient
.clinical()
.search({
individual: individualIds,
study: this.opencgaSession.study.fqn,
include: "id,proband.id,family.members"
include: "id,proband.id,family.members",
limit: casesLimit * 10
})
.then(caseResponse => {
individualResponse.getResults().forEach(individual => {
Expand Down Expand Up @@ -589,11 +598,10 @@ export default class IndividualGrid extends LitElement {
events: {
"click a": this.onActionClick.bind(this),
},
visible: !this._config.columns?.hidden?.includes("actions"),
visible: this.gridCommons.isColumnVisible("actions"),
});
}

// _columns = UtilsNew.mergeTable(_columns, this._config.columns || this._config.hiddenColumns, !!this._config.hiddenColumns);
this._columns = this.gridCommons.addColumnsFromExtensions(this._columns, this.COMPONENT_ID);
return this._columns;
}
Expand Down
2 changes: 1 addition & 1 deletion src/webcomponents/job/job-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ export default class JobGrid extends LitElement {
events: {
"click a": this.onActionClick.bind(this),
},
visible: !this._config.columns?.hidden?.includes("actions"),
visible: this.gridCommons.isColumnVisible("actions"),
});
}

Expand Down
16 changes: 11 additions & 5 deletions src/webcomponents/sample/sample-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ export default class SampleGrid extends LitElement {
...this.query
};

// Calculate the number of cases to fetch
const casesLimit = this.table?.bootstrapTable("getOptions")?.pageSize || this._config.pageSize || 10;

// Store the current filters
this.lastFilters = {...this.filters};
this.opencgaSession.opencgaClient.samples()
Expand All @@ -196,14 +199,18 @@ export default class SampleGrid extends LitElement {
// Fetch clinical analysis to display the Case ID
const individualIds = sampleResponse.getResults()
.map(sample => sample.individualId)
.filter(Boolean).join(",");
.filter(Boolean)
.join(",");

if (individualIds) {
this.opencgaSession.opencgaClient.clinical()
this.opencgaSession.opencgaClient
.clinical()
.search(
{
individual: individualIds,
study: this.opencgaSession.study.fqn,
include: "id,proband.id,family.members"
include: "id,proband.id,family.members",
limit: casesLimit * 10
})
.then(caseResponse => {
sampleResponse.getResults().forEach(sample => {
Expand Down Expand Up @@ -463,11 +470,10 @@ export default class SampleGrid extends LitElement {
events: {
"click a": this.onActionClick.bind(this)
},
visible: !this._config.columns?.hidden?.includes("actions")
visible: this.gridCommons.isColumnVisible("actions")
});
}

// _columns = UtilsNew.mergeTable(_columns, this._config.columns || this._config.hiddenColumns, !!this._config.hiddenColumns);
this._columns = this.gridCommons.addColumnsFromExtensions(this._columns, this.COMPONENT_ID);
return this._columns;
}
Expand Down
Loading

0 comments on commit 6605204

Please sign in to comment.