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

how to modify the plot? #90

Open
nicolashazzi23 opened this issue Jan 17, 2024 · 1 comment
Open

how to modify the plot? #90

nicolashazzi23 opened this issue Jan 17, 2024 · 1 comment

Comments

@nicolashazzi23
Copy link

Hi everyone

at the end of the Gadma run I got this image (see attachment) where population B and C seems lumped, and it is not possible to see the arrows of the gene flow. I would like to kindly ask if there is some way to change this image (maybe modifying the .py code file) to solve this issue?

best regards

Nicolas
best_logLL_model

@noscode
Copy link
Collaborator

noscode commented Jan 17, 2024

Hi Nicolas,

This is a common issue with these plots, and I can suggest three possible solutions:

  1. Using demes to draw the model picture: demes is more reliable in terms of intersections and offers several plot corrections. To create a plot with demes, you need to install demes-draw and run it with the demes file, typically generated by GADMA along with the model code. If you choose this option and encounter any issues (such as the absence of a demes file from GADMA), let me know, and I can provide more detailed guidance.

  2. Modifying the Python code generated for moments: unfortunately, there's no direct way to instruct moments to increase the space between B and C. The plotting issue arises because the population size of the ancestral population of B and C is very small. You can improve the situation by increasing the value of this size, resulting in a better-looking (though less accurate) picture. My suggestion is to adjust this parameter's value to enhance the visual appeal of the plot.

  3. Saving the plot in PDF format and manual editing. The last option is to save your plot in PDF format by changing the file extension in the save_file option of moments.ModelPlot.plot_model. Afterward, you can manually edit the PDF using a vector graphics editor like Inkscape. This solution can be challenging as migration arrows are not pictured correctly, and you will have to deal with that somehow.

I hope that help, let me know what option is better for you and if you have any further questions.

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