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

Issue with dadi-cli and the Numerics.py script #94

Open
kchiou opened this issue Jan 12, 2024 · 1 comment
Open

Issue with dadi-cli and the Numerics.py script #94

kchiou opened this issue Jan 12, 2024 · 1 comment

Comments

@kchiou
Copy link

kchiou commented Jan 12, 2024

I am getting an error with dadi-cli Plot. A sample command

dadi-cli Plot --fs NOR.CEN.22.neutral_regions.folded.final.fs \
	--demo-popt NOR.CEN.sym_mig.neutral.demo.params.InferDM.bestfits \
	--output ./test.pdf --model sym_mig

returns the error.

Traceback (most recent call last):
  File "/data/CEM/smacklab/libraries/python/.conda/envs/dadi-cli-gpu/bin/dadi-cli", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/data/CEM/smacklab/libraries/python/.conda/envs/dadi-cli-gpu/lib/python3.11/site-packages/dadi_cli/__main__.py", line 1869, in main
    args.runner(args)
  File "/data/CEM/smacklab/libraries/python/.conda/envs/dadi-cli-gpu/lib/python3.11/site-packages/dadi_cli/__main__.py", line 994, in run_plot
    plot_fitted_demography(
  File "/data/CEM/smacklab/libraries/python/.conda/envs/dadi-cli-gpu/lib/python3.11/site-packages/dadi_cli/Plot.py", line 98, in plot_fitted_demography
    model = func_ex(popt, ns, pts_l)
            ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/CEM/smacklab/libraries/python/.conda/envs/dadi-cli-gpu/lib/python3.11/site-packages/dadi/Numerics.py", line 374, in extrap_func
    result_l = list(map(partial_func, pts_l))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/CEM/smacklab/libraries/python/.conda/envs/dadi-cli-gpu/lib/python3.11/site-packages/dadi/Numerics.py", line 122, in misid_func
    fs = func(*args, **kwargs)
         ^^^^^^^^^^^^^^^^^^^^^
  File "/data/CEM/smacklab/libraries/python/.conda/envs/dadi-cli-gpu/lib/python3.11/site-packages/dadi/PortikModels/portik_models_2d.py", line 33, in sym_mig
    nu1, nu2, m, T = params
    ^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected 4, got 3)

Based on the traceback, I edited the script Numerics.py (this version). On line 121, I edited from args[0] = all_params[:-1] to args[0] = all_params, and this appeared to resolve the issue and produce the expected output. This is obviously non-ideal — I'm unsure what else I could be breaking through this fix!

I believe that without this fix, a similar error crops up with other functions (e.g., the bootstrap workflow) for our group in dadi-cli.

@tjstruck
Copy link
Collaborator

Hi @kchiou, when you get an error that the number of parameters is one less than expected, it is usually because dadi-cli assumes the misidentification parameter is a part of the model. If you didn't fit a misidentification parameter for the demographic inference, you'll want to include the --nomisid flag with your dadi-cli Plot command like you did the dadi-cli InferDM command.

If you did include the misidentification parameter for the demographic inference, it would be helpful to see the "NOR.CEN.sym_mig.neutral.demo.params.InferDM.bestfits" file.

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