Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hughjonesd/why-natural-selection

Code for the paper "Human capital mediates natural selection in contemporary humans"
https://github.com/hughjonesd/why-natural-selection

economics fertility genetics natural-selection

Last synced: 2 months ago
JSON representation

Code for the paper "Human capital mediates natural selection in contemporary humans"

Awesome Lists containing this project

README

        

# why-natural-selection

Code for the paper "Human capital mediates natural selection in
contemporary humans" by Abdel Abdellaoui and David Hugh-Jones.

# The paper

The published version is in *Behavior Genetics* 52(4), available at https://link.springer.com/article/10.1007/s10519-022-10107-w

The current version is available at https://github.com/hughjonesd/why-natural-selection/blob/master/why-natural-selection.pdf.

# BGA poster

The BGA poster is available [here](https://github.com/hughjonesd/why-natural-selection/blob/master/BGA%20poster.pdf).

# To download

From your command line, run:

```
git clone https://github.com/hughjonesd/import-ukbb-data.git
git clone https://github.com/hughjonesd/why-natural-selection.git
```

# The data

Data is stored separately. To get UK Biobank data you'll need to
make an application to UK Biobank (or join our application). Other data is
publicly available, so we can share it.

We also use weights from

Alten, Sjoerd van, Benjamin W Domingue, Titus Galama, and Andries Marees. 2021.
“The Effects of Demographic-Based Selection Bias on GWAS Results in the UK Biobank.”

Thank you to Sjoerd and coauthors for their kindness in providing these!
You'll need their code to recreate the weights.

# To run

1. Start R within the project directory. This should automatically
download the `{renv}` package.

2. Run `renv::restore()` to download the appropriate R packages.

3. Edit directory locations in `_drake.R`.

4. Within R, run

```r
r_make()
```

This will take some time to run, depending on your machine. It will rebuild
the PDF `why-natural-selection.pdf`.