#### IP Explorer

Inbreeding-Purging (IP) Explorer is a R Shiny application designed to visualize the expected change in IP parameters such as inbreeding coefficients and the inbreeding load in populations, by means of an interactive graphical interface. It is built as part of the R package [purgeR](https://gitlab.com/elcortegano/purgeR) ([López-Cortegano 2021](https://doi.org/10.1093/bioinformatics/btab599)), and most of the methods and IP models used here are described in [purgeR documentation](https://cran.r-project.org/web/packages/purgeR/vignettes/purgeR-tutorial.html). All panels in the application show the critical time for purging ([López-Cortegano et al. 2021](https://www.nature.com/articles/s41437-021-00473-2)), indicating the time point when purging is expected to become substantial and detectable.

----------------------------------------------------------------------------

#### How to use this application

Use the left panel to set parameters, and navigate the tabs on the top of the application interface to explore expectations on Inbreeding and Purging.

The main parameter to configure is the effective population size (*Ne*). It can be calculated in advance from the pedigree in R using purgeR:


    library("tidyverse")

    library("purgeR")

    read_tsv("my_pedigree.tsv") %>% ped_rename() %>% ip_F() %>% pop_t() %>% pop_Ne()

If you want to input your own pedigree into IP Explorer, the pedigree will need to be in the [input format](https://cran.r-project.org/web/packages/purgeR/vignettes/purgeR-tutorial.html) required by purgeR, and include a numeric column named "t" to indicate the generation number (this column can be calculated with `purgeR::pop_t()`). 

**Inbreeding**

Plot the expected standard (*F*; Wright 1922), ancestral (*Fa*; Ballou 1997) and purged (*g*; García-Dorado 2012) inbreeding coefficients. Apart from *Ne*, calculating *g* also needs to input an purging coefficient (*d*). Since d = 0.5 s(1-2h), *d* can be manually configured setting h=0 and s=2d in the left panel. Inbreeding coefficients can also be calculated for an input pedigree file.

**Purging**

----------------------------------------------------------------------------

#### Assistance

The source code is part of the purgeR R package, and is fully available at [GitLab](https://gitlab.com/elcortegano/purgeR). There you can find an [issue tracker](https://gitlab.com/elcortegano/purgeR/issues) where to submit any suggestions and to request additional features.

----------------------------------------------------------------------------

#### Citation

Please cite the following articles in your research if you use:

**purgeR**:

- López-Cortegano E. (2021). purgeR: Inbreeding and purging in pedigreed populations. Bioinformatics: https://doi.org/10.1093/bioinformatics/btab599

**Critical number of generations to purging**:

- López-Cortegano E et al. (2021). Genetic purging in captive endangered ungulates with extremely low effective population sizes. Heredity: https://www.nature.com/articles/s41437-021-00473-2.

----------------------------------------------------------------------------

#### Other references

- Ballou JD. (1997). Ancestral inbreeding only minimally affects inbreeding depression in mammalian populations. Journal of Heredity: https://doi.org/10.1093/oxfordjournals.jhered.a023085

- García-Dorado A. (2012). Understanding and predicting the fitness decline of shrunk populations: inbreeding, purging, mutation, and standard selection. Genetics: https://doi.org/10.1534/genetics.111.135541

- Wright S. (1922). Coefficients of inbreeding and relationship. The American Naturalist 56: 330-338.

