popsim-consortium / analysis2

Analysis for the second consortium paper.
8 stars 14 forks source link

OutOfAfricaArchaicAdmixture_5R19 error with "none" config for DFE/annotation #109

Closed lntran26 closed 3 months ago

lntran26 commented 6 months ago

When running production config for humans, I got this error that seems to be specific to the OutOfAfricaArchaicAdmixture_5R19 demographic model. (I didn't have this error when trying the "OutOfAfrica_3G09" demography--but take that with a grain of salt because we're also currently having the error mentioned in this issue with other config settings)

TypeError in file /xdisk/rgutenk/lnt/projects/stdpopsim/analysis2/workflows/simulation.snake, line 93:
unsupported operand type(s) for *: 'NoneType' and 'int'
  File "/xdisk/rgutenk/lnt/projects/stdpopsim/analysis2/workflows/simulation.snake", line 93, in __rule_simulation
  File "/home/u30/lnt/micromamba/envs/analysis2/lib/python3.10/site-packages/stdpopsim/slim_engine.py", line 1626, in simulate
  File "/home/u30/lnt/micromamba/envs/analysis2/lib/python3.10/site-packages/stdpopsim/slim_engine.py", line 744, in get_slim_mutation_rate_map
  File "/home/u30/lnt/micromamba/envs/analysis2/lib/python3.10/concurrent/futures/thread.py", line 58, in run

The specific lines of code mentioned in the error are these: slim_rates = contig.mutation_rate * slim_fractions[dfe_labels] from here and slim_rate_map = get_slim_mutation_rate_map(contig) from here Any insight into what the problem might be would be helpful!

petrelharp commented 6 months ago

The first thing I'd do here is to try to make the error happen not in snakemake?

lntran26 commented 6 months ago

I think I found the problem. There is no mutation rate set for the OutOfAfricaArchaicAdmixture_5R19 model so contig.mutation_rate is none. Seems like this is by design for this demographic model so if we want to use this model for the paper then we will need to modify the pipeline code, which asks for the model mutation rate here. In the first analysis paper that uses this model, it seems like a mean species mutation rate was used instead of the model-specific mutation rate.

mufernando commented 3 months ago

did we fix this?