|
From: Zhian K. <ka...@sc...> - 2016-07-01 03:50:03
|
But, from the output of the code you posted, it shows an even distribution of sex in the offspring, but the individual IDs only match the mother ID. Is this a bug?
>>> print([x.sex() for x in pop.individuals()])
[2, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 2, 1, 2, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 2, 1, 1, 1, 2, 2, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1]
>>> print(pop.indInfo('mother_id'))
(26.0, 89.0, 24.0, 87.0, 62.0, 80.0, 29.0, 72.0, 43.0, 89.0, 2.0, 67.0, 10.0, 16.0, 85.0, 84.0, 46.0, 83.0, 6.0, 80.0, 7.0, 15.0, 77.0, 36.0, 46.0, 4.0, 19.0, 52.0, 100.0, 15.0, 53.0, 11.0, 41.0, 46.0, 14.0, 6.0, 9.0, 59.0, 88.0, 70.0, 17.0, 36.0, 67.0, 44.0, 87.0, 83.0, 100.0, 86.0, 90.0, 84.0, 86.0, 4.0, 55.0, 67.0, 77.0, 73.0, 58.0, 70.0, 10.0, 52.0, 38.0, 56.0, 1.0, 78.0, 42.0, 28.0, 52.0, 14.0, 28.0, 77.0, 91.0, 100.0, 47.0, 80.0, 96.0, 22.0, 38.0, 22.0, 17.0, 92.0, 90.0, 86.0, 88.0, 71.0, 61.0, 6.0, 91.0, 1.0, 58.0, 35.0, 77.0, 95.0, 18.0, 52.0, 14.0, 70.0, 82.0, 29.0, 65.0, 5.0)
>>> print(pop.indInfo('father_id'))
(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
>>> print(pop.indInfo('ind_id'))
(26.0, 89.0, 24.0, 87.0, 62.0, 80.0, 29.0, 72.0, 43.0, 89.0, 2.0, 67.0, 10.0, 16.0, 85.0, 84.0, 46.0, 83.0, 6.0, 80.0, 7.0, 15.0, 77.0, 36.0, 46.0, 4.0, 19.0, 52.0, 100.0, 15.0, 53.0, 11.0, 41.0, 46.0, 14.0, 6.0, 9.0, 59.0, 88.0, 70.0, 17.0, 36.0, 67.0, 44.0, 87.0, 83.0, 100.0, 86.0, 90.0, 84.0, 86.0, 4.0, 55.0, 67.0, 77.0, 73.0, 58.0, 70.0, 10.0, 52.0, 38.0, 56.0, 1.0, 78.0, 42.0, 28.0, 52.0, 14.0, 28.0, 77.0, 91.0, 100.0, 47.0, 80.0, 96.0, 22.0, 38.0, 22.0, 17.0, 92.0, 90.0, 86.0, 88.0, 71.0, 61.0, 6.0, 91.0, 1.0, 58.0, 35.0, 77.0, 95.0, 18.0, 52.0, 14.0, 70.0, 82.0, 29.0, 65.0, 5.0)
Zhian
For posterity, here's the info of the simuPOP build I have:
Python 3.4.4 |Anaconda custom (x86_64)| (default, Jan 9 2016, 17:30:09)
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import simuPOP as sim
simuPOP Version 1.1.7 : Copyright (c) 2004-2016 Bo Peng
Revision 5000 (Jan 21 2016) for Python 3.4.4 (64bit, 0thread)
Random Number Generator is set to mt19937 with random seed 0xe684ed2f1dd65325.
This is the standard short allele version with 256 maximum allelic states.
For more information, please visit http://simupop.sourceforge.net,
or email sim...@li... (subscription required).
> On Jun 30, 2016, at 20:44 , Bo Peng <be...@gm...> wrote:
>
> Males and females have equal probability to be chosen and propagate here. If you notice one sex prevails, it must be a random process (similar to genetic drift) that causes one sex reaches fixation.
>
> Bo
>
>
> On Thu, Jun 30, 2016 at 10:35 PM, Zhian Kamvar <ka...@sc... <mailto:ka...@sc...>> wrote:
> Yes, I did initialize the sex. In this example, while there is an equal distribution of sex ratios, they appear to be propagated through the maternal parent, which means that the sex of the offspring does not match the sex of the parent. Is there a way for the males to also create clones and to keep the sex of the parent?
>
> Zhian
>
>> On Jun 30, 2016, at 20:16 , Bo Peng <be...@gm... <mailto:be...@gm...>> wrote:
>>
>> Did you initialize sex of parents? I see different sex of offspring from the following code:
>>
>> import simuPOP as sim
>>
>> pop = sim.Population(100, infoFields=['ind_id', 'father_id', 'mother_id'])
>>
>> pop.evolve(
>> initOps = [sim.IdTagger(), sim.InitSex()],
>> matingScheme=sim.HomoMating(
>> chooser = sim.RandomParentChooser(),
>> generator = sim.OffspringGenerator(
>> ops = [
>> sim.CloneGenoTransmitter(),
>> sim.PedigreeTagger(infoFields=['mother_id', 'father_id']),
>> ],
>> numOffspring=(sim.UNIFORM_DISTRIBUTION, 1, 1)
>> )
>> ),
>> #postOps = [
>> gen = 1
>>
>> )
>> print([x.sex() for x in pop.individuals()])
>> print(pop.indInfo('mother_id'))
>> print(pop.indInfo('father_id'))
>>
>> Bo
>>
>> On Thu, Jun 30, 2016 at 10:13 PM, Zhian Kamvar <ka...@sc... <mailto:ka...@sc...>> wrote:
>> If it selects a single individual randomly, then that individual should be copied to the next generation through CloneGenoTransmitter(), and you would have roughly the same ratio of males to females in the next generation, but in this case, I'm only seeing maternal genotypes. Is there something I'm missing in my function that's causing only one sex to be passed through to the next generation?
>>
>> Zhian
>>
>>> On Jun 30, 2016, at 20:06 , Bo Peng <be...@gm... <mailto:be...@gm...>> wrote:
>>>
>>> Yes. RandomParentChooser will choose one parent (another being NULL) regardless of sex (http://simupop.sourceforge.net/manual_svn/build/refManual_ch2_sec3.html#class-randomparentchooser <http://simupop.sourceforge.net/manual_svn/build/refManual_ch2_sec3.html#class-randomparentchooser>).
>>>
>>> Bo
>>>
>>>
>>> On Thu, Jun 30, 2016 at 10:01 PM, Zhian Kamvar <ka...@sc... <mailto:ka...@sc...>> wrote:
>>> Hi Bo,
>>>
>>> I realize I left a few details out:
>>>
>>> The population I'm trying to simulate is an Oomycete population, where either "sex" (in reality mating types) can produce clonal offspring. In this situation, only one mating type is producing offspring.
>>>
>>> In the documentation of the CloneGenoTransmitter(), it states that if two parents are supplied, the maternal genotype will be copied. Since I want a mixture of both male and female clones, I tried to use RandomParentChooser(), which I assume randomly selects a single individual. Am I wrong thinking that RandomParentChooser() selects a single individual?
>>>
>>> Thanks,
>>> Zhian
>>>
>>>
>>>> On Jun 30, 2016, at 18:34 , Bo Peng <be...@gm... <mailto:be...@gm...>> wrote:
>>>>
>>>> Hi, Zhian,
>>>>
>>>> I am not sure what is the problem here because your mating scheme works as expected when I run a test simulation. When I set numOffspring=1, the mother_id and father_id of the population are
>>>>
>>>> (90.0, 7.0, 79.0, 14.0, 68.0, 24.0, 79.0, 80.0, 60.0, 71.0, 100.0, 28.0, 97.0, 13.0, 64.0, 85.0, 43.0, 98.0, 59.0, 46.0, 2.0, 42.0, 46.0, 15.0, 79.0, 38.0, 16.0, 32.0, 75.0, 61.0, 4.0, 71.0, 7.0, 71.0, 84.0, 94.0, 16.0, 62.0, 31.0, 24.0, 36.0, 83.0, 75.0, 10.0, 27.0, 27.0, 6.0, 42.0, 41.0, 74.0, 31.0, 12.0, 16.0, 22.0, 58.0, 25.0, 43.0, 15.0, 12.0, 3.0, 52.0, 64.0, 81.0, 22.0, 5.0, 18.0, 51.0, 47.0, 57.0, 33.0, 19.0, 4.0, 41.0, 60.0, 55.0, 9.0, 71.0, 19.0, 18.0, 91.0, 62.0, 18.0, 64.0, 44.0, 78.0, 49.0, 49.0, 83.0, 49.0, 53.0, 93.0, 97.0, 82.0, 8.0, 9.0, 12.0, 99.0, 99.0, 39.0, 95.0)
>>>>
>>>> (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
>>>>
>>>> So only mothers are chosen. If you have numOffspring as specified, several consecutive offspring will share a mother.
>>>>
>>>> Cheers,
>>>>
>>>> Bo
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Thu, Jun 30, 2016 at 6:09 PM, Zhian Kamvar <ka...@sc... <mailto:ka...@sc...>> wrote:
>>>> Hello,
>>>>
>>>> I'm wondering if I can construct a scenario of diploid clonal reproduction by utilizing RandomParentChooser in HomoMating:
>>>>
>>>>
>>>> sim.HomoMating(
>>>> chooser = sim.RandomParentChooser(),
>>>> generator = sim.OffspringGenerator(
>>>> ops = [
>>>> sim.CloneGenoTransmitter(),
>>>> sim.PedigreeTagger(infoFields=['mother_id', 'father_id']),
>>>> ],
>>>> numOffspring=(sim.UNIFORM_DISTRIBUTION, 1, 3)
>>>> )
>>>> )
>>>>
>>>> I expect that the chooser would select a single parent, but when I run the simulation, it appears that two parents are chosen since I only have females left in the population ( as documented in the CloneGenoTransmitter ). Is there a way to address this?
>>>>
>>>> Thanks,
>>>> Zhian
>>>> ------------------------------------------------------------------------------
>>>> Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
>>>> Francisco, CA to explore cutting-edge tech and listen to tech luminaries
>>>> present their vision of the future. This family event has something for
>>>> everyone, including kids. Get more information and register today.
>>>> http://sdm.link/attshape <http://sdm.link/attshape>
>>>> _______________________________________________
>>>> simuPOP-list mailing list
>>>> sim...@li... <mailto:sim...@li...>
>>>> https://lists.sourceforge.net/lists/listinfo/simupop-list <https://lists.sourceforge.net/lists/listinfo/simupop-list>
>>>>
>>>
>>>
>>
>>
>
>
|