diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b50c8435..69c65e03 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,7 +21,7 @@ jobs: steps: - name: Checkout bmds-server uses: actions/checkout@v3 - - name: Checkout bmds@next + - name: Checkout bmds@main uses: actions/checkout@v3 with: repository: USEPA/bmds-private @@ -140,7 +140,7 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Checkout bmds@next + - name: Checkout bmds@main uses: actions/checkout@v3 with: repository: USEPA/bmds-private diff --git a/frontend/src/components/Output/Multitumor/AnalysisOfDeviance.js b/frontend/src/components/Output/Multitumor/AnalysisOfDeviance.js deleted file mode 100644 index 4209aad4..00000000 --- a/frontend/src/components/Output/Multitumor/AnalysisOfDeviance.js +++ /dev/null @@ -1,57 +0,0 @@ -import {observer} from "mobx-react"; -import PropTypes from "prop-types"; -import React, {Component} from "react"; - -import {ff, fractionalFormatter} from "@/utils/formatters"; - -@observer -class AnalysisOfDeviance extends Component { - render() { - const deviances = this.props.model.deviance; - return ( - - - - - - - - - - - - - - - - - - - - - - - - {deviances.names.map((name, i) => { - return ( - - - - - - - - - ); - })} - -
Analysis of Deviance
ModelLog Likelihood# ParametersDevianceTest DOF - P-Value -
{name}{ff(deviances.ll[i])}{deviances.params[i]}{ff(deviances.deviance[i])}{ff(deviances.df[i])}{fractionalFormatter(deviances.p_value[i])}
- ); - } -} -AnalysisOfDeviance.propTypes = { - model: PropTypes.object, -}; -export default AnalysisOfDeviance; diff --git a/frontend/src/components/Output/Multitumor/GoodnessFit.js b/frontend/src/components/Output/Multitumor/GoodnessFit.js deleted file mode 100644 index d896efcb..00000000 --- a/frontend/src/components/Output/Multitumor/GoodnessFit.js +++ /dev/null @@ -1,98 +0,0 @@ -import {observer} from "mobx-react"; -import PropTypes from "prop-types"; -import React, {Component} from "react"; - -import {Dtype} from "@/constants/dataConstants"; -import {isLognormal} from "@/constants/modelConstants"; -import {ff} from "@/utils/formatters"; - -/* eslint-disable */ -const hdr_c_normal = [ - "Dose", "Size", "Observed Mean", "Calculated Mean", "Estimated Mean", - "Observed SD", "Calculated SD", "Estimated SD", "Scaled Residual", - ], - hdr_c_lognormal = [ - "Dose", "Size", "Observed Mean", "Calculated Median", "Estimated Median", - "Observed SD", "Calculated GSD", "Estimated GSD", "Scaled Residual", - ], - hdr_d = [ "Dose", "Size", "Observed", "Expected", "Estimated Probability", "Scaled Residual"]; -/* eslint-enable */ - -@observer -class GoodnessFit extends Component { - getHeaders(dtype, settings) { - if (dtype == Dtype.CONTINUOUS || dtype == Dtype.CONTINUOUS_INDIVIDUAL) { - const headers = isLognormal(settings.disttype) ? hdr_c_lognormal : hdr_c_normal; - return [headers, [10, 10, 10, 12, 12, 12, 10, 12, 12]]; - } - if (dtype == Dtype.DICHOTOMOUS) { - return [hdr_d, [17, 16, 16, 17, 17, 17]]; - } - throw Error("Unknown dtype"); - } - render() { - const {store} = this.props, - settings = store.modalModel.settings, - gof = store.modalModel.gof, - dataset = store.modalDataset, - {dtype} = dataset, - headers = this.getHeaders(dtype, settings); - return ( - - - {headers[1].map((d, i) => ( - - ))} - - - - - - - {headers[0].map((d, i) => ( - - ))} - - - - {dtype == Dtype.CONTINUOUS || dtype == Dtype.CONTINUOUS_INDIVIDUAL - ? gof.dose.map((item, i) => { - const useFF = dtype === Dtype.CONTINUOUS_INDIVIDUAL; - return ( - - - - - - - - - - - - ); - }) - : null} - {dtype == Dtype.DICHOTOMOUS - ? dataset.doses.map((dose, i) => { - return ( - - - - - - - - - ); - }) - : null} - -
Goodness of Fit
{d}
{item}{gof.size[i]}{useFF ? ff(gof.obs_mean[i]) : gof.obs_mean[i]}{ff(gof.calc_mean[i])}{ff(gof.est_mean[i])}{useFF ? ff(gof.obs_sd[i]) : gof.obs_sd[i]}{ff(gof.calc_sd[i])}{ff(gof.est_sd[i])}{ff(gof.residual[i])}
{dose}{dataset.ns[i]}{dataset.incidences[i]}{ff(gof.expected[i])}{ff(gof.expected[i] / dataset.ns[i])}{ff(gof.residual[i])}
- ); - } -} -GoodnessFit.propTypes = { - store: PropTypes.object, -}; -export default GoodnessFit; diff --git a/frontend/src/components/Output/Multitumor/InfoTable.js b/frontend/src/components/Output/Multitumor/InfoTable.js deleted file mode 100644 index 2e205aad..00000000 --- a/frontend/src/components/Output/Multitumor/InfoTable.js +++ /dev/null @@ -1,26 +0,0 @@ -import {inject, observer} from "mobx-react"; -import PropTypes from "prop-types"; -import React, {Component} from "react"; - -import TwoColumnTable from "@/components/common/TwoColumnTable"; -import {getNameFromDegrees} from "@/constants/modelConstants"; - -@inject("outputStore") -@observer -class InfoTable extends Component { - render() { - const {outputStore} = this.props, - model = outputStore.modalModel, - dataset = outputStore.modalDataset, - data = [ - ["Dataset", dataset.metadata.name], - ["Model", getNameFromDegrees(model)], - ["Equation", "P[dose] = g + (1 - g) * (1 - exp(-b1 * dose^1 - b2 * dose^2 - ...))"], - ]; - return ; - } -} -InfoTable.propTypes = { - outputStore: PropTypes.object, -}; -export default InfoTable; diff --git a/frontend/src/components/Output/Multitumor/ModalBody.js b/frontend/src/components/Output/Multitumor/ModalBody.js deleted file mode 100644 index 50dd9484..00000000 --- a/frontend/src/components/Output/Multitumor/ModalBody.js +++ /dev/null @@ -1,79 +0,0 @@ -import {observer} from "mobx-react"; -import PropTypes from "prop-types"; -import React, {Component} from "react"; -import {Col, Modal, Row} from "react-bootstrap"; - -import DoseResponsePlot from "../../common/DoseResponsePlot"; -import ModelParameters from "../../IndividualModel/ModelParameters"; -import AnalysisOfDeviance from "./AnalysisOfDeviance"; -import GoodnessFit from "./GoodnessFit"; -import InfoTable from "./InfoTable"; -import ModelOptions from "./ModelOptions"; -import {MsComboInfo, MsComboSummary} from "./MsCombo"; -import MultitumorPlot from "./MultitumorPlot"; -import ParameterSettings from "./ParameterSettings"; -import Summary from "./Summary"; - -@observer -class ModalBody extends Component { - render() { - const {outputStore} = this.props, - model = outputStore.modalModel, - isSummary = outputStore.drModelModalIsMA; - - if (isSummary) { - return ( - - - - - - - - - - - - - - ); - } - return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ); - } -} -ModalBody.propTypes = { - outputStore: PropTypes.object, -}; -export default ModalBody; diff --git a/frontend/src/components/Output/Multitumor/ModelOptions.js b/frontend/src/components/Output/Multitumor/ModelOptions.js deleted file mode 100644 index b073ac4b..00000000 --- a/frontend/src/components/Output/Multitumor/ModelOptions.js +++ /dev/null @@ -1,30 +0,0 @@ -import {inject, observer} from "mobx-react"; -import PropTypes from "prop-types"; -import React, {Component} from "react"; - -import {getLabel} from "@/common"; -import TwoColumnTable from "@/components/common/TwoColumnTable"; -import {dichotomousBmrOptions} from "@/constants/optionsConstants"; -import {ff} from "@/utils/formatters"; - -@inject("outputStore") -@observer -class ModelOptions extends Component { - render() { - const {outputStore} = this.props, - options = outputStore.selectedModelOptions, - {modalOptionSet} = outputStore, - degree = modalOptionSet.degree == 0 ? "auto" : modalOptionSet.degree, - data = [ - ["Risk Type", getLabel(options.bmr_type, dichotomousBmrOptions)], - ["BMR", ff(options.bmr_value)], - ["Confidence Level", ff(options.confidence_level)], - ["Degree", degree], - ]; - return ; - } -} -ModelOptions.propTypes = { - outputStore: PropTypes.object, -}; -export default ModelOptions; diff --git a/frontend/src/components/Output/Multitumor/ParameterSettings.js b/frontend/src/components/Output/Multitumor/ParameterSettings.js deleted file mode 100644 index 8082ab2c..00000000 --- a/frontend/src/components/Output/Multitumor/ParameterSettings.js +++ /dev/null @@ -1,44 +0,0 @@ -import _ from "lodash"; -import {observer} from "mobx-react"; -import PropTypes from "prop-types"; -import React, {Component} from "react"; - -@observer -class ParameterSettings extends Component { - render() { - const model = this.props.model.parameters, - temp_rslt_len = _.size(model.names); - return ( - - - - - - - - - - - - - - {_.range(temp_rslt_len).map(i => { - return ( - - - - - - - ); - })} - -
Parameter Settings
ParameterInitialMinMax
{model.names[i]}{model.prior_initial_value[i]}{model.prior_min_value[i]}{model.prior_max_value[i]}
- ); - } -} -ParameterSettings.propTypes = { - model: PropTypes.object, -}; - -export default ParameterSettings; diff --git a/frontend/src/components/Output/Multitumor/Summary.js b/frontend/src/components/Output/Multitumor/Summary.js deleted file mode 100644 index 244f2d09..00000000 --- a/frontend/src/components/Output/Multitumor/Summary.js +++ /dev/null @@ -1,35 +0,0 @@ -import {observer} from "mobx-react"; -import PropTypes from "prop-types"; -import React, {Component} from "react"; - -import TwoColumnTable from "@/components/common/TwoColumnTable"; -import {ff, fourDecimalFormatter} from "@/utils/formatters"; - -@observer -class Summary extends Component { - render() { - const {model} = this.props, - data = [ - ["BMD", ff(model.bmd)], - ["BMDL", ff(model.bmdl)], - ["BMDU", ff(model.bmdu)], - ["Slope Factor", ff(model.slope_factor)], - ["AIC", ff(model.fit.aic)], - [ - - P-Value - , - fourDecimalFormatter(model.gof.p_value), - ], - ["Overall DOF", ff(model.gof.df)], - ["Chi²", ff(model.fit.chisq)][("Log Likelihood", ff(model.fit.loglikelihood))], - ]; - return ; - } -} - -Summary.propTypes = { - model: PropTypes.object, -}; - -export default Summary; diff --git a/frontend/src/components/Output/NestedDichotomous/ModelParameters.js b/frontend/src/components/Output/NestedDichotomous/ModelParameters.js deleted file mode 100644 index c5c31a6a..00000000 --- a/frontend/src/components/Output/NestedDichotomous/ModelParameters.js +++ /dev/null @@ -1,37 +0,0 @@ -import _ from "lodash"; -import {observer} from "mobx-react"; -import PropTypes from "prop-types"; -import React, {Component} from "react"; - -@observer -class ModelParameters extends Component { - render() { - const names = this.props.model.results.parameter_names, - values = this.props.model.results.parameters; - - return ( - - - - - - - - {_.range(_.size(names)).map(i => { - return ( - - - - - ); - })} - -
Model Parameters
{names[i]}{values[i]}
- ); - } -} -ModelParameters.propTypes = { - model: PropTypes.object, -}; - -export default ModelParameters; diff --git a/frontend/src/components/Output/NestedDichotomous/Summary.js b/frontend/src/components/Output/NestedDichotomous/Summary.js deleted file mode 100644 index 9589f6f1..00000000 --- a/frontend/src/components/Output/NestedDichotomous/Summary.js +++ /dev/null @@ -1,39 +0,0 @@ -import {observer} from "mobx-react"; -import PropTypes from "prop-types"; -import React, {Component} from "react"; - -import TwoColumnTable from "@/components/common/TwoColumnTable"; -import {ff} from "@/utils/formatters"; - -@observer -class Summary extends Component { - render() { - const {results} = this.props, - data = [ - ["BMD", ff(results.summary.bmd)], - ["BMDL", ff(results.summary.bmdl)], - ["BMDU", ff(results.summary.bmdu)], - ["AIC", ff(results.summary.aic)], - [ - - P-value - , - ff(results.combined_pvalue), - ], - ["D.O.F.", ff(results.dof)], - [ - - Chi2 - , - ff(results.summary.chi_squared), - ], - ]; - return ; - } -} -Summary.propTypes = { - model: PropTypes.object, - results: PropTypes.object.isRequired, -}; - -export default Summary; diff --git a/frontend/src/constants/modelConstants.js b/frontend/src/constants/modelConstants.js index 35dfcc18..9934d300 100644 --- a/frontend/src/constants/modelConstants.js +++ b/frontend/src/constants/modelConstants.js @@ -75,10 +75,6 @@ const modelsList = { isLognormal = function(disttype) { return disttype == 3; }, - hasDegrees = new Set(["Multistage", "Polynomial"]), - getNameFromDegrees = function(model) { - const degree = model.parameters.names.length - 1; - return `Multistage ${degree}°`; - }; + hasDegrees = new Set(["Multistage", "Polynomial"]); -export {allModelOptions, getNameFromDegrees, hasDegrees, isLognormal, models, modelsList}; +export {allModelOptions, hasDegrees, isLognormal, models, modelsList};