{"id":32207639,"url":"https://github.com/magnusdv/dvir","last_synced_at":"2026-02-21T18:04:39.746Z","repository":{"id":42369573,"uuid":"161492131","full_name":"magnusdv/dvir","owner":"magnusdv","description":"Disaster Victim Identification in R","archived":false,"fork":false,"pushed_at":"2025-10-13T12:48:01.000Z","size":1753,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-09T10:16:31.195Z","etag":null,"topics":["dvi","forensic-genetics","kinship-testing","pedsuite"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/magnusdv.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-12T13:26:38.000Z","updated_at":"2025-10-13T12:48:04.000Z","dependencies_parsed_at":"2023-10-16T10:45:40.327Z","dependency_job_id":"3c02fd0c-9031-4134-ba51-c59f08056806","html_url":"https://github.com/magnusdv/dvir","commit_stats":{"total_commits":417,"total_committers":2,"mean_commits":208.5,"dds":0.2853717026378897,"last_synced_commit":"f70c0d1a053761236d798ea6818d61709e4e4ba4"},"previous_names":["magnusdv/dvir","thoree/dvir"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/magnusdv/dvir","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnusdv%2Fdvir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnusdv%2Fdvir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnusdv%2Fdvir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnusdv%2Fdvir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magnusdv","download_url":"https://codeload.github.com/magnusdv/dvir/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magnusdv%2Fdvir/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29689644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T15:51:39.154Z","status":"ssl_error","status_checked_at":"2026-02-21T15:49:03.425Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dvi","forensic-genetics","kinship-testing","pedsuite"],"created_at":"2025-10-22T05:56:41.673Z","updated_at":"2026-02-21T18:04:39.739Z","avatar_url":"https://github.com/magnusdv.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  fig.align = \"center\",\n  dpi = 300,\n  cache.path = \"README_cache/\"\n)\n```\n\n\u003c!-- badges: start --\u003e\n[![CRAN status](https://www.r-pkg.org/badges/version/dvir)](https://CRAN.R-project.org/package=dvir)\n[![](https://cranlogs.r-pkg.org/badges/grand-total/dvir?color=yellow)](https://cran.r-project.org/package=dvir)\n[![](https://cranlogs.r-pkg.org/badges/last-month/dvir?color=yellow)](https://cran.r-project.org/package=dvir)\n\u003c!-- badges: end --\u003e\n\n# Disaster Victim Identification in R\n\nThe purpose of **dvir** is to implement state-of-the-art algorithms for DNA-based disaster victim identification (DVI). In particular, **dvir** performs *joint* identification of multiple victims.\n\nThe methodology and algorithms of **dvir** are described in [Vigeland \u0026 Egeland (2021): DNA-based Disaster Victim Identification](https://www.researchsquare.com/article/rs-296414/v1).\n\nThe **dvir** package is part of the [pedsuite](https://magnusdv.github.io/pedsuite/), a collection of R packages for pedigree analysis. Much of the machinery behind **dvir** is imported from other pedsuite packages, especially **pedtools** for handling pedigree data, and **forrel** for the calculation of likelihood ratios. A comprehensive presentation of these packages, and much more, can be found in the book [Pedigree Analysis in R](https://shop.elsevier.com/books/pedigree-analysis-in-r/vigeland/978-0-12-824430-2).\n\n## Installation\n\nTo get the current official version of **dvir**, install from CRAN as follows:\n```{r, eval = FALSE}\ninstall.packages(\"dvir\")\n```\n\nAlternatively, the latest development version may be obtained from GitHub:\n\n```{r, eval = FALSE}\n# install.packages(\"remotes\")\nremotes::install_github(\"magnusdv/dvir\")\n```\n\n## Tutorial example\nIn the following we will use a toy DVI example from the [paper](https://www.researchsquare.com/article/rs-296414/v1) (see above) to illustrate how to use **dvir**.\n\nTo get started, we load the **dvir** package.\n```{r}\nlibrary(dvir)\n```\n\n### Introduction\nWe consider the DVI problem shown below, in which three victim samples (V1, V2, V3) are to be matched against three missing persons (M1, M2, M3) belonging to two different families.\n\n```{r example-plot1, echo = FALSE, fig.height = 2.9, out.width = \"85%\"}\nplotDVI(example2, marker = 1, titles = c(\"PM data\", \"AM data\"), cex = 1.1, frames = FALSE)\n```\n\nThe hatched symbols indicate genotyped individuals. In this simple example we consider only a single marker, with 10 equifrequent alleles denoted 1, 2,..., 10. The available genotypes are shown in the figure. \n\nDNA profiles from victims are generally referred to as _post mortem_ (PM) data, while the _ante mortem_ (AM) data contains profiles from the reference individuals R1 and R2.\n\n### Assignments\nA possible solution to the DVI problem is called an _assignment_. In our toy example, there are _a priori_ 14 possible assignments, which can be listed as follows:\n\n```{r, echo = F}\ngeneratePairings(example2) |\u003e expand.grid.nodup()\n```\n\nEach row indicates the missing persons corresponding to V1, V2 and V3 (in that order) with `*` meaning _not identified_. For example, the first line contains the _null model_ corresponding to none of the victims being identified, while the last line gives the assignment where `(V1, V2, V3) = (M1, M2, M3)`, \nFor each assignment `a` we can calculate the likelihood, denoted `L(a)`. The null likelihood is denoted `L0`.\n\n### Goals\nWe consider the following to be two of the main goals in the analysis of a DVI case with multiple missing persons:\n\n1) Rank the assignments according to how likely they are. \n    We measure this by calculating the LR comparing each assignment `a` to the null model: `LR = L(a)/L0`. \n1) Find the *posterior pairing probabilities* `P(Vi = Mj | data)` for all combinations of i and j, \n    and the *posterior non-pairing probabilities* `P(Vi = '*' | data)` for all i. \n\n\n### The data\n\nThe pedigrees and genotypes for this toy example are available within **dvir** as a built-in dataset, under the name `example2`.\n\n```{r}\nexample2\n```\n\nInternally, all DVI datasets in **dvir** have the structure of a list, with elements `pm` (the victim data), `am` (the reference data) and `missing` (a vector naming the missing persons):\nWe can inspect the data by printing each object. For instance, in this case `am` is a list of two pedigrees:\n```{r}\nexample2$am\n```\nNote that the two pedigrees are printed in so-called _ped format_, with columns `id` (ID label), `fid` (father), `mid` (mother), `sex` (1 = male; 2 = female) and `L1` (genotypes at locus `L1`).\n\nThe code generating this dataset can be found in the github repository of **dvir**, more specifically here: https://github.com/magnusdv/dvir/blob/master/data-raw/example2.R.\n\nA great way to inspect a DVI dataset is to plot it with the function `plotDVI()`.\n```{r example-plot2, fig.height = 2.5, fig.width = 6, out.width = \"80%\"}\nplotDVI(example2)\n```\n\nThe `plotDVI()` function offers many parameters for tweaking the plot; see the help page `?plotDVI()` for details.\n\n### Joint identification\n\nThe `jointDVI()` function performs joint identification of all three victims, given the data. It returns a data frame ranking all assignments with nonzero likelihood:\n\n```{r}\njointRes = jointDVI(example2, verbose = FALSE)\n\n# Print the result\njointRes\n```\n\nThe output shows that the most likely joint solution is (V1, V2, V3) = (M1, M2, M3), with an LR of 250 compared\nto the null model. \n\nThe function `plotSolution()` shows the most likely solution:\n```{r solution, fig.height = 3, fig.width = 7, out.width = \"75%\"}\nplotSolution(example2, jointRes, marker = 1)\n```\n\nBy default, the plot displays the assignment in the first row of `jointRes`. To examine the second most likely, add `k = 2` (and so on to go further down the list).\n\n### Posterior pairing probabilities\nNext, we compute the posterior pairing (and non-pairing) probabilities. This is done by feeding the output from `jointDVI()` into the function `Bmarginal()`.\n\n```{r}\nBmarginal(jointRes, example2$missing, prior = NULL)\n```\nHere we used a default flat prior for simplicity, assigning equal prior probabilities to all assignments.\n\nwe see that the posterior pairing probabilities for the most likely solution are\n\n  * _P_(V1 = M1 | data) = 0.88,\n  * _P_(V2 = M2 | data) = 0.95,\n  * _P_(V3 = M2 | data) = 0.83.\n\n----\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagnusdv%2Fdvir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagnusdv%2Fdvir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagnusdv%2Fdvir/lists"}