Skip to content

Commit

Permalink
Merge pull request #979 from opencb/TASK-6838
Browse files Browse the repository at this point in the history
TASK-6838 - Simplify HRDetect Interface for non-advanced users
  • Loading branch information
jmjuanes authored Sep 25, 2024
2 parents b45bf93 + 83f0c76 commit 8d848fd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 86 deletions.
46 changes: 1 addition & 45 deletions src/webcomponents/clinical/analysis/hrdetect-analysis.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ export default class HRDetectAnalysis extends LitElement {
sampleId: this.toolParams.query?.sample,
snvFittingId: this.toolParams.snvFittingId,
svFittingId: this.toolParams.svFittingId,
snv3CustomName: this.toolParams.snv3CustomName || "",
snv8CustomName: this.toolParams.snv8CustomName || "",
sv3CustomName: this.toolParams.sv3CustomName || "",
sv8CustomName: this.toolParams.sv8CustomName || "",
bootstrap: !!this.toolParams.bootstrap,
};

Expand Down Expand Up @@ -290,48 +286,8 @@ export default class HRDetectAnalysis extends LitElement {
],
},
{
title: "Advanced Parameters",
title: "HRDetect Parameters",
elements: [
{
title: "SNV3 Custom Name",
field: "snv3CustomName",
type: "input-text",
display: {
help: {
text: "Custom signature name that will be considered as SNV3 input for HRDetect.",
},
},
},
{
title: "SNV8 Custom Name",
field: "snv8CustomName",
type: "input-text",
display: {
help: {
text: "Custom signature name that will be considered as SNV8 input for HRDetect.",
},
},
},
{
title: "SV3 Custom Name",
field: "sv3CustomName",
type: "input-text",
display: {
help: {
text: "Custom signature name that will be considered as SV3 input for HRDetect.",
},
},
},
{
title: "SV8 Custom Name",
field: "sv8CustomName",
type: "input-text",
display: {
help: {
text: "Custom signature name that will be considered as SV8 input for HRDetect.",
},
},
},
{
title: "Bootstrap",
field: "bootstrap",
Expand Down
21 changes: 18 additions & 3 deletions src/webcomponents/clinical/analysis/hrdetect-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,20 +169,35 @@ class HRDetectView extends LitElement {
},
},
{
name: "Scores",
name: "Probability",
field: "scores",
display: {
format: scores => {
return scores.find(row => row.key?.toLowerCase?.() === "probability")?.value?.toFixed?.(2) || "-";
},
},
},
{
name: "Contributions",
field: "scores",
type: "table",
display: {
// style: "width:auto",
showHeader: false,
filter: data => (data || []).filter(row => {
return !["intercept", "probability"].includes(row?.key?.toLowerCase?.());
}),
transform: data => data.toSorted((a, b) => b.value - a.value),
columns: [
{
title: "key",
field: "key"
},
{
title: "value",
field: "value"
field: "value",
display: {
format: value => value.toFixed(2),
},
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,6 @@ export default class MutationalSignatureAnalysis extends LitElement {
fitNBoot: this.toolParams.fitNBoot,
fitThresholdPerc: this.toolParams.fitThresholdPerc,
fitThresholdPval: this.toolParams.fitThresholdPval,
fitSignaturesFile: this.toolParams.fitSignaturesFile,
fitRareSignaturesFile: this.toolParams.fitRareSignaturesFile,
};

// Check if we have provided an existing signature list
Expand Down Expand Up @@ -411,42 +409,6 @@ export default class MutationalSignatureAnalysis extends LitElement {
field: "fitNBoot",
type: "input-text",
},
{
title: "Fit Signatures File",
field: "fitSignaturesFile",
type: "custom",
display: {
render: (fitSignaturesFile, dataFormFilterChange) => html`
<catalog-search-autocomplete
.value="${fitSignaturesFile}"
.resource="${"FILE"}"
.opencgaSession="${this.opencgaSession}"
.config="${{multiple: false}}"
.searchField="${"id"}"
.query="${fileQuery}"
@filterChange="${e => dataFormFilterChange(e.detail.value)}">
</catalog-search-autocomplete>
`,
},
},
{
title: "Fit Rare Signatures File",
field: "fitRareSignaturesFile",
type: "custom",
display: {
render: (fitRareSignaturesFile, dataFormFilterChange) => html`
<catalog-search-autocomplete
.value="${fitRareSignaturesFile}"
.resource="${"FILE"}"
.opencgaSession="${this.opencgaSession}"
.config="${{multiple: false}}"
.searchField="${"id"}"
.query="${fileQuery}"
@filterChange="${e => dataFormFilterChange(e.detail.value)}">
</catalog-search-autocomplete>
`,
},
},
]
}
];
Expand Down

0 comments on commit 8d848fd

Please sign in to comment.