Skip to content
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

Mass balance plots: configurable splitting #1118

Closed
Yuri05 opened this issue Sep 8, 2023 · 9 comments
Closed

Mass balance plots: configurable splitting #1118

Yuri05 opened this issue Sep 8, 2023 · 9 comments

Comments

@Yuri05
Copy link
Member

Yuri05 commented Sep 8, 2023

At the moment, the compartments which are used for the summation of the drug amounts are fixed.

Example

grafik

The user wish to allow the definition of groups of container/molecules which should be summed up and displayed in the mass balance plots.

For each plot, it should be possible to specify all {container, molecule} combinations which should appear in the plot (and give a name to every such combination).

E.g., if in my model there are 2 compounds: C1 and C2 and 1 metabolite per compound (C1-CYP3A4-Metabolite and C2-CYP3A4-Metabolite), it should be possible to define the grouping like this:

  • Plot 1
    • C1 and C1-CYP3A4-Metabolite in every plasma/interstitial/intracellular/blood cells compartments - except for brain
    • C1 and C1-CYP3A4-Metabolite in every plasma/interstitial/intracellular/blood cells compartments of the brain
    • C1 in feces and urine
    • C1 in the rest of the system (= all containers which are not included into the previous definitions)
  • Plot2 (same groping as plot 1, but for C2 and C2-CYP3A4-Metabolite)

Possible specification for such a grouping:

  • List of mass balance plot configurations. Each configuration has the properties:
    • Name of the plot (to be displayed in the report)
    • List of subgroupings. Each subgrouping has the properties:
      • Name of the subgrouping (to be displayed in the report)
      • List of paths to include. Each path in the ospsuite-R recognizable format (using the wildcards * and ** ). Must contain at least one entry
      • List of paths to exclude. Each path in the ospsuite-R recognizable format. May be empty.
    • "Rest"-subgroup with the properties:
      • Name to be used in the report
      • List of the molecule names
Json code for the mass balance settings for the example above

grafik

{
  "Mass balance plots": [
    {
      "Name": "C1 mass balance",
      "Groupings": [
        {
          "Name": "Brainless",
          "Include": [
            "Organism|**|Plasma|C1*",
            "Organism|**|Interstitial|C1*",
            "Organism|**|Intracellular|C1*",
            "Organism|**|BloodCells|C1*"
          ],
          "Exclude": [
            "Organism|Brain|*|C1*"
          ]
        },
        {
          "Name": "Brain",
          "Include": [
            "Organism|Brain|*|C1*"
          ]
        },
        {
          "Name": "Excreted",
          "Include": [
            "Organism|Kideny|Urine|C1*",
            "Organism|Lumen|Feces|C1*"
          ]
        }
      ],
      "Rest": {
        "Name": "Rest of C1",
        "Molecules": [
          "C1"
        ]
      }
    },
    {
      "Name": "C2 mass balance",
      "Groupings": [
        {
          "Name": "Brainless",
          "Include": [
            "Organism|**|Plasma|C2*",
            "Organism|**|Interstitial|C2*",
            "Organism|**|Intracellular|C2*",
            "Organism|**|BloodCells|C2*"
          ],
          "Exclude": [
            "Organism|Brain|**|C2*"
          ]
        },
        {
          "Name": "Brain",
          "Include": [
            "Organism|Brain|*|C2*"
          ]
        },
        {
          "Name": "Excreted",
          "Include": [
            "Organism|Kideny|Urine|C2*",
            "Organism|Lumen|Feces|C2*"
          ]
        }
      ],
      "Rest": {
        "Name": "Rest of C2",
        "Molecules": [
          "C2"
        ]
      }
    }
  ]
}
@Yuri05
Copy link
Member Author

Yuri05 commented Sep 8, 2023

@msevestre @pchelle @KatrinCoboeken @sfrechen @AnnikaRPS Thoughts/Comments?

@KatrinCoboeken
Copy link

Looks good

@pchelle
Copy link
Collaborator

pchelle commented Sep 14, 2023

Looks also good to me.
I think the grouping should be defined as a Json file format.
This way it may be easier for the user to re-use it and the workflow can directly read and translate it.

I'll draft a template example to illustrate.

@pchelle
Copy link
Collaborator

pchelle commented Oct 3, 2023

Here is a template that was inspired from plotMeanMassBalance() and that would leverage the json input

mass-balance.zip

@Yuri05
Copy link
Member Author

Yuri05 commented Oct 3, 2023

Looks good!
Just one remark:
Exclude section in the "Rest" grouping is redundant. It is the union of the Include sections of all other groupings.
We should provide a flag which indicates that the rest group is.. well, the rest group.
E.g. something like this:

{
    "Name": "Rest of Raltegravir",
    "ExcludeOtherGroupings": 1,
    "Include": [
        "Organism|**|Raltegravir*"
    ]
}

It would be still possible to define additional Exclude-conditions in the rest group ig required - which would be then combined with the includes from all other groups, e.g.

{
    "Name": "Rest of Raltegravir",
    "ExcludeOtherGroupings": 1,
    "Include": [
        "Organism|**|Raltegravir*"
    ],
    "Exclude": [
        "Organism|Applications|*|Raltegravir*"
    ]
}

@pchelle
Copy link
Collaborator

pchelle commented Oct 4, 2023

I like the idea, I would even go further and use a ExcludePreviousGroupings.
If undefined, default would be always TRUE for all the groupings, this way it should prevents redundant groupings unless the user specifically asks for it.
Thoughts ?

@pchelle
Copy link
Collaborator

pchelle commented Oct 4, 2023

I did not discuss the integration, in my opinion, the best way to integrate this is within the SimulationSet objects (that could perform a few checks beforehand - such as checking that the molecules exist in the simulation).

@Yuri05
Copy link
Member Author

Yuri05 commented Oct 5, 2023

I like the idea, I would even go further and use a ExcludePreviousGroupings. If undefined, default would be always TRUE for all the groupings, this way it should prevents redundant groupings unless the user specifically asks for it. Thoughts ?

fine for me :)

@Yuri05
Copy link
Member Author

Yuri05 commented Oct 5, 2023

I did not discuss the integration, in my opinion, the best way to integrate this is within the SimulationSet objects (that could perform a few checks beforehand - such as checking that the molecules exist in the simulation).

it should be a setting of Mass Balance Task.
If Mass Balance Task is not active - there is no need to check the configuration of the groupings.

EDIT: after discussion - SimulationSet is better location for the MassBalance options (as the simulations in different SimulationSets can e.g. have different compounds)

@Yuri05 Yuri05 removed this from v12 Oct 5, 2023
pchelle added a commit to pchelle/OSPSuite.ReportingEngine that referenced this issue Nov 7, 2023
@Yuri05 Yuri05 closed this as completed in 09c4076 Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants