xin-huang / dadi-cli

Automated and distributed population genetic model inference from allele frequency spectra
https://dadi-cli.readthedocs.io/en/latest/
Apache License 2.0
14 stars 7 forks source link

plot pdf blank/empty #90

Open chapinkj opened 1 year ago

chapinkj commented 1 year ago

dadi-cli GenerateFs --vcf ../file.vcf --pop-info popmap.txt --projections 10 10 10 --output file.fs --pop-ids pop1 pop2 pop3

dadi-cli Plot --fs ./folded_fs.fs --output ./output.pdf

results in a blank, 2kb pdf file.

.fs file looks fine, and no errors are produced at any point

using python 3.11.1 and dadi-cli 0.9.3

chapinkj commented 1 year ago

I might have figured it out: need to include --demo-pop1, which is not indicated in the manual: https://dadi-cli.readthedocs.io/en/latest/userguide/plot/

tjstruck commented 1 year ago

Hi @chapinkj, you should not need to use --demo-pop1.

Some questions:

  1. Are you trying to plot a site-frequency spectrum with three populations? Currently, plotting three populations is unsupported.
  2. Are you getting any errors when you run your dadi-cli Plot command without the --demo-pop1?
chapinkj commented 1 year ago

Yep, 1 is the issue - I'm working with three populations. Is there any workaround for 3 pop plotting with dadi-cli?

tjstruck commented 11 months ago

Hi @chapinkj, sorry for taking so long to get back to you. I've updated dadi-cli to 0.9.5, which supports plotting pairwise comparisons for three populations to a model (ex. Figure 2C). If you update dadi to 2.3.3, the previous command you were using (dadi-cli Plot --fs ./folded_fs.fs --output ./output.pdf) will give the first row of spectra from Figure 2C, so you can compare the populations in your data pairwise.

However, the 3D plots like Figure 2A can be overly complex to interpret, so plotting a 3D spectrum probably won't be added to dadi-cli.