diff --git a/bmds_ui/analysis/validators/options.py b/bmds_ui/analysis/validators/options.py index abffcfab..95653adf 100644 --- a/bmds_ui/analysis/validators/options.py +++ b/bmds_ui/analysis/validators/options.py @@ -36,6 +36,7 @@ class NestedDichotomousOption(BaseModel): litter_specific_covariate: LitterSpecificCovariate bootstrap_iterations: int bootstrap_seed: int + estimate_background: bool class DichotomousOptions(BaseModel): diff --git a/frontend/src/components/IndividualModel/ModelOptionsTable.js b/frontend/src/components/IndividualModel/ModelOptionsTable.js index 7639cc34..c3fe7e12 100644 --- a/frontend/src/components/IndividualModel/ModelOptionsTable.js +++ b/frontend/src/components/IndividualModel/ModelOptionsTable.js @@ -2,7 +2,7 @@ import {observer} from "mobx-react"; import PropTypes from "prop-types"; import React, {Component} from "react"; -import {getLabel} from "@/common"; +import {checkOrEmpty, getLabel} from "@/common"; import TwoColumnTable from "@/components/common/TwoColumnTable"; import {Dtype} from "@/constants/dataConstants"; import {hasDegrees} from "@/constants/modelConstants"; @@ -70,8 +70,6 @@ class ModelOptionsTable extends Component { ["BMR Type", getLabel(model.settings.bmr_type, dichotomousBmrOptions)], ["BMR", ff(model.settings.bmr)], ["Confidence Level (one sided)", ff(1 - model.settings.alpha)], - ["Bootstrap Seed", model.settings.bootstrap_seed], - ["Bootstrap Iterations", model.settings.bootstrap_iterations], [ "Litter Specific Covariate", getLabel( @@ -83,6 +81,9 @@ class ModelOptionsTable extends Component { "Intralitter Correlation", getLabel(model.settings.intralitter_correlation, intralitterCorrelation), ], + ["Estimate Background", checkOrEmpty(model.settings.estimate_background)], + ["Bootstrap Iterations", model.settings.bootstrap_iterations], + ["Bootstrap Seed", model.settings.bootstrap_seed], ]; } else { throw "Unknown dtype"; diff --git a/frontend/src/components/Main/OptionsForm/OptionsForm.js b/frontend/src/components/Main/OptionsForm/OptionsForm.js index 87a36113..a4c1916c 100644 --- a/frontend/src/components/Main/OptionsForm/OptionsForm.js +++ b/frontend/src/components/Main/OptionsForm/OptionsForm.js @@ -10,6 +10,7 @@ import { } from "@/constants/optionsConstants"; import Button from "../../common/Button"; +import CheckboxInput from "../../common/CheckboxInput"; import FloatInput from "../../common/FloatInput"; import IntegerInput from "../../common/IntegerInput"; import SelectInput from "../../common/SelectInput"; @@ -99,6 +100,14 @@ const OptionsForm = props => { })} /> + + + props.saveOptions("estimate_background", value, props.idx) + } + /> + Covariate + Estimate Background Bootstrap
diff --git a/frontend/src/components/Main/OptionsForm/OptionsReadOnly.js b/frontend/src/components/Main/OptionsForm/OptionsReadOnly.js index c213996c..e28065f3 100644 --- a/frontend/src/components/Main/OptionsForm/OptionsReadOnly.js +++ b/frontend/src/components/Main/OptionsForm/OptionsReadOnly.js @@ -2,6 +2,7 @@ import PropTypes from "prop-types"; import React from "react"; import {getLabel} from "@/common"; +import {checkOrEmpty} from "@/common"; import { MODEL_CONTINUOUS, MODEL_DICHOTOMOUS, @@ -48,6 +49,7 @@ const OptionsReadOnly = props => { litterSpecificCovariateOptions )} + {checkOrEmpty(options.estimate_background)} {options.bootstrap_iterations} {options.bootstrap_seed} diff --git a/frontend/src/components/Output/OptionSetTable.js b/frontend/src/components/Output/OptionSetTable.js index 1399b8a9..de00d4a3 100644 --- a/frontend/src/components/Output/OptionSetTable.js +++ b/frontend/src/components/Output/OptionSetTable.js @@ -3,7 +3,7 @@ import {inject, observer} from "mobx-react"; import PropTypes from "prop-types"; import React, {Component} from "react"; -import {getLabel} from "@/common"; +import {checkOrEmpty, getLabel} from "@/common"; import {adverseDirectionOptions, allDegreeOptions} from "@/constants/dataConstants"; import {MODEL_CONTINUOUS, MODEL_DICHOTOMOUS} from "@/constants/mainConstants"; import { @@ -56,8 +56,6 @@ class OptionSetTable extends Component { ["BMR Type", getLabel(selectedModelOptions.bmr_type, dichotomousBmrOptions)], ["BMR", ff(selectedModelOptions.bmr_value)], ["Confidence Level (one sided)", ff(selectedModelOptions.confidence_level)], - ["Bootstrap Seed", selectedModelOptions.bootstrap_seed], - ["Bootstrap Iterations", selectedModelOptions.bootstrap_iterations], [ "Litter Specific Covariate", getLabel( @@ -65,6 +63,9 @@ class OptionSetTable extends Component { litterSpecificCovariateOptions ), ], + ["Estimate Background", checkOrEmpty(selectedModelOptions.estimate_background)], + ["Bootstrap Seed", selectedModelOptions.bootstrap_seed], + ["Bootstrap Iterations", selectedModelOptions.bootstrap_iterations], ]; } else if (outputStore.isMultiTumor) { rows = [ diff --git a/frontend/src/constants/optionsConstants.js b/frontend/src/constants/optionsConstants.js index ffad8365..9eef9b9a 100644 --- a/frontend/src/constants/optionsConstants.js +++ b/frontend/src/constants/optionsConstants.js @@ -25,6 +25,7 @@ export const options = { litter_specific_covariate: 1, bootstrap_iterations: 1000, bootstrap_seed: 0, + estimate_background: true, }, [MODEL_MULTI_TUMOR]: { bmr_type: 1, diff --git a/tests/analysis/test_validators.py b/tests/analysis/test_validators.py index ec860106..d5ab4f83 100644 --- a/tests/analysis/test_validators.py +++ b/tests/analysis/test_validators.py @@ -127,6 +127,7 @@ def test_nested_dichotomous(self, nested_dichotomous_datasets): "litter_specific_covariate": 1, "bootstrap_iterations": 1000, "bootstrap_seed": 0, + "estimate_background": True, } ] assert validators.validate_input(data, partial=True) is None