assigning mutations to specific coordinate range

23 views
Skip to first unread message

Max Shpak

unread,
Aug 2, 2023, 4:33:47 PM8/2/23
to slim-discuss
For reasons related to a previous problem that I had with overlapping conversion tracts for my model parameters, I am simulating model chromosomes of length 15,000 and only sampling the middle interval of 5000 in the middle (i.e. 4999-9999).

My simulations introduce beneficial mutations - in order to sample a genomic window containing the beneficial mutation, I need to introduce them in the [4999,9999] interval. Mu current code introduces the mutation at some random position in [0,14999]:

    x = rdunif(1,0,14999); 
    target = sample(p3.genomes, 1, replace=F); 
    target.addNewDrawnMutation(m2, x);

How can I change this so that the mutation is introduced at a sige in [4999,9999] while modeling a genome as specified in X from [0,14999]?

Ben Haller

unread,
Aug 2, 2023, 5:24:53 PM8/2/23
to Max Shpak, slim-discuss
Hi Max!

I suppose I must be missing something, but don't you just want to do:

x = rdunif(1, 4999, 9999);

instead?  If not, why not?

Cheers,
-B.

Benjamin C. Haller
Messer Lab
Cornell University


Max Shpak wrote on 8/2/23 4:33 PM:
--
SLiM forward genetic simulation: http://messerlab.org/slim/
---
You received this message because you are subscribed to the Google Groups "slim-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to slim-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/slim-discuss/f2a28918-30fc-4030-9661-5a4f723e9a14n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages