Skip to content

Commit

Permalink
merge summary, fix import
Browse files Browse the repository at this point in the history
  • Loading branch information
hausman-gdit committed Mar 26, 2024
1 parent d0d4f07 commit 2c5e8ce
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 148 deletions.
66 changes: 0 additions & 66 deletions frontend/src/components/IndividualModel/ContinuousSummary.js

This file was deleted.

10 changes: 3 additions & 7 deletions frontend/src/components/IndividualModel/ModelDetailModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,24 @@ import ModelOptions from "../Output/Multitumor/ModelOptions";
import {MsComboInfo, MsComboSummary} from "../Output/Multitumor/MsCombo";
import MultitumorPlot from "../Output/Multitumor/MultitumorPlot";
import ParameterSettings from "../Output/Multitumor/ParameterSettings";
import Summary from "../Output/Multitumor/Summary";
import BootstrapResults from "../Output/NestedDichotomous/BootstrapResults";
import BootstrapRuns from "../Output/NestedDichotomous/BootstrapRuns";
import LitterData from "../Output/NestedDichotomous/LitterData";
import NdModelParameters from "../Output/NestedDichotomous/ModelParameters";
import ScaledResidual from "../Output/NestedDichotomous/ScaledResidual";
import NdSummary from "../Output/NestedDichotomous/Summary";
import CDFPlot from "./CDFPlot";
import CDFTable from "./CDFTable";
import ContinuousDeviance from "./ContinuousDeviance";
import ContinuousSummary from "./ContinuousSummary";
import ContinuousTestOfInterest from "./ContinuousTestOfInterest";
import DichotomousDeviance from "./DichotomousDeviance";
import DichotomousSummary from "./DichotomousSummary";
import GoodnessFit from "./GoodnessFit";
import InfoTable from "./InfoTable";
import MaBenchmarkDose from "./MaBenchmarkDose";
import MaIndividualModels from "./MaIndividualModels";
import ModelOptionsTable from "./ModelOptionsTable";
import ModelParameters from "./ModelParameters";
import ParameterPriorTable from "./ParameterPriorTable";
import Summary from "./Summary";
@observer
class ModelBody extends Component {
render() {
Expand Down Expand Up @@ -62,8 +59,7 @@ class ModelBody extends Component {
</Row>
<Row>
<Col xl={4}>
{isDichotomous ? <DichotomousSummary store={outputStore} /> : null}
{isContinuous ? <ContinuousSummary store={outputStore} /> : null}
<Summary store={outputStore} />
</Col>
<Col xl={8}>
<DoseResponsePlot
Expand Down Expand Up @@ -254,7 +250,7 @@ class NdModalBody extends Component {
<ModelOptionsTable dtype={dtype} model={model} />
</Col>
<Col xs={6}>
<NdSummary results={model.results} />
<Summary results={model.results} />
</Col>
<Col xs={6}>
<DoseResponsePlot
Expand Down
76 changes: 76 additions & 0 deletions frontend/src/components/IndividualModel/Summary.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import {inject, observer} from "mobx-react";
import PropTypes from "prop-types";
import React, {Component} from "react";

import TwoColumnTable from "@/components/common/TwoColumnTable";
import {ff, fourDecimalFormatter, fractionalFormatter} from "@/utils/formatters";

@inject("outputStore")
@observer
class Summary extends Component {
render() {
const {outputStore} = this.props;
let data;

if (outputStore.isMultitumor) {
data = [
["BMD", ff(outputStore.modalModel.bmd)],
["BMDL", ff(outputStore.modalModel.bmdl)],
["BMDU", ff(outputStore.modalModel.bmdu)],
["Slope Factor", ff(outputStore.modalModel.slope_factor)],
["AIC", ff(outputStore.modalModel.fit.aic)],
[
<span key="0">
<i>P</i>-Value
</span>,
fourDecimalFormatter(outputStore.modalModel.gof.p_value),
],
["Overall d.f.", ff(outputStore.modalModel.gof.df)],
["Chi²", ff(outputStore.modalModel.fit.chisq)],
["-2* Log(Likelihood Ratio)", ff(outputStore.modalModel.fit.loglikelihood)],
];
} else if (outputStore.isNestedDichotomous) {
data = [
["BMD", ff(outputStore.modalModel.results.bmd)],
["BMDL", ff(outputStore.modalModel.results.summary.bmdl)],
["BMDU", ff(outputStore.modalModel.results.summary.bmdu)],
["AIC", ff(outputStore.modalModel.results.summary.aic)],
[
<span key={0}>
<i>P</i>-value
</span>,
ff(outputStore.modalModel.results.combined_pvalue),
],
["d.f.", ff(outputStore.modalModel.results.dof)],
[
<span key={1}>
Chi<sup>2</sup>
</span>,
ff(outputStore.modalModel.results.summary.chi_squared),
],
];
} else {
const p_value = outputStore.modalModel.results.tests.p_values[3];
data = [
["BMD", ff(outputStore.modalModel.results.bmd)],
["BMDL", ff(outputStore.modalModel.results.bmdl)],
["BMDU", ff(outputStore.modalModel.results.bmdu)],
["AIC", ff(outputStore.modalModel.results.fit.aic)],
["-2* Log(Likelihood Ratio)", ff(outputStore.modalModel.results.fit.loglikelihood)],
[
<span key={0}>
<i>P</i>-value
</span>,
fractionalFormatter(p_value),
],
["Model d.f.", ff(outputStore.modalModel.results.tests.dfs[3])],
];
}

return <TwoColumnTable id="info-table" data={data} label="Modeling Summary" />;
}
}
Summary.propTypes = {
outputStore: PropTypes.object,
};
export default Summary;
36 changes: 0 additions & 36 deletions frontend/src/components/Output/Multitumor/Summary.js

This file was deleted.

39 changes: 0 additions & 39 deletions frontend/src/components/Output/NestedDichotomous/Summary.js

This file was deleted.

0 comments on commit 2c5e8ce

Please sign in to comment.