diff --git a/src/webcomponents/commons/filters/sample-genotype-filter.js b/src/webcomponents/commons/filters/sample-genotype-filter.js index 618ba7c85..2abbc386c 100644 --- a/src/webcomponents/commons/filters/sample-genotype-filter.js +++ b/src/webcomponents/commons/filters/sample-genotype-filter.js @@ -90,6 +90,9 @@ export default class SampleGenotypeFilter extends LitElement { { separator: true }, + { + id: "1", name: "HAPLOID (1)" + }, { id: "1/2", name: "BIALLELIC (1/2)" }, diff --git a/src/webcomponents/variant/family-genotype-filter.js b/src/webcomponents/variant/family-genotype-filter.js index 8a2cffb37..a3a9c57b1 100644 --- a/src/webcomponents/variant/family-genotype-filter.js +++ b/src/webcomponents/variant/family-genotype-filter.js @@ -297,7 +297,7 @@ export default class FamilyGenotypeFilter extends LitElement { // Return the default genotype values according the role defaultGenotype(sample) { - return sample.id === this.clinicalAnalysis.proband.samples[0].id ? ["0/1", "1/1", "1/2"] : [...this._config.defaultGenotypes]; + return sample.id === this.clinicalAnalysis.proband.samples[0].id ? ["0/1", "1/1", "1", "1/2"] : [...this._config.defaultGenotypes]; } render() { @@ -339,12 +339,13 @@ export default class FamilyGenotypeFilter extends LitElement { ${BioinfoUtils.getIdName(this.clinicalAnalysis.disorder.id, this.clinicalAnalysis.disorder.name)} - Genotypes + Genotypes HOM_REF (0/0) HET (0/1) HOM_ALT (1/1) + HAPLOID (1) BIALLELIC (1/2) @@ -415,6 +416,14 @@ export default class FamilyGenotypeFilter extends LitElement { ?disabled="${this.mode !== "CUSTOM"}" @change="${this.onSampleTableChange}"> + + + 0) { - sampleIds.push(member.samples[0].id + ":" + ["0/0", "0/1", "1/1", "1/2"].join(",")); + sampleIds.push(member.samples[0].id + ":" + ["0/0", "0/1", "1/1", "1", "1/2"].join(",")); } } this._sampleQuery = sampleIds.join(";"); @@ -347,7 +347,7 @@ class VariantInterpreterBrowserRd extends LitElement { { id: "sample-genotype", title: "Sample Genotype", - visible: () => this.clinicalAnalysis.type.toUpperCase() === "SINGLE", + visible: () => this.clinicalAnalysis.type.toUpperCase() === "SINGLE" || this.clinicalAnalysis.type.toUpperCase() === "CANCER", params: { genotypes: [ { @@ -359,12 +359,12 @@ class VariantInterpreterBrowserRd extends LitElement { { separator: true }, + { + id: "1", name: "HAPLOID (1)" + }, { id: "1/2", name: "BIALLELIC (1/2)" }, - // { - // id: "1", name: "HEMI" - // } ] }, tooltip: tooltips.sample, @@ -389,6 +389,15 @@ class VariantInterpreterBrowserRd extends LitElement { individual: this.clinicalAnalysis?.proband } }, + { + id: "variant-file", + title: "VCF File Filter", + visible: () => this.files?.length > 1, + params: { + files: this.files, + }, + tooltip: tooltips.vcfFile, + }, { id: "variant-file-sample-filter", title: "Variant Caller Sample Filters", diff --git a/src/webcomponents/variant/interpretation/variant-interpreter-grid-formatter.js b/src/webcomponents/variant/interpretation/variant-interpreter-grid-formatter.js index ff2d6673d..cfcc21c70 100644 --- a/src/webcomponents/variant/interpretation/variant-interpreter-grid-formatter.js +++ b/src/webcomponents/variant/interpretation/variant-interpreter-grid-formatter.js @@ -316,16 +316,16 @@ export default class VariantInterpreterGridFormatter { ` : `
${panel.id}
` - } + } ${gene.modesOfInheritance ? `
${gene.modesOfInheritance.join(", ")}
` : "" - } + } ${gene.confidence ? `
${gene.confidence}
` : "" - } + } `; } else { panelHtml = re.panelId; @@ -628,8 +628,12 @@ export default class VariantInterpreterGridFormatter { allelesHtml.push(`${allelesSeq[i]}`); } - const bar = genotype.includes("/") ? "/" : "|"; - res = `${allelesHtml[0]} ${bar} ${allelesHtml[1]}`; + if (allelesHtml.length === 1) { + res = `${allelesHtml[0]}`; + } else { + const bar = genotype.includes("/") ? "/" : "|"; + res = `${allelesHtml[0]} ${bar} ${allelesHtml[1]}`; + } } return res; } diff --git a/src/webcomponents/variant/variant-samples.js b/src/webcomponents/variant/variant-samples.js index 2522e13ed..029762f2c 100644 --- a/src/webcomponents/variant/variant-samples.js +++ b/src/webcomponents/variant/variant-samples.js @@ -68,15 +68,15 @@ export default class VariantSamples extends LitElement { this.config = this.getDefaultConfig(); this.gridCommons = new GridCommons(this.gridId, this, this.config); - // Select all genotypes by default + // Nacho: to be more consistent with the rest of the application we are NOT selecting all genotypes by default this.selectedGenotypes = ""; - const selectedGenotypesArray = [] - for (const genotype of this.config.genotypes) { - if (genotype.fields) { - selectedGenotypesArray.push(genotype.fields.filter(gt => gt.id).map(gt => gt.id).join(",")); - } - } - this.selectedGenotypes = selectedGenotypesArray.join(","); + // const selectedGenotypesArray = []; + // for (const genotype of this.config.genotypes) { + // if (genotype.fields) { + // selectedGenotypesArray.push(genotype.fields.filter(gt => gt.id).map(gt => gt.id).join(",")); + // } + // } + // this.selectedGenotypes = selectedGenotypesArray.join(","); } updated(changedProperties) { @@ -87,6 +87,7 @@ export default class VariantSamples extends LitElement { genotypeFormatter(value) { if (value?.data?.length > 0) { + // Color schema: 0/1, 0|1, 1|0 == darkorange; 1, 1/1 == red const gt = value.data[0]; const color = gt === "0/1" || gt === "0|1" || gt === "1|0" ? "darkorange" : "red"; return `${value.data[0]}`; @@ -95,7 +96,7 @@ export default class VariantSamples extends LitElement { } } - variantFormatter(value, row) { + variantFormatter(value) { if (value && value.file && value.dataKeys && value.data && value.dataKeys.length === value.data.length) { const fileInfo = `Filter: ${value.file.data["FILTER"]}; Qual: ${value.file.data["QUAL"]}`; const sampleFormat = []; @@ -108,10 +109,6 @@ export default class VariantSamples extends LitElement { } } - individualFormatter(value) { - return value || "-"; - } - renderTable() { if (!this.opencgaSession || !this.variantId) { return; @@ -151,10 +148,6 @@ export default class VariantSamples extends LitElement { total: response.total, rows: response.rows }), - // responseHandler: response => { - // const result = this.gridCommons.responseHandler(response, $(this.table).bootstrapTable("getOptions")); - // return result.response; - // }, onClickRow: (row, selectedElement) => this.gridCommons.onClickRow(row.id, row, selectedElement), onLoadSuccess: data => { this.gridCommons.onLoadSuccess(data, 2); @@ -274,7 +267,6 @@ export default class VariantSamples extends LitElement { field: "id", rowspan: 2, colspan: 1, - // formatter: this.variantFormatter, halign: "center" }, { @@ -297,7 +289,6 @@ export default class VariantSamples extends LitElement { title: "Individual", rowspan: 1, colspan: 4, - // formatter: this.variantFormatter, halign: "center" }, { @@ -315,7 +306,7 @@ export default class VariantSamples extends LitElement { field: "individualId", colspan: 1, rowspan: 1, - formatter: this.individualFormatter, + formatter: value => value || "-", halign: "center" }, { @@ -363,6 +354,7 @@ export default class VariantSamples extends LitElement { skip: 0, limit: 5000, }; + // batch size for sample query const BATCH_SIZE = 100; @@ -481,14 +473,17 @@ export default class VariantSamples extends LitElement { { id: "1/1", name: "Homozygous Alternate (1/1)" }, + { + id: "1", name: "Haploid (1)" + }, { id: "1/2", name: "Biallelic (1/2)" }, ] }, - { - separator: true - }, + // { + // separator: true + // }, { id: "Secondary Alternate Genotypes", fields: [