easily output the 1D SFS per mutation type (as in the GUI)

83 views
Skip to first unread message

annabel....@gmail.com

unread,
Jan 22, 2021, 7:55:50 PM1/22/21
to slim-discuss
Hi there,
Thanks for all the wonderful updates to SLiM! Is there now a simple way to output the 1D SFS per mutation type for a sample from the subpopulation? It's great that we can now plot the population's SFS in the GUI and export the data, but for production-scale I'd love to get that directly from my slim script and also be able to control the sample size. I used to do this via post-processing of standard slim output and can fall back to that, but would love to do it more efficiently if possible :) Apologies if I've missed an obvious recipe somewhere!

Thanks for your advice!
Cheers,
Annabel Beichman
----------------------------------------------------------------------------------------------------------------------------------------
This is the kind of output I'd like to write out as part of the script (but only for a sample of individuals):
(SFS for 10 genomes)
"m1", 0.9444, 0.0278, 0.0278, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000
"m2", 0.9138, 0.0259, 0.0259, 0.0086, 0.0172, 0.0000, 0.0000, 0.0086, 0.0000, 0.0000
"m3", 0.8276, 0.1034, 0.0345, 0.0172, 0.0172, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000

Ben Haller

unread,
Jan 22, 2021, 8:33:55 PM1/22/21
to slim-discuss
Hi Annabel.  Sorry, the plots in SLiMgui are only in SLiMgui; there's no way to generate the same data in SLiM at the command line.  This is a bit unfortunate, I realize; but the plotting code is connected up to the GUI stuff and would be somewhat hard to extract out, and it often uses the Qt library for some of its work (which is not a compile dependency for command-line SLiM), and sometimes the plots even switch on additional data collection inside SLiM that would slow down command-line runs.  So, it's complicated.  :->  Probably best for you to stick to the code you've been using.  :->

Regarding controlling the sample size, note that you can do that in SLiMgui's "action menu" – the gear button in the graph window's lower right.  Also note that you can copy the data that a SLiMgui plot is based on to the clipboard, again using that "action menu".  But of course these features are not so useful to you if you need to do it in code anyway.  :->

If you'd like to open an issue on GitHub for providing this type of data in command-line SLiM, I'll certainly consider that for the next major update!

Cheers,
-B.

Benjamin C. Haller
Messer Lab
Cornell University
Reply all
Reply to author
Forward
0 new messages