Simple bottleneck model folded SFS

1,289 views
Skip to first unread message

DiedeMaas

unread,
Aug 14, 2017, 10:21:51 AM8/14/17
to fastsimcoal
Hi all,

I am trying to get a feel for fastsimcoal2 by running the simple bottleneck demographic history estimation example from the manual with my own data.

I have SNP data from 761014 ddRAD loci of one population with 16 diploid individuals sampled. I ran ANGSD to create the folded SFS of this population as I have no reference. I have made a *_MAFpop0.obs file containing the 16 values from SFS, and copied the .tpl and .est files from the example (changing only the sample size to 16, and the number of independent loci to 761014).

I ran it exactly as indicated in the manual. However, when I try to run with *_MAFpop0.obs it throws the error that it needs a *_DAFpop0.obs file. It does want to run if I rename the file to *_DAFpop0.obs, but that does not seem correct to me. Furthermore, after this run, unlikely estimations for NCUR, NANC, NBOT and TBOT come out of the simulations (based on what I know of the system).

Now my questions are:

1) Does anyone know how to get the *_MAFpop0.obs to run? I think I've read somewhere in this forum that a new version of FSC may be required, but is that already up and running?
2) Is the input I use correct? (e.g. setting the sample size to 16 and the independent loci to 761014)?
3) Is there something else I'm doing wrong? It seems like I should be able to get this relatively easy scenario to run..

I think I am a bit late to the game, since I've read similar questions - but I could not find a clear answer. Sorry for the long post..

Thanks for your help!

Diede

Laurent Excoffier

unread,
Sep 13, 2017, 8:25:54 AM9/13/17
to fastsimcoal
what command line are you using ?
Please include yout tpl, est, and obs files, as well... else it is difficult to see what could be wrong
L

died...@gmail.com

unread,
Sep 18, 2017, 9:46:17 AM9/18/17
to fastsimcoal
Dear Laurent,

Of course - my apologies. I should have included that before.

My command line was as follows:

./ fsc25 -t MIS01.tpl -n 100000 -N 100000 -d -e MIS01.est -M 0.001 -l 10 -L 40 -q

Here is my MIS01.tpl file:

//Number of population samples (demes)
1
//Population effective sizes (number of genes)
NCUR
//Sample sizes
16
//Growth rates : negative growth implies population expansion
0
//Number of migration matrices : 0 implies no migration between demes
0
//historical event: time, source, sink, migrants, new size, new growth rate, migr. matrix
2 historical event
TBOT 0 0 0 RESBOT 0 0
TENDBOT 0 0 0 RESENDBOT 0 0
//Number of independent loci [chromosome]
761014 0
//Per chromosome: Number of linkage blocks
1
//per Block: data type, num loci, rec. rate and mut rate + optional parameters
FREQ 1 0 1e-8 OUTEXP

And my MIS01.est file:

// Priors and rules file
// *********************

[PARAMETERS]
//#isInt? #name #dist.#min #max
//all Ns are in number of haploid individuals
1 NCUR unif 1 1000000 output
1 NANC unif 10 1000000 output
1 NBOT unif 1 100000 output
1 TBOT unif 10 20000 output

[RULES]

[COMPLEX PARAMETERS]
0 RESBOT = NBOT/NCUR hide
0 RESENDBOT = NANC/NBOT hide
1 TENDBOT = TBOT+100 hide

Finally, in the same folder I had the MIS01_DAFpop0.obs file:

1 observations
d0_0 d0_1 d0_2 d0_3 d0_4 d0_5 d0_6 d0_7 d0_8 d0_9 d0_10 d0_11 d0_12 d0_13 d0_14 d0_15 d0_16
17951.829155 9375.241337 5762.487027 3899.558690 2700.043512 2154.752094 1551.260460 1478.697152 1193.544391 1042.301152 960.853584 905.767890 851.242172 802.420349 759.285925 572.018981

Best, Diede

Laurent Excoffier

unread,
Oct 9, 2017, 4:37:15 AM10/9/17
to fastsimcoal
Hi

I see two problems
1) command line:

    it should be 

    ./fsc25 -t MIS01.tpl -n 100000 -N 100000 -m -e MIS01.est -M 0.001 -l 10 -L 40 -q

2) tpl file

   Replace 
   //Number of independent loci [chromosome]
   761014 0

   by

   //Number of independent loci [chromosome]
   1 0

Hope it helps

laurent

Han Xiao

unread,
Nov 9, 2020, 7:04:21 AM11/9/20
to fastsimcoal
Hi Laurent and  Diede,

I would love to interact with your case asking about the number of sample sizes 
used in the tpl file for demographic scenario modeling. 
You mentioned that you have 16 diploid individuals of that populations and in the 
tpl file you wrote Sample sizes as 16. However should I write the haploid size as 
32 for the sample sizes or keep it the same as diploid size as 16? I didn't find clear 
indication in the manual but I see both cases used by people so I got a bit confused.
Thank you very much!

Best regards,
Han Xiao 

Jenna Grimshaw

unread,
Apr 21, 2022, 2:47:28 PM4/21/22
to fastsimcoal2
I am also curious about this.  If you have 16 diploid individuals, should sample size be 16 or 32?

zengqiang xia

unread,
Apr 26, 2024, 11:15:18 AM4/26/24
to fastsimcoal2
hello,I am also curious about this.  If you have 16 diploid individuals, should sample size be 16 or 32?

Sarah Wells

unread,
Sep 2, 2025, 9:01:41 PM (6 days ago) Sep 2
to fastsimcoal2
Just thought I would reply to this thread as I see this issue has come up multiple times with no answer. I had the same question and found this https://evomics.org/wp-content/uploads/2020/01/WSPG_CeskyKrumlov_NotesFscInputFiles.pdf  where it states that the sample size is the number of gene copies. Therefore, for a diploid organism it should be 2*number of individuals. So in the example above, 32 should be entered. 
I hope this helps anyone else having the same question.
Sarah
Reply all
Reply to author
Forward
0 new messages