BoPeng / simuPOP

A general-purpose forward-time population genetics simulation environment.
http://bopeng.github.io/simuPOP/
GNU General Public License v2.0
31 stars 12 forks source link

Striving for best practices when simulating harvesting #47

Closed ChrystelleDelord closed 6 years ago

ChrystelleDelord commented 6 years ago

Dear SimuPop users,

I am trying to simulate fishing impact on the genetic variability in riverine aquatic species. The idea would be (1) to first find which genetic measures would be the best to discriminate between a null model and a model where some SubPopulations are targeted by harvesting; and then, (2) to see how these features evolve when considering various biological characteristics such as r/K strategies, asymmetrical migration or dispersal abilities.

I am dealing with several concerns about the most accurate way to model such scenarii with SimuPOP. I usually have my own idea about what would be the best but I am always happy to get some external point of view so any review will be very welcome! I had a few questions in particular:

When it comes to simulate a given subPop decline, e.g. due to individual removal by fishing or hunting, my feeling is that the most accurate way of doing so would be to define a ResizeSubPop operator in preOps to eliminate random individuals before mating occurs. However, I am a bit confused on how to handle the subPopSize demographic model within the mating scheme afterward. We could set a demo function

Failure to produce offspring (e.g. lack of male or females in a dioecious sexual species subPop), would of course cause the subPop to collapse and from what I have seen, the most neutral way to deal with this when knowledge about the actual population dynamics is scarce, is to set a demo function to keep a constant subPopSize. However, considering we've trying to simulate some local decline, we will necessarily get to a collapse eventually and therefore, I glimpse three possibilities:

So to summarize I am wondering: 1) Which of my three possibilities would be the most accurate way to go, according to you, for simulating individuals removal in a few of my subPops? 2) Is it possible to tell simuPop to keep running when a subPop failed to produce offspring? 3) Is the introduction of stochasticity something relevant/at hand?

Sorry for this long post! Thank you to anyone that would come across this thread.

Best, Chrystelle

ChrystelleDelord commented 6 years ago

Hello again!

Would anyone have any suggestion? Any comment will be welcome. Thanks a lot, all the best and a happy holidays!

BoPeng commented 6 years ago

When it comes to simulate a given subPop decline, e.g. due to individual removal by fishing or hunting, my feeling is that the most accurate way of doing so would be to define a ResizeSubPop operator in preOps to eliminate random individuals before mating occurs. However, I am a bit confused on how to handle the subPopSize demographic model within the mating scheme afterward. We could set a demo function

It is generally recommended to handle demographic changes in one place (instead of having operators and demo function) so you could use Population::resize in a demo function, which is equivalent to applying a ResizeSubPops operator at the end of preOps.

Failure to produce offspring (e.g. lack of male or females in a dioecious sexual species subPop), would of course cause the subPop to collapse and from what I have seen, the most neutral way to deal with this when knowledge about the actual population dynamics is scarce, is to set a demo function to keep a constant subPopSize. However, considering we've trying to simulate some local decline, we will necessarily get to a collapse eventually and therefore, I glimpse three possibilities:

The devel version of simuPOP improves a bit on this.

In despite of the preOps operator ResizeSubPop, we then constrain a constant subPopSize using the simplest demo function, knowing that subPopSize would just fill the new individuals genotypes based on these that survived the previous resize anyway. Maybe a more qualified way could be just to constrain subPopSize to a threshold (for instance resize every subPop to 20 if they ever fall under X<20), which is what I am trying to do right now (it is running).

You can also never resize under 20. Although the consequence is a bit different because the 20 in your way could be expanded from very few parents.

We let the subPop decline and stop the simulation with TerminateIf, i.e. when one of the subPops gets to a size under a certain threshold.

This also makes sense.

We accept that certain subPop would collapse if they could be recolonized later somehow. Actually I do not know how this would be doable without (1) telling simuPop to keep running even if a subPop is lost (2) introducting some stochasticity on the fly, for exemple by slightly varing migration rates across generations by sampling this rate in a probability distribution (which might be a quite odd thing to do?)

You could use a ConditionalMatingScheme to CloneMating a subpopulation under certain conditions. This would allow the subpopulation to be reconlonized later but you will also need to control migration etc. Not easy but can certainly be done.

So to summarize I am wondering: Which of my three possibilities would be the most accurate way to go, according to you, for simulating individuals removal in a few of my subPops?

Fishing could be considered a random reduction of population size so a resize looks ok to me.

Is it possible to tell simuPop to keep running when a subPop failed to produce offspring? Is the introduction of stochasticity something relevant/at hand?

Yes, it is possible to use a conditional mating scheme. It is even possible for you to extract those subpopulations and re-introduce them at some point if that makes things a bit easier (e.g. migration). What you can do is in the demo function, detect populations that fail to produce offspring, use Population::extractSubPops, save to a file, and use Population::addSubPops at some point to reintroduce them.

Hope this helps,

ChrystelleDelord commented 6 years ago

Thank you so much Bo, this is very helpful, I will have a look at all of this!

Best regards, Chrys