-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #2532 #2636
Fixes #2532 #2636
Conversation
eb4303a
to
898084f
Compare
c56bd91
to
27b6082
Compare
@ALL: This is a work in progress but this needs to be reviewed continuously here as I have to change quite a few things |
@@ -9,14 +27,25 @@ This parameterization does not differentiate the etiology of hepatic impairment. | |||
INSERT INTO tab_parameters(parameter_name,display_name,description,dimension,default_unit) VALUES('Child-Pugh score','Child-Pugh score','Child-Pugh score: A (5,6 points) | |||
Child-Pugh score: B (7-9 points) | |||
Child-Pugh score: C (10-15 points) ',NULL,NULL); | |||
INSERT INTO tab_parameters(parameter_name,display_name,description,dimension,default_unit) VALUES('Ontogeny factor GI table','Ontogeny factor GI table','Ontogeny factor GI table','Dimensionless',NULL); | |||
INSERT INTO tab_parameters(parameter_name,display_name,description,dimension,default_unit) VALUES('Ontogeny factor table','Ontogeny factor table','Ontogeny factor table','Dimensionless',NULL); | |||
INSERT INTO tab_parameters(parameter_name,display_name,description,dimension,default_unit) VALUES('Post menstrual age','Post menstrual age','Post menstrual age','Age in years',NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Yuri05 @rwmcintosh
I needed to add this parameter since the ontogeny table we load from the DB are not using Age but PMA in years. We have a weird estimated GA which is in fact PMA but the unit is in WEEKS?!?!?
src/PKSim.Assets/PKSim.Assets.csproj
Outdated
<PackageReference Include="OSPSuite.Assets" Version="12.0.191" /> | ||
<PackageReference Include="OSPSuite.Assets.Images" Version="12.0.191" /> | ||
<PackageReference Include="OSPSuite.Assets" Version="12.0.0-rfeaf" /> | ||
<PackageReference Include="OSPSuite.Assets.Images" Version="12.0.0-rfeaf" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
temp here
//for expression profile, all formula are in the calculation method EXPRESSION_PARAMETERS | ||
var formula = parameter.Formula; | ||
//for expression profile, all formula are in the calculation method EXPRESSION_PARAMETERS unless they are distributed table | ||
if (formula is TableFormula tableFormula) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have two parameters with a table formula. I am returning it as is for now. Wonder if this is a problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't see a problem. (Does not mean there isn't one, though 😆)
public void AddOntogenyParameterTo(IndividualMolecule molecule) | ||
public void AddAgeDependentOntogenyParametersTo(IndividualMolecule molecule) | ||
{ | ||
AddGlobalExpression(molecule, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding TWO parameters that are referencing the table formula
@@ -99,6 +118,56 @@ public double OntogenyFactorFor(Ontogeny ontogeny, string containerName, double? | |||
return _interpolation.Interpolate(allOntogenies.Select(x => new Sample(x.PostmenstrualAge, factorRetriever(x))), postmenstrualAgeInYearsFor(age, gestationalAge)); | |||
} | |||
|
|||
public DistributedTableFormula DataRepositoryToDistributedTableFormula(DataRepository ontogenyDataRepository) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is existing code that I moved from presenter here so that I could reuse. In short, it helps creating a table from an ontogeny selection
std.Values = values(allOntogenies, x => x.Deviation); | ||
return dataRepository; | ||
chart.AxisBy(AxisTypes.Y).GridLines = true; | ||
_simpleChartPresenter.Refresh(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was missing. Gridlines and caption were never updated!!
|
||
protected override void PerformExecute() | ||
{ | ||
var file = _dialogCreator.AskForFileToSave(_caption, Constants.Filter.PKML_FILE_FILTER, Constants.DirectoryKey.MODEL_PART, Subject.Name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was renamed. Took me a while to figure out why the default name was never set properly. It's because a parameter was missing and therefor, the suject.name was never used! /cc @rwmcintosh
|
||
protected override void PerformExecute() | ||
{ | ||
var file = _dialogCreator.AskForFileToSave(DialogCaption(), Constants.Filter.PKML_FILE_FILTER, Subject.Name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rwmcintosh see here, the 3 parameters is not the right one
@@ -41,6 +41,6 @@ public DistributionFormula CreateFor(IDistributionMetaData distribution, IDistri | |||
|
|||
public bool IsSatisfiedBy(IEnumerable<ParameterDistributionMetaData> distributions) => distributions.All(IsSatisfiedBy); | |||
|
|||
public bool IsSatisfiedBy(IDistributionMetaData distribution) => distribution.Distribution == DistributionTypes.Discrete; | |||
public bool IsSatisfiedBy(IDistributionMetaData distribution) => distribution.Distribution == OSPSuite.Core.Domain.Formulas.DistributionType.Discrete; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did that need to be expanded? Looks like the only change in the file.
It moved, but it can still be shorter I think.
@Yuri05 Can you please review this. Some major changes. Any questions, and suggestions, please create an issue so that we can address them |
It's an older issue and has nothing to do with this PR, but I wonder if the ontogeny export can be also fixed now: |
var mean = new DataColumn(dataRepository.Name, _dimensionRepository.Fraction, pma) {DisplayUnit = yUnit }; | ||
var std = new DataColumn(PKSimConstants.UI.StandardDeviation, _dimensionRepository.Fraction, pma) {DisplayUnit = yUnit}; | ||
mean.DataInfo.AuxiliaryType = AuxiliaryType.GeometricMeanPop; | ||
std.AddRelatedColumn(mean); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confused. Shouldn't it be mean.AddRelatedColumn(std)
??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confused too. I swapped it to try and it crashes
In this case the goal is to display area. So the idea is that it's not like for oba data where mean is the main curve with some extra info
In this case, the area is the main curve and the mean is the extra stuff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, ok...
|
||
var pma = new BaseGrid(PKSimConstants.UI.PostMenstrualAge, _dimensionRepository.AgeInWeeks) {DisplayUnit = xUnit }; | ||
var mean = new DataColumn(dataRepository.Name, _dimensionRepository.Fraction, pma) {DisplayUnit = yUnit }; | ||
var std = new DataColumn(PKSimConstants.UI.StandardDeviation, _dimensionRepository.Fraction, pma) {DisplayUnit = yUnit}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we name the STD column "Geometric standard deviation" instead of just "Standard Deviation" to become more clear?
#2666
* Fixes #2344 Implement "Parameter Value Export" for Expression Profiles BB in PK-Sim (#2442) * use GetAllChildren of Individual (#2445) * 2438 outptu mappings not cleared (#2444) * waiting for Core PR to be accepted * nugets updated * updating nuget * 2364 export expression profile domain object (#2461) * initial try * temp nuget update * adjusting mapper * Fixes #2344 Implement "Parameter Value Export" for Expression Profiles BB in PK-Sim (#2442) * use GetAllChildren of Individual (#2445) * 2438 outptu mappings not cleared (#2444) * waiting for Core PR to be accepted * nugets updated * updating nuget * temp nuget update * working export * spacing * updating packages * do not map object path for 'ROOT' * do not repeat formulae in the formula cache * adding tests * fixing test * correction * consolidate assets * correcting nugets * code review changes * code review * PR feedback * update core version * Appveyor builds turned on * PR feedback * pr feedback Co-authored-by: Robert McIntosh <[email protected]> * Fixes #2470 Refactor StartValues vs PathWithValueEntity (#2473) * 2475 expression profile from pksim (#2476) * #784_expression_profile_from_pksim * updating with mapper * Fixes #2475 Create expression profile from PK-sim * add dimensions as resource for tests * Add pkparameters for test project * add sqlite db * PR feedback * Fixes #2480 individual serialization (#2494) * work in progress * work in progress * Revise to map origin data as strings instead of keeping a common OriginData class * Update core and mapping of origin data * Testing the mapper * testing the mapper * revert an unintentional change * PR Feedback * Update core (#2502) * Fixes #2508 Do not export calculation methods with Individual when there is only one possible value (#2510) * Fixes #2508 Do not export calculation methods with Individual when there is only one possible value * PR feedback * PR feedback and update core * update core * update core osmoses (#2513) * update core (#2528) * Fixes update latest core (#2541) * 2525 creating individual from MoBi (PK-Sim code changes) (#2526) --------- Co-authored-by: Robert McIntosh <[email protected]> * Fixes #2534 Imported expression profile is not populated from the PKS… (#2548) * Fixes #2534 Imported expression profile is not populated from the PKSim Database * PR Changes * PR feedback * update core * Fixes #2552 Export of Expression profile to PKML - include initial conditions (#2554) * Update PKSIm with latest changes (#2555) * Fixes #2551 Use DevExpress skin to color grid cells (#2556) * No more psv (#2567) * Fixes #2439 Misleading info in global POP PK Analysis if no parameter… (#2459) * Fixes #2439 Misleading info in global POP PK Analysis if no parameters can be calculated * PR feedback * Fixes #2469 show hidden entities (#2488) * Fixes buil failing (#2489) * Fixes #2495 failing tests (#2499) * Fixes #2485 observed added mobi (#2500) * Fixes #2484 bug when exporting pop simulation (#2503) * Fixes #2275 #2279 #2277 by updating OSPSuite.Core (#2506) * Fixes #2405 mapping lost after configure (#2507) * Fixes #2255 resetting concentration issue (#2512) * Fixes #2255 resetting concentration issue * Small update to stay symetrical * Update MoleculeExpressionTask.cs * Modify the comment to reflect population Co-authored-by: Robert McIntosh <[email protected]> * update core (#2514) * Prepare for v11_1 (#2515) * Fixes #2516 Cannot run population simulations imported from pkml (#2517) * Fixes #2516 Cannot run population simulations imported from pkml * PR feedback * Fixes #2518 11.1 Cannot show PK-Analysis in a population simulations … (#2520) * Fixes #2518 11.1 Cannot show PK-Analysis in a population simulations imported from pkml * PR feedback * PR feedback * Updated OSPSuite.Core and OSPSuite.BuildingBlockTemplates (#2524) * Updated OSPSuite.Core and OSPSuite.BuildingBlockTemplates * Updated OSPSuite.Core again Co-authored-by: Yuri05 <[email protected]> * Update documentation v11.1 * Fixes #2553 pksim changes molecule name (#2561) * Fixes #2536 loading project from snapshot observed data (#2560) * Fixes #2536 loading project from snapshot observed data * Fixes #2536 loading project from snapshot observed data * Fixes #2536 loading project from snapshot observed data * Fixes #2558 project created with v10< do not export properly (#2559) * Fixes #2563 notification weird column no image data (#2564) * Try update core * Update to latest core * More work to make sure we can still load indiviudals * Remove creation of PSV for simulation * Fixes test project" * Fixes test project" * No more psv --------- Co-authored-by: Robert McIntosh <[email protected]> Co-authored-by: Juri Solodenko <[email protected]> Co-authored-by: Yuri05 <[email protected]> * Fixes #2570 Move IndividualToIndividualBuildingBlockMapper from presentation to core (#2572) * 2569 use individualbuildingblock and module from core (#2571) * WIP #2569 use Individual Building block and module from core * Some local variable rename. Build configuration not used anymore * Map also indiviudal and expression building block. Needs #2570 to compile * More work on #2569 to make test pass again: * Fixes #2569 use of individual building blocks * Fixes #2569 use individual building block and module from core * Fixes #2577 Exported expression profiles contains duplicate formulae (#2578) * 2584 update to support moduleconfiguration (#2585) * Fixes #2584 update to support module configuration * Fixes #2584 update to support module configuration * Make test pass again * 2586 parameters not common for all species (#2587) * Added views to DB * DB - adjusted naming of view and columns * Fixes #2586 Provide info which parameters are not common for all species * Fixes #2586 Provide info which parameters are not common for all species * review comments * Add serializer for the new dummy type --------- Co-authored-by: Yuri05 <[email protected]> * Fixes #2589 only export species indepednent parameters to spatial str… (#2591) * Fixes #2589 only export species indepednent parameters to spatial structure * Update to real DLLs * Fixes typo * Remove unused action * Fixes update core (#2593) * Fixes update core * Fixes weird definition * Update latest core (#2594) * update to core 12.0.170 (#2604) * Fixes #2596 implement hepatic impairment disease state (#2597) * WIP #2596 implement hepatic impairment disease state * More work on #2596 * More work on #2596 * More work on #2592 * Fixes #2596 implement hepatic impairement disease sate * Fixes #2596 * Fixes #2596 * Small update * Fixes merge conflict * 2615 overriding ref conc and applying hi should use the updated refconc (#2620) * Some rename first * Add test showing issue with #2615 * Update to algorithm to match specificaitons * Move logic of disease state to own view * Fixes #2615 overriding ref conc * Update DiseaseStateDTO.cs just a typo * Fixes failing test * Fixes #2615 overriding ref conc --------- Co-authored-by: Robert McIntosh <[email protected]> * Core updates (#2625) * Update to 12.0.178 * update to 12.0.178 * Update core * update core (#2629) * Fixes #2621. Fixes #2622 (#2630) * Fixes #2621. Fixes #2622 * Fixes #2621. Fixes #2622 * Fixes #2621 * update core (#2633) * Fixes #2624. Fixes #2623 (#2637) * Fixes #2638 cannot export HI to snapshot (#2639) * Fixes #2638 cannot export HI to snapshot * Update DiseaseState.cs make sure we use old way of namespacing * Update DiseaseStateMapper.cs * Update DiseaseStateMapper.cs * Fixes #2638. Use file scoped namespace * Fixes #2638 by reverting to namespace * 2632 errorvalue cannot be null parameter name source (#2641) * WIP #2632 * Fixes #2632 error value cannot be null * Also null for protocol mapper * Fixes #2643 when to show global pk analysis (#2644) * Fixes #2643 when to show global pk analysis * Fixes #2643 when to show global pk analysis * Could not let it go * 2627 no expression profiles created when exporting a simulation from pk sim to mobi (#2645) * Fixes #2627 no expression profiles created * Fixes #2627 no expression profiles created * Fixes type * Fixes update latest core (#2648) * 2640 export initial conditions for expressions as part of the expression profile (#2649) * Fixes #2640 Export initial conditions for expressions as part of the expression profile * Update core * separate MoleculeBuilders by their presence and definition in the individual * rename * refactor enumerable * PR feedback * remove dead starter tests project * core updated to 12.0.191. No diffbuilders with Dimension specified (#2652) * 2654 fix failing tests (#2655) * Fixes #2654 by removing support for version <7.0 * Fixes #2654 by removing support for version <7.0 * Fixes #2658 differences in simulations created by pk sim and mobi molecule types (#2659) * Too many molecules in molecules list for some observers * Do not change container observer type to Drug * Fixes #2532 (#2636) * WIP #2532 * fix using the wrong assertion * Add default parameters to all molecules * add parameter to actual proten * Also add the parmaeter values * add reference to tablews * WIP #2532 ontogeny factor in expression profile * WIP #2532 ontogeny factor * WIP #2532 ontogeny factor * Rename db field * Make PMA only human dependent * 2657 ontogeny factor is it dimensionless or fraction (#2662) * Fixes #2657 ontogeny factor dimensionless * Fixes #2657 * Fixes #2661 exception when using 2 pore simulations (#2663) * Fixes #2660 remove estimated ga and use PMA instead (#2664) * Fixes #2660 remove estimated ga and use PMA instead * Actual real formula * Fixes #2617 export to snapshot (#2665) * undo changes in appveryor * undo changes in appveryor * Update to latest core --------- Co-authored-by: Robert McIntosh <[email protected]> Co-authored-by: georgeDaskalakis <[email protected]> Co-authored-by: Juri Solodenko <[email protected]> Co-authored-by: Yuri05 <[email protected]>
@rwmcintosh Just starting