forrel

Forensic pedigree analysis and relatedness inference. Part of the pedsuite ecosystem for pedigree analysis in R.

https://github.com/magnusdv/forrel

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 2 committers (50.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.3%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Forensic pedigree analysis and relatedness inference. Part of the pedsuite ecosystem for pedigree analysis in R.

Basic Info
Statistics
  • Stars: 11
  • Watchers: 4
  • Forks: 0
  • Open Issues: 0
  • Releases: 15
Created almost 8 years ago · Last pushed 12 months ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: github_document
---



```{r, echo = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  fig.align = "center"
)
```

# forrel 


[![CRAN status](https://www.r-pkg.org/badges/version/forrel)](https://CRAN.R-project.org/package=forrel)
[![](https://cranlogs.r-pkg.org/badges/grand-total/forrel?color=yellow)](https://cran.r-project.org/package=forrel)
[![](https://cranlogs.r-pkg.org/badges/last-month/forrel?color=yellow)](https://cran.r-project.org/package=forrel)



## Introduction
The goal of **forrel** is to provide forensic pedigree computations and relatedness inference from genetic marker data. The **forrel** package is part of the **pedsuite**, a collection of R packages for pedigree analysis.

The most important analyses currently supported by **forrel** are:

* Likelihood ratio (LR) computations for kinship testing
    * `quickLR()`
    * `kinshipLR()`
* Pairwise relatedness inference: Estimation of IBD coefficients (both $\kappa$ and $\Delta$) from marker data
    * `ibdEstimate()`
    * `ibdBootstrap()`
* Check and visualise relationships in pedigree data
    * `checkPairwise()`
* Simulation of marker genotypes, possibly conditional on known genotypes
    * `markerSim()`
    * `profileSim()`
    * `markerSimParametric()`
    * `profileSimParametric()`
* Power analysis for relationship testing
    * `LRpower()`
    * `exclusionPower()`
* Tailor-made functions for power analysis in missing person cases
    * `missingPersonPlot()`
    * `missingPersonEP()`
    * `missingPersonIP()`
    * `MPPsims()`
    * `powerPlot()`
* Predict DNA profiles for untyped pedigree members
    * `rankProfiles()`

#### Related pedsuite packages 

* [**pedtools**](https://github.com/magnusdv/pedtools): Tools for pedigree data management.
* [**dvir**](https://github.com/magnusdv/dvir): Disaster victim identification.
* [**pedFamilias**](https://github.com/magnusdv/pedFamilias): Import/export files used by the Familias software.
* [**pedprobr**](https://github.com/magnusdv/pedprobr): Probability computations in pedigrees.
* [**pedmut**](https://github.com/magnusdv/pedmut): Mutation modelling for pedigree analysis.
* [**KLINK**](https://github.com/magnusdv/KLINK): Kinship analysis with linked markers.


## Installation
To get the current official version of **forrel**, install from CRAN as follows:
```{r, eval = FALSE}
install.packages("forrel")
```
Alternatively, you can obtain the latest development version from GitHub:
```{r, eval = FALSE}
# install.packages("remotes") # if needed
remotes::install_github("magnusdv/forrel")
```

## An example
In this short introduction, we first demonstrate simulation of marker data for a pair of siblings. Then - pretending the relationship is unknown to us - we estimate the relatedness between the brothers using the simulated data. If all goes well, the estimate should be close to the expected value for siblings.

```{r}
library(forrel)
```

**Create the pedigree**  

We start by creating and plotting a pedigree with two brothers, named `bro1` and `bro2`. 

```{r sibs, fig.height=2.5, fig.width=2.5}
x = nuclearPed(children = c("bro1", "bro2"))
plot(x)
```

**Marker simulation**  

Now let us simulate the genotypes of 100 independent SNPs for all four family members. Each SNP has alleles 1 and 2, with equal frequencies by default. This is an example of _unconditional_ simulation, since we don't give any genotypes to condition on. 
```{r}
x = markerSim(x, N = 100, alleles = 1:2, seed = 1234)
```
Note 1: The `seed` argument is passed onto the random number generator. If you use the same seed, you should get exactly the same results.  
Note 2: To suppress the informative messages printed during simulation, add `verbose = FALSE` to the function call.

The pedigree `x` now has 100 markers attached to it. The genotypes of the first few markers are shown when printing `x` to the screen:

```{r}
x
```

**Conditional simulation**

Suppose one of the brothers is homozygous 1/1 and that we want to simulate genotypes for the other brother.
This is achieved with the following code, where after first attaching a marker to the pedigree, specifying the known genotype, we condition on it by referencing it in `markerSim()`. 

```{r}
y = nuclearPed(children = c("bro1", "bro2")) |> 
  addMarker(bro1 = "1/1", alleles = 1:2, name = "snp1") |> 
  markerSim(N = 100, ids = "bro2", partialmarker = "snp1", 
            seed = 321, verbose = FALSE)
y
```

Note that the previous code also demonstrates how **pedsuite** is well adapted to the R pipe `|>`.

**Estimation of IBD coefficients**  

The `ibdEstimate()` function estimates the coefficients of _identity-by-descent_ (IBD) between pairs of individuals, from the available marker data. Let us try with the simulated genotypes we just generated:
```{r}
k = ibdEstimate(y, ids = c("bro1", "bro2"))
k
```

To get a visual sense of the estimate, it is instructive to plot it in the IBD triangle:
```{r triangle, fig.height=4, fig.width=4}
showInTriangle(k, labels = TRUE)
```

Reassuringly, the estimate is close to the theoretical expectation for non-inbred full siblings, $(\kappa_0, \kappa_1, \kappa_2) = (0.25, 0.5, 0.25)$, corresponding to the point marked `S` in the triangle.

Owner

  • Name: Magnus Dehli Vigeland
  • Login: magnusdv
  • Kind: user
  • Location: Oslo, Norway
  • Company: Department of Medical Genetics, University of Oslo

Statistical geneticist

GitHub Events

Total
  • Release event: 3
  • Watch event: 1
  • Push event: 9
  • Create event: 3
Last Year
  • Release event: 3
  • Watch event: 1
  • Push event: 9
  • Create event: 3

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 436
  • Total Committers: 2
  • Avg Commits per committer: 218.0
  • Development Distribution Score (DDS): 0.002
Past Year
  • Commits: 53
  • Committers: 1
  • Avg Commits per committer: 53.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Magnus Dehli Vigeland m****v@m****o 435
Thore t****d@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 44
  • Total pull requests: 1
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 1 minute
  • Total issue authors: 5
  • Total pull request authors: 1
  • Average comments per issue: 1.5
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • thoree (33)
  • knifecake (6)
  • magnusdv (3)
  • hildekb (1)
  • MarsicoFL (1)
Pull Request Authors
  • thoree (1)
Top Labels
Issue Labels
shiny-gui (4) bug (2) feature (2)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 501 last-month
  • Total dependent packages: 5
  • Total dependent repositories: 4
  • Total versions: 15
  • Total maintainers: 1
cran.r-project.org: forrel

Forensic Pedigree Analysis and Relatedness Inference

  • Versions: 15
  • Dependent Packages: 5
  • Dependent Repositories: 4
  • Downloads: 501 Last month
Rankings
Dependent packages count: 8.2%
Dependent repos count: 14.5%
Stargazers count: 17.4%
Average: 17.8%
Downloads: 21.3%
Forks count: 27.8%
Maintainers (1)
Last synced: 11 months ago

Dependencies

DESCRIPTION cran
  • R >= 4.1.0 depends
  • pedtools >= 1.1.0 depends
  • glue * imports
  • pedmut * imports
  • pedprobr >= 0.4 imports
  • ribd >= 1.3.0 imports
  • ggplot2 * suggests
  • ibdsim2 * suggests
  • poibin * suggests
  • scales * suggests
  • testthat * suggests