Hello Skye,
Yes, your spectra are folded. It’s a little confusing because what is plotted here are marginals coming from the full 3D spectrum. In your case, with 46*3 = 138 total haplotypes between all three populations, the maximum minor allele frequency is 138/2 = 69. So in these 2D marginal spectra, you could see alleles that had, for example, the minor allele at frequency 46 in WP, 0 in EP, and 23 in ASC. But you could not have 46 in WP, 0 in EP, and 24 in ASC (because then it wouldn’t be the minor allele). So you see pure white in the upper corner of the plots, but it’s not 1/2 as you might expect, because we’re considering the minor allele across all three populations, not a particular population pair.
Best,
Ryan
> On May 27, 2024, at 9:41 PM, Skye Davis <
k.skye...@gmail.com> wrote:
>
> Thanks so much Travis and Ryan, and for the speedy reply! Adding --nomisid worked.
> I'm curious - are my spectra truly folded? I thought the upper diagonal should be empty - but whether I generate folded in angsd, or unfolded in angsd and fold in dadi, I get the same output as the plot I sent earlier. Is this normal?
>
> Cheers,
>
> Skye
>
> On Wednesday, May 22, 2024 at 9:25:29 AM UTC+10 Travis Struck wrote:
> Hi Skye,
>
> For now, you need to add "--nomisid" to your Plot subcommands when a model is involved (vs. just data). By default, dadi-cli assumes a model will be for unfolded data, and excepts an extra parameter for misidentification.
>
> As part of the error, it should suggest adding/removing --nomisid when there is a mismatch in the number of parameters given vs. expected. I'll look into why it didn't.
>
> I hope this helps,
> Travis
>
> On Mon, May 20, 2024 at 7:47 AM Skye Davis <
k.skye...@gmail.com> wrote:
> Hi Ryan and dadi team,
>
> I'm using dadi-cli (very streamlined, thanks for bringing this out!) but I'm encountering an issue when trying to plot results for a 3d model (split_nomig).
>
> I used an unfolded SFS generated with ANGSD/realSFS - then folded it in dadi (generating folded in ANGSD gave errors with dadi-cli, it did not recognize it as folded. The plot is the same though, so I'm not sure what the issue was).Next in dadi-cli I ran:
> >dadi-cli InferDM --fs ./all_pop_3d_sfs_folded.fs --output-prefix EP_WP_AI --optimizations 100 --check-convergence 10 --global-optimization --maxeval 400 --nomisid --model split_nomig --lbounds 1e-3 1e-3 1e-3 1e-3 0 0 --ubounds 100 100 100 100 1 1 --output ./Output/3pop_split_nomig_optimization.params
>
> I added 'global-optimization' and 'maxeval' because convergence was failing without those and it was suggested in the manual.
>
> This works (though with lots of 'model is <0 where data is not masked' errors) and I get the # Converged results and # Top 100 results in the output file. It converges, although the first T parameter is at the lower boundary (0), for all the results.
>
> E.g., top result:
> # Converged results
> # Log(likelihood) nu1 nuA nu2 nu3 T1 T2 theta
> -31490.36291078844 1.0973973171374933 0.004730289727100075 8.198105924385347 0.465853564914095 0.0 0.2366751079720142 4519.67105582473
>
> But then I try to run the code to plot the model against the data:
> >dadi-cli Plot --fs ./all_pop_3d_sfs_folded.fs --demo-popt ./Output/3pop_split_nomig_optimization.params.InferDM.bestfits --output ./Output/3pop_data_vs_model_split-nomig.pdf --model split_nomig
>
> For which I get this error:
> [...] portik_models_3d.py", line 28, in split_nomig
> nu1, nuA, nu2, nu3, T1, T2 = params
> ValueError: not enough values to unpack (expected 6, got 5)
>
> I'm new to dadi-cli, so not sure how to fix this issue? Is it a bug, or an issue with my data?
>
> Thanks so much for all your help!
>
> Cheers,
>
> Skye
>
>
> --
> You received this message because you are subscribed to the Google Groups "dadi-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
dadi-user+...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/dadi-user/c5228ff0-2636-49c1-8060-ab16878e3a60n%40googlegroups.com.
>
> --
> You received this message because you are subscribed to the Google Groups "dadi-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
dadi-user+...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/dadi-user/69a797b3-1604-493b-8a90-6903a32af9d0n%40googlegroups.com.