Title: | Kinship Analysis with Linked Markers |
---|---|
Description: | A 'shiny' application for forensic kinship testing, based on the 'pedsuite' R packages. 'KLINK' is closely aligned with the (non-R) software 'Familias' and 'FamLink', but offers several unique features, including visualisations and automated report generation. The calculation of likelihood ratios supports pairs of linked markers, and all common mutation models. |
Authors: | Magnus Dehli Vigeland [aut, cre] |
Maintainer: | Magnus Dehli Vigeland <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.0.2 |
Built: | 2024-10-04 06:20:09 UTC |
Source: | CRAN |
This function returns a "maximal" set of disjoint pairs of linked markers, given a genetic marker map and a subset of the markers included in the map. The pairs are identified in a greedy manner, successively choosing the closest markers on each chromosome.
getLinkedPairs(markers, linkageMap, maxdist = Inf)
getLinkedPairs(markers, linkageMap, maxdist = Inf)
markers |
A character vector containing marker names. |
linkageMap |
A data frame with columns including |
maxdist |
A positive number indicating the maximum linkage distance (in cM). Markers further apart than this are considered unlinked. |
A list of character vectors, each containing two marker names.
# Example using the built-in map of 50 STR markers map = KLINK::LINKAGEMAP getLinkedPairs(map$Marker, map, maxdist = 25)
# Example using the built-in map of 50 STR markers map = KLINK::LINKAGEMAP getLinkedPairs(map$Marker, map, maxdist = 25)
This launches the KLINK app. runKLINK()
is a synonym for launchApp()
, but
with an additional argument version
.
launchApp() runKLINK(version = NULL)
launchApp() runKLINK(version = NULL)
version |
A character, e.g. "1.0.0". If the installed version of KLINK differs from this, the program aborts with an error. |
No return value, called for side effects.
## Not run: launchApp() ## End(Not run)
## Not run: launchApp() ## End(Not run)
A genetic map including 50 autosomal STR markers.
LINKAGEMAP
LINKAGEMAP
A data frame with 50 rows and 4 columns: Marker
, Kit
, Chrom
,
PosCM
.
This function does the main LR calculations of the KLINK app.
linkedLR( pedigrees, linkageMap, linkedPairs = NULL, maxdist = Inf, markerData = NULL, mapfun = "Kosambi", lumpSpecial = TRUE )
linkedLR( pedigrees, linkageMap, linkedPairs = NULL, maxdist = Inf, markerData = NULL, mapfun = "Kosambi", lumpSpecial = TRUE )
pedigrees |
A list of two pedigrees. |
linkageMap |
A data frame with columns including |
linkedPairs |
A list of marker pairs. If not supplied, calculated as
|
maxdist |
A number, passed onto |
markerData |
A data frame with marker data, typically the output of
|
mapfun |
Name of the map function to be used; either "Haldane" or "Kosambi" (default). |
lumpSpecial |
A logical, by default TRUE. |
A data frame with detailed LR results.
library(forrel) ped1 = nuclearPed(fa = "AF", child = "CH") |> profileSim(markers = NorwegianFrequencies) ped2 = singletons(c("AF", "CH")) |> transferMarkers(from = ped1, to = _) pedigrees = list(ped1, ped2) linkedLR(pedigrees, KLINK::LINKAGEMAP) # For testing # .linkedLR(pedigrees, markerpair = c("SE33", "D6S474"), linkageMap = LINKAGEMAP)
library(forrel) ped1 = nuclearPed(fa = "AF", child = "CH") |> profileSim(markers = NorwegianFrequencies) ped2 = singletons(c("AF", "CH")) |> transferMarkers(from = ped1, to = _) pedigrees = list(ped1, ped2) linkedLR(pedigrees, KLINK::LINKAGEMAP) # For testing # .linkedLR(pedigrees, markerpair = c("SE33", "D6S474"), linkageMap = LINKAGEMAP)
Load .fam file
loadFamFile(path, fallbackModel = "equal", withParams = FALSE)
loadFamFile(path, fallbackModel = "equal", withParams = FALSE)
path |
The path to a .fam file. |
fallbackModel |
The name of a mutation model; passed on to
|
withParams |
A logical indicating if the Familias parameters should be
included in the output. (See |
A list of two ped
objects.
fam = system.file("extdata/halfsib-test.fam", package = "KLINK") peds = loadFamFile(fam) pedtools::plotPedList(peds)
fam = system.file("extdata/halfsib-test.fam", package = "KLINK") peds = loadFamFile(fam) pedtools::plotPedList(peds)
Generate table of marker data
markerSummary(pedigrees, replaceNames = FALSE)
markerSummary(pedigrees, replaceNames = FALSE)
pedigrees |
A list of 2 pedigrees. |
replaceNames |
A logical, indicating if IDs should be changed to Person1, Person2, ... |
A data frame.
markerSummary(paternity)
markerSummary(paternity)
Parse XML file associated with .fam file
parseXML(xml)
parseXML(xml)
xml |
Path to a file with extension .xml. |
# (No example included)
# (No example included)
A list of two pedigrees forming the hypotheses in a paternity case: H1 (AF
is
the father of CH
) and H2 (unrelated). AF
and CH
are genotyped with 11
markers, with allele frequencies from forrel::NorwegianFrequencies
.
paternity
paternity
A list of two pedigrees, named H1 and H2.
pedtools::plotPedList(paternity, marker = "SE33") markerSummary(paternity) forrel::kinshipLR(paternity)
pedtools::plotPedList(paternity, marker = "SE33") markerSummary(paternity) forrel::kinshipLR(paternity)
This function produces an Excel document containing the genotype data and various LR tables.
writeResult( resultTable, pedigrees, linkageMap, markerData, outfile, notes = NULL, famname = NULL, settings = NULL, XML = NULL )
writeResult( resultTable, pedigrees, linkageMap, markerData, outfile, notes = NULL, famname = NULL, settings = NULL, XML = NULL )
resultTable |
A data frame. |
pedigrees |
A list of two |
linkageMap |
A data frame. |
markerData |
A data frame. |
outfile |
The output file name. |
notes |
A character vector. |
famname |
The name of the input |
settings |
A list of KLINK settings to be included in the output |
XML |
Optional data from .xml file. |
# Built-in dataset `paternity` peds = paternity map = LINKAGEMAP mdata = markerSummary(peds) # Result table LRtab = linkedLR(pedigrees = peds, linkageMap = map, markerData = mdata) # Write to excel tmp = paste0(tempfile(), ".xlsx") writeResult(LRtab, pedigrees = peds, linkageMap = map, markerData = mdata, outfile = tmp) # openxlsx::openXL(tmp)
# Built-in dataset `paternity` peds = paternity map = LINKAGEMAP mdata = markerSummary(peds) # Result table LRtab = linkedLR(pedigrees = peds, linkageMap = map, markerData = mdata) # Write to excel tmp = paste0(tempfile(), ".xlsx") writeResult(LRtab, pedigrees = peds, linkageMap = map, markerData = mdata, outfile = tmp) # openxlsx::openXL(tmp)