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

Missing Y2 in plots of Qualification Report (Workflow.R) #934

Closed
GhazalMontaseri opened this issue Sep 27, 2022 · 23 comments
Closed

Missing Y2 in plots of Qualification Report (Workflow.R) #934

GhazalMontaseri opened this issue Sep 27, 2022 · 23 comments

Comments

@GhazalMontaseri
Copy link

I tried to generate the qualification report for Fluconazole model based on files provided here:
https://github.com/Open-Systems-Pharmacology/Fluconazole-Model

However, instead of Workflow.m I have used workflow.R as described here:
https://www.open-systems-pharmacology.org/OSPSuite.ReportingEngine/articles/qualification-workflow.html#template

I have PK-Sim portable version 11 and latest version of 'QualificationRunner'. The issue is in concentration-time profiles with double Y axes like Y and Y2 (like the third plot in section 3.3.1), I got a plot with only Y and not both Y and Y2. Can you please help me with this issue?

@Yuri05
Copy link
Member

Yuri05 commented Sep 28, 2022

@GhazalMontaseri
Copy link
Author

GhazalMontaseri commented Sep 28, 2022

This is my plot, both observations and model prediction on Y2 axis are missing.

no_Y2

it seems that my issue is not specific only for the fluconazole report but for a simple template
https://github.com/Open-Systems-Pharmacology/Evaluation-plan-template

when I add a second plot on Y2, I cannot get it in the generated pictures from the reporting engine.

@pchelle
Copy link
Collaborator

pchelle commented Sep 29, 2022

This is a limitation of the current versions of {ospsuite.reportingengine} and {tlf} packages that cannot handle Y2 axis yet.
For this reason, every data on Y2 axis are skipped in the figure.
As a workaround, I suggest to plot the data in Y2 axis as a separate figure.

@GhazalMontaseri
Copy link
Author

GhazalMontaseri commented Sep 29, 2022

Thanks Pierre for your answer. May I ask if this is a limitation only for R users (worflow.R)? because in the original qualification report which was generated using Matlab (workflow.m) Y2 exists.

https://github.com/Open-Systems-Pharmacology/OSP-PBPK-Model-Library/tree/master/Fluconazole

One option as you said is separating the plots, but Do you think using Matlab instead of R is also an option to solve this issue?

@pchelle
Copy link
Collaborator

pchelle commented Sep 29, 2022

Yes, it is currently a limitation for R users only.
Matlab can handle Y2 axis, so using Matlab instead of R may be an option as well.
However, I don't know if there could be compatibility issues with between Matlab and latest OSPSuite versions.
@Yuri05 may have more insight about this aspect

@GhazalMontaseri
Copy link
Author

GhazalMontaseri commented Sep 30, 2022

thanks a lot Pierre, may I ask:

  1. if you have a plan to solve it for R users?
  2. where I may find instructions for generating a qualification report based on MATLAB?
    Thanks in advance for your supports

@pchelle
Copy link
Collaborator

pchelle commented Oct 3, 2022

@Yuri05 , please correct me if I am wrong

1. if you have a plan to solve it for R users?

Yes, we intend to add the Y2 axis feature for time profile plots. However, I don't know in terms of timeline exactly when we will fix that.

2. where I may find instructions for generating a qualification report based on MATLAB?

You will find the instructions for using the Matlab qualification framework here

@GhazalMontaseri
Copy link
Author

Hello Pierre, thanks for your supports. For the moment, I switch to MATLAB.
My questions is how can I install 'Reporting engine 3.0.1.53' as MATLAB source code library (alternative no. 1 according to the link you have sent me)? There is no .exe file for installation.
When I run the 'Workflow.m' file, it calls many functions and since they are not at the same folder as 'workflow.m' or the library is not installed I get errors saying 'unrecognize function or variable ....'

thanks for your supports.

@Yuri05
Copy link
Member

Yuri05 commented Oct 7, 2022

@GhazalMontaseri Matlab Reporting Engine is just zipped Matlab source code .
You need to unzip it and add the Folder with the source Code (with subfolders) to the Matlab search path

@GhazalMontaseri
Copy link
Author

thank you so much Juri, I used ''addpath'' command to add all subfolders to the search path.

@GhazalMontaseri
Copy link
Author

@Yuri05 Hello Yuri, may I ask if in the new release, adding the Y2 axis feature for time profile plots in the qualification report workflow.R, has been resolved?

