christianparobek / skeleSim

Null models, performance testing, and power estimation with population simulations
3 stars 6 forks source link

growth.rate not a slot in fastsimcoal.params #56

Closed christianparobek closed 8 years ago

christianparobek commented 8 years ago

On three different computers (2 Ubuntu, 1 Windows) I'm getting the following error:

> skeleSimGUI()

Listening on http://127.0.0.1:5513
Warning: Error in <Anonymous>: ‘growth.rate’ is not a slot in class “fastsimcoal.params”
Stack trace (innermost first):
    49: <Anonymous>
    48: fastsimcoalInit [/home/christian/R/x86_64-pc-linux-gnu-library/3.3/skeleSim/shiny/skeleSimShinyGUI/global.R#74]
    47: ssClassInit [/home/christian/R/x86_64-pc-linux-gnu-library/3.3/skeleSim/shiny/skeleSimShinyGUI/global.R#66]
    46: reactiveValues
    45: eval [serverInit.R#11]
    44: eval
    43: withVisible
    42: source
    41: server [/home/christian/R/x86_64-pc-linux-gnu-library/3.3/skeleSim/shiny/skeleSimShinyGUI/server.R#7]
     2: runApp
     1: skeleSimGUI
Error in (function (cl, name, valueClass)  : 
  ‘growth.rate’ is not a slot in class “fastsimcoal.params”

Going to try and track it down now, but posting it in case it rings bells with anyone else.

christianparobek commented 8 years ago

Error message tracks it down to skeleSim/shiny/skeleSimShinyGUI/global.R#74, which has:

fastsimcoalInit <- function(np){ #np num populations
    parms <- new("fastsimcoal.params")
    parms@growth.rate <- rep(0,np)
    parms@sample.times <- rep(0L,np) #must be integer
    parms
}

Seems to be the offending region. Perhaps this is an old code bit that needs to be removed or we need to go back and make the megalist object-maker function produce a fastsimcoal.params slot?

EricArcher commented 8 years ago

No, this needs to be read from a new object now. A while ago, I changed the way fastsimcoal parameters were specified, and both of these are in the pop.info matrix of the fastsimcoal class. Let me know if you want me to switch it or if you can work it out on your own.

stranda commented 8 years ago

I thought that we left these two slots in the fsc class after all. Even though strataG uses the new pop object. I create the pop object to be used in fastsimcoal() when the simulation gets run. This greatly simplified the interface. Did including these two slots cause the package to not pass checks?

christianparobek commented 8 years ago

Eric is it easy for you to switch it?

EricArcher commented 8 years ago

No problem. I'll put them back in now and document them in such a way that it passes the checks.

EricArcher commented 8 years ago

Done: growth.rate and sample.times moved back to scenario.params class and documented.

christianparobek commented 8 years ago

Great thanks! Reinstalled from github, but when run skeleSimGUI() I get the same stack trace as before. Perhaps I'm overlooking something?

EricArcher commented 8 years ago

Oh, I see the issue. Allan, you are assigning default values to @growth.rate and @sample.times as slots in a fastsimcoal.params object in global.R. Shouldn't these be slots in the scenario.params object?

EricArcher commented 8 years ago

Ignore the last - I'm adding both back to fastsimcoal.params. Sorry for the confusion - I'm jumping between three different projects now, and balls are getting dropped.

EricArcher commented 8 years ago

growth.rate and sample.times added back to fastsimcoal.params. Error should be gone now.