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

Example and tests for --model_file #16

Open RyanGutenkunst opened 2 years ago

RyanGutenkunst commented 2 years ago

The functionality for using custom model files (--model_file) should be document, and there should be tests of that functionality in the test suite.

xin-huang commented 2 years ago

I have a question that whether we can use demes to generate models for dadi I saw dadi is in https://github.com/popsim-consortium/demes-paper/blob/main/software-table.tex Then how to use demes with dadi?

tjstruck commented 2 years ago

dadi has a function: dadi.Spectrum.from_demes Which takes the arguments: g = demes file name sampled_demes = list of population IDs sample_sizes = population sample sizes pts = list of gird points

You can see some unpolished examples in the dadi/examples/demes_test/testing_demes_v_dadi.py

tjstruck commented 2 years ago

I've added a section, "User defined demographic models", after the "Generating caches for DFE inference" section describing using the --model-file option and a bit on making the custom models for demographic inference and cache generation.

xin-huang commented 2 years ago

implemented by https://github.com/xin-huang/dadi-cli/pull/19

RyanGutenkunst commented 2 years ago

@tjstruck I don't see any tests of this functionality in the test suite. Am I missing something?

tjstruck commented 2 years ago

It looks like I started implementing tests but never finished (there are tests in test_GenerateCache). I've put together tests for importing (test_Models.py) and inferring (test_InferDM.py) custom models.

Do we want a separate test file for running dadi-cli bash through the subprocess package?

RyanGutenkunst commented 2 years ago

I wouldn't anticipate errors in dadi-cli arising from subprocess, so I would put that as a low priority, unless we've encountered problems along those lines.