Skip to content

Commit

Permalink
Merge pull request #956 from opencb/TASK-6637
Browse files Browse the repository at this point in the history
TASK-6637 - Add NA genotype to clinical interpreter genotype filter
  • Loading branch information
gpveronica authored Aug 27, 2024
2 parents 7d53ad2 + 4a2a37d commit 90e462e
Show file tree
Hide file tree
Showing 11 changed files with 124 additions and 414 deletions.
4 changes: 2 additions & 2 deletions src/sites/iva/conf/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const hosts = [
url: "https://demo.app.zettagenomics.com/opencga"
},
{
id: "reference",
url: "https://test.app.zettagenomics.com/reference/opencga"
id: "xeta-110e",
url: "https://test.app.zettagenomics.com/xeta-110e/opencga"
},
];

Expand Down
51 changes: 28 additions & 23 deletions src/webcomponents/commons/filters/sample-genotype-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,16 @@ export default class SampleGenotypeFilter extends LitElement {
}

if (changedProperties.has("config")) {
this._config = {...this.getDefaultConfig(), ...this.config};
this._config = {
...this.getDefaultConfig(),
...this.config,
};
}

super.update(changedProperties);
}

filterChange(e) {

// Prepare sample query filter
let sampleFilter = this.sampleId;
if (e.detail.value) {
Expand All @@ -79,47 +81,50 @@ export default class SampleGenotypeFilter extends LitElement {
LitUtils.dispatchCustomEvent(this, "filterChange", sampleFilter);
}

render() {
const genotypes = this.genotypes ?? [];
return html`
<select-field-filter
.data="${this._config?.genotypes}"
.value=${genotypes}
.config="${{
multiple: true,
liveSearch: false
}}"
@filterChange="${this.filterChange}">
</select-field-filter>
`;
}

getDefaultConfig() {
// HOM_REF, HOM_ALT, HET, HET_REF, HET_ALT and MISS e.g. HG0097:HOM_REF;HG0098:HET_REF,HOM_ALT . 3)
return {
genotypes: [
{
id: "0/1", name: "HET"
id: "0/1", name: "Heterozygous (0/1)"
},
{
id: "1/1", name: "HOM_ALT"
id: "1/1", name: "Homozygous Alternate (1/1)"
},
{
separator: true
},
{
id: "1/2", name: "BIALLELIC (1/2)"
id: "1", name: "Haploid (1)"
},
{
id: "1/2", name: "Biallelic (1/2)"
},
{
id: "NA", name: "NA"
}
// {
// id: "./.", name: "Missing"
// },
// {
// id: "NA", name: "NA"
// }
]
};
}

render() {
const genotypes = this.genotypes ?? [];
return html`
<select-field-filter
.data="${this._config?.genotypes}"
.value=${genotypes}
.config="${{
multiple: true,
liveSearch: false
}}"
@filterChange="${this.filterChange}">
</select-field-filter>
`;
}

}

customElements.define("sample-genotype-filter", SampleGenotypeFilter);
292 changes: 0 additions & 292 deletions src/webcomponents/commons/forms/deprecated/select-field-filter.js

This file was deleted.

Loading

0 comments on commit 90e462e

Please sign in to comment.