From d42b2413a3ea81891db1e5379734407d256b9cd9 Mon Sep 17 00:00:00 2001 From: chriscrsmith Date: Thu, 3 Aug 2023 19:56:38 +0000 Subject: [PATCH 1/6] half-entered new dfe got proportion added dom coefficients almost finished added lethal mutations Update dfes.py add uniform DFE (closes #1481) h-s relationship (closes #1488) formatting test dominance coeffs actually in there remove deprecated set-output (see https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ ) and bump cache package version bumps remove python 3.7 as it is end-of-life and creates install problems for scikit-allel make sure the tests are testing what they're supposed to test chris comments changelog clarify manual more chris comments bump cache?!?! using homsap mu using homsap mu flake8 delete stray print different neutral prop Update stdpopsim/catalog/HomSap/dfes.py Co-authored-by: Peter Ralph Update stdpopsim/catalog/HomSap/dfes.py Co-authored-by: Peter Ralph Update stdpopsim/catalog/HomSap/dfes.py Co-authored-by: Peter Ralph updates to new dfe Apply suggestions from code review reduce cache num again fixxxxxxxxxxxxxxxxxxxxxxxxx bump cache trying changeing tests.yml trying changeing tests.yml reduce cache num again --- .github/workflows/tests.yml | 3 +- stdpopsim/catalog/HomSap/dfes.py | 53 ++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7210b75f2..b70a48801 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,7 +20,6 @@ jobs: os: [ubuntu-20.04, macos-11, windows-latest] python: [3.8, "3.10"] env: - CONDA_ENV_NAME: stdpopsim OS: ${{ matrix.os }} PYTHON: ${{ matrix.python }} @@ -60,7 +59,7 @@ jobs: uses: conda-incubator/setup-miniconda@v2 if: steps.cache.outputs.cache-hit != 'true' with: - activate-environment: ${{ env.CONDA_ENV_NAME }} + activate-environment: stdpopsim python-version: ${{ matrix.python }} channels: conda-forge channel-priority: strict diff --git a/stdpopsim/catalog/HomSap/dfes.py b/stdpopsim/catalog/HomSap/dfes.py index ee97bc4bc..83e1254a5 100644 --- a/stdpopsim/catalog/HomSap/dfes.py +++ b/stdpopsim/catalog/HomSap/dfes.py @@ -147,3 +147,56 @@ def _HuberLogNormalDFE(): _species.add_dfe(_HuberLogNormalDFE()) + + +def _KyriazisDFE(): + id = "Mixed_K23" + description = "Deleterious Gamma DFE with additional lethals" + long_description = """ + The DFE estimated from human data recommended in Kyriazis et al. + (2023), https://doi.org/10.1086/726736, for general use. + This model is similar to the Kim et al. (2017) DFE based on human + genetic data, modified to include the dominance distribution from + Henn et al. (2016). + The model is also augmented with an additional proportion of 0.3% of + recessive lethals, based on the analysis of Wade et al. (2023). + """ + citations = [ + stdpopsim.Citation( + author="Kyriazis et al.", + year=2023, + doi="https://doi.org/10.1086/726736", + reasons={stdpopsim.CiteReason.DFE}, + ) + ] + neutral = stdpopsim.MutationType() + gamma_mean = -0.0131 + gamma_shape = 0.186 + coefs = [0.45, 0.2, 0.05, 0] + breaks = [0.001, 0.01, 0.1] + gamma = stdpopsim.MutationType( + dominance_coeff_list=coefs, + dominance_coeff_breaks=breaks, + distribution_type="g", # gamma distribution + distribution_args=[gamma_mean, gamma_shape], + ) + lethal = stdpopsim.MutationType( + distribution_type="f", # fixed value + distribution_args=[-1], # fitness in SLiM for homozygotes is multiiplied by 1+s + dominance_coeff=0, + ) + proportion_deleterious = 2.31 / (1 + 2.31) + lethal_prop = proportion_deleterious * 0.003 # 0.3% lethals + gamma_prop = proportion_deleterious - lethal_prop + neutral_prop = 1 - proportion_deleterious + return stdpopsim.DFE( + id=id, + description=description, + long_description=long_description, + mutation_types=[neutral, gamma, lethal], + proportions=[neutral_prop, gamma_prop, lethal_prop], + citations=citations, + ) + + +_species.add_dfe(_KyriazisDFE()) From e2d825d2feb55934181238f7fbc65ae28afb00a5 Mon Sep 17 00:00:00 2001 From: chriscrsmith Date: Fri, 18 Aug 2023 23:08:46 +0000 Subject: [PATCH 2/6] bumping back up; tests.yml restored --- .github/workflows/tests.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b70a48801..7c17e7f4d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,6 +20,7 @@ jobs: os: [ubuntu-20.04, macos-11, windows-latest] python: [3.8, "3.10"] env: + CONDA_ENV_NAME: stdpopsim OS: ${{ matrix.os }} PYTHON: ${{ matrix.python }} @@ -48,7 +49,7 @@ jobs: uses: actions/cache@v2 env: # Increase this to reset the cache if the key hasn't changed. - CACHE_NUM: 4 + CACHE_NUM: 5 with: path: | ${{ steps.find-conda.outputs.CONDA }}/envs/${{ env.CONDA_ENV_NAME }} @@ -59,7 +60,7 @@ jobs: uses: conda-incubator/setup-miniconda@v2 if: steps.cache.outputs.cache-hit != 'true' with: - activate-environment: stdpopsim + activate-environment: ${{ env.CONDA_ENV_NAME }} python-version: ${{ matrix.python }} channels: conda-forge channel-priority: strict From b8528a66bcfcf8981070ec10b1bdaa30e03eeafc Mon Sep 17 00:00:00 2001 From: chriscrsmith Date: Fri, 18 Aug 2023 23:34:20 +0000 Subject: [PATCH 3/6] trying ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7c17e7f4d..845d55a02 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,7 +23,7 @@ jobs: CONDA_ENV_NAME: stdpopsim OS: ${{ matrix.os }} PYTHON: ${{ matrix.python }} - + ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true steps: - name: cancel previous runs uses: styfle/cancel-workflow-action@0.6.0 From 9b2bcbce551f5e2aeda93e26996e826fd853daa1 Mon Sep 17 00:00:00 2001 From: chriscrsmith Date: Fri, 18 Aug 2023 23:36:52 +0000 Subject: [PATCH 4/6] more recent actions/cache --- .github/workflows/tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 845d55a02..770b06160 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,7 +23,6 @@ jobs: CONDA_ENV_NAME: stdpopsim OS: ${{ matrix.os }} PYTHON: ${{ matrix.python }} - ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true steps: - name: cancel previous runs uses: styfle/cancel-workflow-action@0.6.0 @@ -46,7 +45,7 @@ jobs: - name: cache conda id: cache - uses: actions/cache@v2 + uses: actions/cache@v3 env: # Increase this to reset the cache if the key hasn't changed. CACHE_NUM: 5 From 8a10befd293c12932d64d32af7adfbbf6f212a36 Mon Sep 17 00:00:00 2001 From: chriscrsmith Date: Fri, 18 Aug 2023 23:50:59 +0000 Subject: [PATCH 5/6] back to older actions/cache --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 770b06160..6cbcdd4b2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -45,7 +45,7 @@ jobs: - name: cache conda id: cache - uses: actions/cache@v3 + uses: actions/cache@v2 env: # Increase this to reset the cache if the key hasn't changed. CACHE_NUM: 5 From 8cd2e59ad838f01609fe22406323e30ce7347cd6 Mon Sep 17 00:00:00 2001 From: chriscrsmith Date: Fri, 18 Aug 2023 23:52:27 +0000 Subject: [PATCH 6/6] newer actions/cache --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6cbcdd4b2..770b06160 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -45,7 +45,7 @@ jobs: - name: cache conda id: cache - uses: actions/cache@v2 + uses: actions/cache@v3 env: # Increase this to reset the cache if the key hasn't changed. CACHE_NUM: 5