simple simulations problems and option --foldedSFS

917 views
Skip to first unread message

Guillaume Dumont

unread,
Jan 9, 2018, 11:16:04 AM1/9/18
to fastsimcoal

Dear fsc community,

I want to run very simple simulations on a population (WGS data, millions of SNPs) using fsc26. I generated the folded SFS for this population with ANGSD (.obs file attached) and generated simple .est and .tpl file (also attached) just like in the examples of the manual.

But then, fsc26 is running only when I add the option --foldedSFS. In the manual, it is said about this option:
"Computation of MAF 1D and 2D SFS with option --foldedSFS by simply folding the corresponding unfolded SFS (for compatibility with angsd, where the minor allele is computed separately for each SFS)"
But as my SFS is already folded, I am not sure of what the option is doing... Should I use this option, does it solve my problem? Or should I look for another solution?   

If I don't add the option, I get the following error message : "Observed data file ("../ME_0miss_WG_Exp_jointDAFpop0_0.obs") does not seem to be present".
My command line is the following: ../../fsc26 -t ME_0miss_WG_Exp.tpl -e ME_0miss_WG_Exp.est -n 10000 -d -M -m -L 10 -q

Hopping that I clearly explained my problem, thank you in advance for your answer,
Best regards,
Guillaume
ME_0miss_WG_Exp_MAFpop0.obs
ME_0miss_WG_Exp.tpl
ME_0miss_WG_Exp.est

Laurent Excoffier

unread,
Jan 9, 2018, 6:11:50 PM1/9/18
to fastsimcoal
Hi,

you should estimate parameters either form the folded (-m) or unfolded (-d) SFS and not from both.
Since you have the -d parameter defined in your command line, fsc tries to find an unfolded sfs...
with the --foldedSFS explicit option it does not look for an unfolded SFS, hence the absence of an error message.
However the folded SFS is computed differently with or without the --foldedSFS if there are more than 2 populations. If there is one or two populations, the --foldedSFS option assumes the same SFS as without it.

L

Guillaume Dumont

unread,
Jan 10, 2018, 4:51:46 AM1/10/18
to fastsimcoal
Hi,

Thanks a lot for the quick answer! And sorry for this question which was a quit stupid mistake from me ! My simulations are know working correctly except one: the one to simulate the fact that a proportion of the genome of my focal population (pop 0) come from a ghost population (pop 1).
When running the simulation with this tpl:
//Number of population samples (demes)
2
//Population effective sizes (number of genes)
NPOP1
NPOP2
//Samples sizes and samples age
20
0
//Growth rates    : negative growth implies population expansion
0
0
//Number of migration matrices : 0 implies no migration between demes
0
//historical event: time, source, sink, migrants, new deme size, new growth rate, migration matrix index
1 historical event
TMIGR 0 1 PROP 1 0 0
//Number of independent loci [chromosome]
1 0
//Per chromosome: Number of contiguous linkage Block: a block is a set of contiguous loci
1
//per Block:data type, number of loci, per generation recombination and mutation rates and optional parameters
FREQ  1   0   2.5e-8 OUTEXP

And this est:
// Search ranges and rules file
// ****************************

[PARAMETERS]
//#isInt? #name   #dist.#min  #max
//all Ns are in number of haploid individuals
1  NPOP1       logunif  1000   1e7   output
1  NPOP2       logunif  1000   1e7   output
1  TMIGR    unif  10     1e5   output
1  PROP       unif  0     0.9   output
 
[RULES]

[COMPLEX PARAMETERS]

I got only this message for ever : "Migration to an inactive deme (1)".
I think my historical event (TMIGR 0 1 PROP 1 0 0) is correct as backward in time my source population is well pop 0 my focal population and my sink is well pop 1 my ghost population. Nevertheless if I reverse the order of my source and sink population (so TMIGR 1 0 PROP 1 0 0) the simulation is running, but if I understand correctly this last simulation is not doing what I want, am I right? What could be my mistake? Or I don't understand correctly the manual and it is not possible to do that with fsc?

Thanks again,
Guillaume

nicolas....@gmail.com

unread,
Jan 11, 2018, 5:22:12 AM1/11/18
to fastsimcoal
Hi Guillaume,

Not sure if the is the origin of the error, but on your est file you wrote PROP as in integer, fsc would pick only 0 as migration rate and your ghost pop would keep being inactive.

Nicolas

Guillaume Dumont

unread,
Jan 11, 2018, 8:26:52 AM1/11/18
to fastsimcoal
Hi,

Thanks a lot, it was apparently the origin of this error ! But I have now a new one: when running fsc I got this error message, 
"Simulations did not converge. MRCA not found! (2 lineages remaining)
Num. steps in coalescent process: 1000001
Bad parameters leading to non-convergent coalescent are written in file ME_0miss_WG_migr_bad.par"
The file ME_0miss_WG_migr_bad.par is empty and my model is so simple that I don't understand from where this new problem is coming ... If you have any idea ?

Thanks,
Guillaume

Laurent Excoffier

unread,
Jan 11, 2018, 2:47:18 PM1/11/18
to fastsimcoal
if you do not send all migrants from deme 0 to deme 1, these populations will remain isolated and coalescence will not be possible, hence your error message.
You need to specify when these populations diverged and move all your remaining lineages from one deme to the other
L

Guillaume Dumont

unread,
Jan 15, 2018, 4:31:57 AM1/15/18
to fastsimcoal
Hi,

Yes, of course, it works now.
Thanks a lot.

Guillaume
Reply all
Reply to author
Forward
0 new messages