@Yuri05
Copy link
Member

Yuri05 commented Feb 20, 2023

Hello @GhazalMontaseri , this will be fixed in the next release, which will be hopefully available till the end of March.

pchelle added a commit to pchelle/OSPSuite.ReportingEngine that referenced this issue Feb 20, 2023
…al axis in time profiles

Also Fixes Open-Systems-Pharmacology#985

The fix requires PR [407](Open-Systems-Pharmacology/TLF-Library#407) from tlf package and might have side effects on the legend order of other plots performed by the reporting engine
@Yuri05 Yuri05 closed this as completed in a396c41 Feb 24, 2023
@Yuri05
Copy link
Member

Yuri05 commented Mar 13, 2023

Dear @GhazalMontaseri , new release with the fixed Y2-issue is available now:
https://github.com/Open-Systems-Pharmacology/QualificationPlan/releases/tag/v3.1

@GhazalMontaseri
Copy link
Author

Thanks @Yuri05 .

@GhazalMontaseri
Copy link
Author

Hello @Yuri05, can you please help me how I may modify/increase size of points in the generated Gof plots from the qualification report? As you see below the points are very small.
2_gof_plot_predictedVsObserved

@Yuri05
Copy link
Member

Yuri05 commented May 10, 2023

Hi @GhazalMontaseri ,
try to use the new default theme:

...
setDefaultThemeFromJson("C:/Temp/re-theme.json")
workflow$runWorkflow()
...

If the symbol size is still too small, you can modify the downloaded theme file and increase it, e.g.
grafik

@Yuri05
Copy link
Member

Yuri05 commented May 10, 2023

You can also modify the theme properties programmatically, s.
https://www.open-systems-pharmacology.org/OSPSuite.ReportingEngine/articles/plot-settings.html

E.g.

...
jsonFile <- system.file("extdata", "re-theme.json",  package = "ospsuite.reportingengine")
reTheme <- tlf::loadThemeFromJson(jsonFile)
reTheme$plotConfigurations$plotObsVsPred$points$size=8
setDefaultTheme(reTheme)

workflow$runWorkflow()
...

@Yuri05
Copy link
Member

Yuri05 commented May 10, 2023

Please note, that those changes are global and will apply to all workflows which are executed after the setting of the new theme.
Plot settings can also be changed locally only for the workflow being executed. However not all such settings are (easily) accessible.
E.g. I don'r know how to change the symbol size for the GOF plots of the given workflow. Maybe @pchelle could advice.

@GhazalMontaseri
Copy link
Author

Hello @Yuri05 , I tried this in my workflow.R:

jsonFile <- system.file("extdata", "re-theme.json", package = "ospsuite.reportingengine")
reTheme <- tlf::loadThemeFromJson(jsonFile)

reTheme$plotConfigurations$plotObsVsPred$points$size=8 --> for GoF plots
reTheme$plotConfigurations$plotTimeProfile$points$size=40 --> for time profiles

setDefaultTheme(reTheme)
workflow$runWorkflow()

However, while point size in the GoF plot has been increased this is not the case for the time profile plot (second Y-axis has some points but very small)
2_gof_plot_predictedVsObserved

1_time_profile_plot_Rifampicin_Midazolam_DDI_test_DDI_Treatment___Rifampicin_Midazolam___Yu_2004__CYP3A5_s3_s3__parameters

@Yuri05
Copy link
Member

Yuri05 commented May 22, 2023

However, while point size in the GoF plot has been increased this is not the case for the time profile plot (second Y-axis has some points but very small)

It's a bug :(

You can try the latest development version of the reporting engine where this bug was fixed.
For this, you need to install some CRAN packages first:

  • showtext
  • sysfonts
  • data.table
  • svglite

Then install the latest development version of the OSP packages:

@GhazalMontaseri
Copy link
Author

Thanks @Yuri05 , any plan to release the validated reporting engine package with this bug being fixed in near future?

@Yuri05
Copy link
Member

Yuri05 commented May 25, 2023

Hopefully till the end of summer

@GhazalMontaseri
Copy link
Author

GhazalMontaseri commented Aug 7, 2024

Hello @Yuri05,
any update on release of reportingEngine package in which the issues with Y2 (dual axes), size of points, and plot of time profiles with no observated data ( #1082) have been solved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Verified
Development

No branches or pull requests

3 participants