Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repeated positions provided in simulation output #31

Open
MattHartfield opened this issue Jul 22, 2024 · 3 comments
Open

Repeated positions provided in simulation output #31

MattHartfield opened this issue Jul 22, 2024 · 3 comments

Comments

@MattHartfield
Copy link

Hi, I noticed that some positions are repeated in the output file, so two different polymorphism states are assigned to the same location.

Minimal example:
discoal 30 1 110000 -t 550 -r 110 > all_sims.out

Then obtaining positions and showing duplicates:
sed -n 6p all_sims.out | awk -F ': ' '{print $2}' | awk '{for(i = 1; i <= NF; i++) printf ("%.6f\n",$i)}' | uniq -D

@andrewkern
Copy link
Member

Hi @MattHartfield -

this is about the accuracy of the printf formatting. If you'd like to turn it up for greater precision you could alter the makeGametesMS() function in discoal_functions.c and alter line 2079 to something like

fprintf(stdout,"%.9lf ",allMuts[i] );

that will print up to 9 digits to the right of the decimal place. run make again and you should be all set i believe.

@andrewkern
Copy link
Member

generally if this is biting people I'm happy to update the discoal code

@MattHartfield
Copy link
Author

Hi! That works better now, thanks for the quick reply!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants