OskarHansson / pcrsim

An R package for simulation of the forensic DNA process
https://sites.google.com/site/forensicapps/pcrsim
2 stars 1 forks source link

Error with 'view result...' options in pcrsim GUI #1

Closed petergreen5678 closed 4 years ago

petergreen5678 commented 4 years ago

I am following the example workflow at https://sites.google.com/site/forensicapps/pcrsim precisely. [On installation, I did indeed have to install gWidgetsRGtk2 as suggested.]All works as expected, for both the "Simulate your first profile" and "Simulate your first mixture profile" recipes, except for the very final step: "Use the two buttons View result of the DNA process and View result after capillary electrophoresis to view details like true profiles and peak heights.", which both generate the error report:

Loading required package: gWidgets2RGtk2 Error in UseMethod(".gwindow") : no applicable method for '.gwindow' applied to an object of class "c('guiWidgetsToolkitRGtk2', 'guiWidgetsToolkit')" In addition: Warning message: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, : there is no package called ‘gWidgets2RGtk2’

It seems that both buttons are still referencing the wrong version of the GUI toolkit. Can you advise please? As a work around, is there a way to access the true profiles and peak heights from the console window?

I am using 32-bit R for Windows version 3.6.1. Packages downloaded from CRAN this afternoon.

Thanks, Peter Green

OskarHansson commented 4 years ago

Hi Peter,

The solution is probably to install.packages("gWidgets2RGtk2", dependencies=TRUE) NB! gWidgets2, which is the package used by strvalidator since version 2. pcrsim use the view function from strvalidator which I believe is causing the error. Let me know if this does not solve your problem.

The simulated result is stored internally in a variable defined here: https://github.com/OskarHansson/pcrsim/blob/9afc33c91434938321d171d6cd4eb95a6a8059cd/R/pcrsim.r#L84

You could create your own modified version of pcrsim that dumps the data in the global environment using assign.