createLogFile() function

33 views
Skip to first unread message

Zuxi Cui

unread,
Aug 30, 2022, 11:58:37 AM8/30/22
to slim-discuss
Hi there,

I have an issue with the createLogFile() function.
Running the attached file ("fail.run.txt") gave me the following error:

"
ERROR (EidosInterpreter::Evaluate_Call): method createLogFile() is not defined on object element type Species.
Error on script line 54, character 10:
log = sim.createLogFile("./test.log",logInterval=1);
"
The createLogFile() function used to work fine in the WF model without reproduction.
I also attached another script ("success.run.txt") with a successful run and no error.

Terry

fail.run.txt
success.run.txt

Ben Haller

unread,
Aug 30, 2022, 12:10:36 PM8/30/22
to Zuxi Cui, slim-discuss
Hi Terry,

In SLiM 4.0 the createLogFile() method is now on the Community class, so you want to do:

community.createLogFile(...);

More broadly, the old SLiMSim class of SLiM 3.7.1 and earlier was split into two new classes in SLiM 4, Species and Community.  As discussed in the release notes for SLiM 4, the new SLiMgui provided in SLiM 4 knows how to autofix most of the resulting breaks in backward compatibility.  If you run your model under the new SLiMgui, it will say:

SLiMgui has found an issue with your script that it knows how to fix: The `createLogFile()` method has been moved to the Community class.  Would you like SLiMgui to automatically fix it, and then recycle?

And if you click Yes, it will fix your code for you.  Keep running your model until SLiMgui no longer finds any problems.  It is recommended that all users migrating from SLiM 3 to SLiM 4 run their model through SLiMgui to benefit from these automatic fixes.  (There are some less common cases where SLiMgui does not know how to autofix a break in backward compatibility, however, so you may still need to make some manual changes to your code; most users will not need to, though.)

I hope this helps; happy modeling!

Cheers,
-B.

Benjamin C. Haller
Messer Lab
Cornell University


Zuxi Cui wrote on 8/30/22 11:58 AM:
--
SLiM forward genetic simulation: http://messerlab.org/slim/
---
You received this message because you are subscribed to the Google Groups "slim-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to slim-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/slim-discuss/CAB03vn_M48q%2BDamTn0YSdXNZrEO93i7f3GNFxZUaicUKbiWCAg%40mail.gmail.com.

Zuxi Cui

unread,
Aug 30, 2022, 1:42:41 PM8/30/22
to Ben Haller, slim-discuss
I see. Thanks for making it clear.

I have one more question. It's about recombination. Does SLiM support position-specific recombination rate now?
i.e., Can I input a genetic map with different recombination rates at different loci?

Terry

Ben Haller

unread,
Aug 30, 2022, 1:55:34 PM8/30/22
to Zuxi Cui, slim-discuss
Yes; see section 6.1 of the manual.  This is also covered in the SLiM Workshop, which is free and available online; I highly recommend working through it.  Good luck!


Cheers,
-B.

Benjamin C. Haller
Messer Lab
Cornell University


Zuxi Cui wrote on 8/30/22 1:42 PM:

Zuxi Cui

unread,
Aug 30, 2022, 2:06:56 PM8/30/22
to Ben Haller, slim-discuss
Great, thanks! 
Reply all
Reply to author
Forward
0 new messages