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

Simulation of meta-insects population #91

Closed MatBiocentis closed 1 year ago

MatBiocentis commented 2 years ago

Dear Bo,

can you please give me any guidance in implementing a basic simulation of a meta-population of insects within the following assumptions: 1) chromosome: the number of chromosomes is 8 (n = 4: 3 pairs of autosomes plus 1 pair of sex chromosomes) and is constant

  1. a) Roughly speaking, sex is determined by the "genetic balance system" where the ratio of the number of X chromosomes to that of the number of sets of autosomes matters https://www.easybiologyclass.com/genic-balance-theory-sex-determination-drosophila/ 2) mating behavior: polyandry 3) age-structured population

Thanks a lot

BoPeng commented 2 years ago

I read the article you cite and it appears that any individuals can have multiple sets of the same chromosomes (e.g. 4 sets of chromosome X vs. 2 sets of autosome). This is a scenario that simuPOP does not support out of box. It is possible to fake these chromosomes and customize their inheritance, but it requires a lot more work.

For example, you could use "information fields" to record the number of copies of chromosomes and sex, something like

pop = sim.Population(size=100, ploidy=2, loci=[10, 10, 10, 10, 10],
     chromTypes=[sim.AUTOSOME]*3 + 
        [sim.CHROMOSOME_X, sim.CHROMOSOME_Y],
         infoFields=['a1', 'a2', 'a3', 'a4', 'sx', 'sy', 'sex'])

You have to somehow initialize these fields and determine sex manually (using a Python function ). Then you will have to use a pyMating scheme to manually pick parents, and mate them.

All in all, it can be done but you will have to customize every step of the evolutionary process, to an extent that you might as well use a generic scripting language to do the same. The scripts will be longer but at least you will have complete control of the process and you do not have to learn simuPOP.

MatBiocentis commented 2 years ago

Thanks! I will keep in mind your advice.