This adds some functionality for specifying mutation rates in the Demes-SFS methods, as brought up in #153.
The function to compute the SFS from a demes-formatted graph is moments.Demes.SFS(g, samples, ...). The Spectrum class function moments.Spectrum.from_demes(g, samples, ...) acts as a wrapper for this function. This PR changes moments.Spectrum.from_demes(...) to take theta as a keyword argument, and it defaults to 1.
More functionality is provided in Demes.SFS(). Now the function moments.Demes.SFS(...) can take theta (the pop-size scaled mutation rate) or u (the "raw" mutation rate), but it can't take both. If u is provided, then theta is determined by finding the ancestral Ne in the root deme. If neither theta nor u are provided, then Ne is again determined by the root deme's initial size, and the SFS is scaled by 4*Ne, so that multiplying after calculating by u (or uL) results in a properly scaled SFS.
This adds some functionality for specifying mutation rates in the Demes-SFS methods, as brought up in #153.
The function to compute the SFS from a demes-formatted graph is
moments.Demes.SFS(g, samples, ...)
. The Spectrum class functionmoments.Spectrum.from_demes(g, samples, ...)
acts as a wrapper for this function. This PR changesmoments.Spectrum.from_demes(...)
to taketheta
as a keyword argument, and it defaults to 1.More functionality is provided in
Demes.SFS()
. Now the functionmoments.Demes.SFS(...)
can taketheta
(the pop-size scaled mutation rate) oru
(the "raw" mutation rate), but it can't take both. Ifu
is provided, thentheta
is determined by finding the ancestralNe
in the root deme. If neithertheta
noru
are provided, thenNe
is again determined by the root deme's initial size, and the SFS is scaled by 4*Ne, so that multiplying after calculating by u (or uL) results in a properly scaled SFS.