Title: | Forensic Bayesian Networks |
Version: | 1.0.4 |
Description: | Open-source package for computing likelihood ratios in kinship testing and human identification cases. It has the core function of the software GENis, developed by Fundación Sadosky. It relies on a Bayesian Networks framework and is particularly well suited to efficiently perform large-size queries against databases of missing individuals. |
License: | GPL (≥ 3) |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 7.3.2 |
URL: | https://marsicofl.github.io/fbnet/, https://github.com/MarsicoFL/fbnet |
BugReports: | https://github.com/MarsicoFL/fbnet/issues |
Imports: | graphics, grDevices, igraph, stats |
NeedsCompilation: | no |
Packaged: | 2025-02-04 15:39:31 UTC; franco |
Author: | Franco Marsico [aut, cre], Ariel Chernomoretz [aut] |
Maintainer: | Franco Marsico <franco.lmarsico@gmail.com> |
Depends: | R (≥ 3.5.0) |
Repository: | CRAN |
Date/Publication: | 2025-02-04 16:20:06 UTC |
fbnet: Forensic Bayesian Networks
Description
'fbnet' is an open source software package written in R statistical languaje. It relies on a Bayesian Networks framework doi:10.1017/CBO9780511811357. It is particularly well suited to efficiently perform large-size queries against databases of missing individuals. It could interact with the main functionallities of other packages for pedigree analysis. In particular, 'fbnet' imports the 'Familias' software doi:10.1016/S0379-0738(00)00147-X. In addition 'pedtools', a software for creating and manipulating pedigrees and markers, is supported. 'fbnet' allows computing LRs and obtaining genotype probability distributions for query individual, based on the pedigree data. 'fbnet' implements the complete GENis functionality, a recently published open-source multi-tier information system developed to run forensic DNA databases to perform kinship analysis based on DNA profiles doi:10.1016/j.fsir.2020.100132.
Author(s)
Maintainer: Franco Marsico franco.lmarsico@gmail.com
Authors:
Ariel Chernomoretz ariel@df.uba.ar
See Also
Useful links:
Report bugs at https://github.com/MarsicoFL/fbnet/issues
STRs allelic frequencies from Argentina.
Description
STRs allelic frequencies from Argentina.
Usage
Argentina_STRs
Format
A data frame with allele frequencies
Initialized bayesian network.
Description
Initialized bayesian network.
Usage
bnet
Format
Initialized bayesian network, based on toyped.
buildBN: a function for building the bayesian network.
Description
buildBN: a function for building the bayesian network.
Usage
buildBN(pbn, QP)
Arguments
pbn |
A bayesian network for pedigree object with information of the genotyped members. The ped object must be in Familias format. |
QP |
Query Persons Ids |
Value
A bayesian network based on pedigree evidence and QP definition.
buildCPTs: a function for building conditional probability tables based on pedigree bayesian network.
Description
buildCPTs: a function for building conditional probability tables based on pedigree bayesian network.
Usage
buildCPTs(
bn,
bNodePrunning = TRUE,
bStateRemoval = TRUE,
bStateRemoval2 = TRUE,
lumpingParameter = NULL,
renorm = "row-wise",
verbose = FALSE
)
Arguments
bn |
A bayesian network for pedigree object with information of the genotyped members. The ped object must be in Familias format. |
bNodePrunning |
Standard pruning. |
bStateRemoval |
State based pruning. |
bStateRemoval2 |
State based pruning (model 2). |
lumpingParameter |
Used for stepwise mutational model. |
renorm |
If "row-wise" is selected, zero probability is assigned for transitions out of range. |
verbose |
Computations output. |
Value
A bayesian network based on pedigree evidence and QP definition.
evidencePrunning: a fuction for pruning instantiated variables.
Description
evidencePrunning: a fuction for pruning instantiated variables.
Usage
evidencePrunning(bn)
Arguments
bn |
A bayesian network (output of buildBN function). |
Value
A preprocessed bayesian network.
factorHeteroFounders: a function for multiplying probabilities in case of heterocigote founders.
Description
factorHeteroFounders: a function for multiplying probabilities in case of heterocigote founders.
Usage
factorHeteroFounders(rresQ, bn)
Arguments
rresQ |
List of CPTs. |
bn |
A bayesian network for pedigree object with information of the genotyped members. The ped object must be in Familias format. |
Value
A dataframe with genotype probabilities.
getConditional: a function for obtaining the coditional probability tables based on a given evidence.
Description
getConditional: a function for obtaining the coditional probability tables based on a given evidence.
Usage
getConditional(lf)
Arguments
lf |
A list of joint probabilities. |
Value
A list of conditioned probabilities.
getGenotypeTables: a function for obtaining genotypetables after variable elimination and using available genetic evidence.
Description
getGenotypeTables: a function for obtaining genotypetables after variable elimination and using available genetic evidence.
Usage
getGenotypeTables(bn, resQ, geno = NULL, lqp = NULL)
Arguments
bn |
A bayesian network for pedigree object with information of the genotyped members. The ped object must be in Familias format. |
resQ |
List of CPTs. |
geno |
data.frame with genotypes. |
lqp |
list of individuals genotypes. |
Value
A dataframe with genotype probabilities.
getLocusCPT: a function for obtaining the coditional probability table from a specific locus.
Description
getLocusCPT: a function for obtaining the coditional probability table from a specific locus.
Usage
getLocusCPT(bn, locus, lumpingParameter = NULL, renorm = "row-wise")
Arguments
bn |
A bayesian network for pedigree object with information of the genotyped members. The ped object must be in Familias format. |
locus |
Specified locus. |
lumpingParameter |
Used for stepwise mutational model. |
renorm |
If "row-wise" is selected, zero probability is assigned for transitions out of range. |
Value
A bayesian network based on pedigree evidence and QP definition.
factorHeteroFounders: a function for multiplying probabilities in case of heterocigote founders.
Description
factorHeteroFounders: a function for multiplying probabilities in case of heterocigote founders.
Usage
getMAP(resQ, topn = 3)
Arguments
resQ |
List of CPTs. |
topn |
Format parameter. |
Value
A MAP from the probability table.
getGenotypeTables: a function for obtaining genotypetables after variable elimination and using available genetic evidence.
Description
getGenotypeTables: a function for obtaining genotypetables after variable elimination and using available genetic evidence.
Usage
getQSetRMP(bn, lqp)
Arguments
bn |
A bayesian network for pedigree object with information of the genotyped members. The ped object must be in Familias format. |
lqp |
list of individuals genotypes. |
Value
A dataframe with genotype probabilities.
getValuesOut: a function for getting out variables with zero probability in the bayesian network
Description
getValuesOut: a function for getting out variables with zero probability in the bayesian network
Usage
getValuesOut(cpt, condVar = c())
Arguments
cpt |
conditional probability table from the bayesian network |
condVar |
variables from the conditioning table |
Value
A processed conditional probability table
imposeEvidence: a fuction for imposing evidence in the bayesian network.
Description
imposeEvidence: a fuction for imposing evidence in the bayesian network.
Usage
imposeEvidence(bn)
Arguments
bn |
A bayesian network (output of buildBN function). |
Value
A preprocessed bayesian network.
initBN: a function to initialize the bayesian network.
Description
initBN: a function to initialize the bayesian network.
Usage
initBN(ped = NULL, bplotped = FALSE)
Arguments
ped |
A ped object with information of the genotyped members. The ped object must be in Familias format. |
bplotped |
An alternative ped object to be compared. |
Value
A bayesian network.
Examples
ped <- list(
id = c(1, 2, 3),
father = c(0, 0, 1),
mother = c(0, 0, 2),
sex = c(1, 2, 1), # 1 = male, 2 = female
genotype = c("AA", "AB", "BB")
)
bplotped <- list(
id = c(4, 5),
father = c(0, 4),
mother = c(0, 5),
sex = c(1, 2),
genotype = c("AB", "AA")
)
initBN.fromPed: a function to initialize the bayesian network.
Description
initBN.fromPed: a function to initialize the bayesian network.
Usage
initBN.fromPed(ped, bplotped)
Arguments
ped |
A ped object in Familias format. |
bplotped |
An alternative ped object to be compared. |
Value
A bayesian network.
initBN.fromVars: a function to initialize the bayesian network.
Description
initBN.fromVars: a function to initialize the bayesian network.
Usage
initBN.fromVars(bplotped)
Arguments
bplotped |
An alternative ped object to be compared. |
Value
A bayesian network.
minOrdering: a function for getting an ordering of bayesian network variables not in Q using min fill criteria on interaction graphs.
Description
minOrdering: a function for getting an ordering of bayesian network variables not in Q using min fill criteria on interaction graphs.
Usage
minOrdering(bn, vars = NULL, method = c("min_degree", "min_fill")[1])
Arguments
bn |
A bayesian network for pedigree object with information of the genotyped members. The ped object must be in Familias format. |
vars |
Subset of tables where the order is calculated |
method |
Elimination method, min_degree or min_fill |
Value
A bayesian network after ordering process.
Prepared pedigree for bayesian network trimming.
Description
Prepared pedigree for bayesian network trimming.
Usage
pbn
Format
A data.matrix.
prodFactor: a function for performing product between probability tables.
Description
prodFactor: a function for performing product between probability tables.
Usage
prodFactor(laux)
Arguments
laux |
probability distribution aux |
Value
A dataframe with probabilities.
pruneNodes: a fuction for clasical pruning in bayesian networks.
Description
pruneNodes: a fuction for clasical pruning in bayesian networks.
Usage
pruneNodes(bn)
Arguments
bn |
A bayesian network (output of buildBN function). |
Value
A preprocessed bayesian network.
removeEvidenceFromPed: a function for removing evidence from specific individuals in a ped object.
Description
removeEvidenceFromPed: a function for removing evidence from specific individuals in a ped object.
Usage
removeEvidenceFromPed(pped, idNotEv)
Arguments
pped |
A ped object with information of the genotyped members. The ped object must be in Familias format. |
idNotEv |
A set of individuals whom evidence should be removed. |
Value
A ped object.
reportLR: a function for calculating the LRs of specified genotypes in a pedigree.
Description
reportLR: a function for calculating the LRs of specified genotypes in a pedigree.
Usage
reportLR(bn, resQ, geno = NULL)
Arguments
bn |
A bayesian network for pedigree object with information of the genotyped members. The ped object must be in Familias format. |
resQ |
List of CPTs. |
geno |
data.frame with genotypes. |
Value
A dataframe with LRs.
reportPQ: a function for calculating the probability of specified genotypes in a pedigree.
Description
reportPQ: a function for calculating the probability of specified genotypes in a pedigree.
Usage
reportPQ(bn, resQ, geno = NULL)
Arguments
bn |
A bayesian network for pedigree object with information of the genotyped members. The ped object must be in Familias format. |
resQ |
List of CPTs. |
geno |
data.frame with genotypes. |
Value
A dataframe with genotype probabilities.
reverseSpit: a function for formatting.
Description
reverseSpit: a function for formatting.
Usage
reverseSplit(inList)
Arguments
inList |
input for formatting. |
Value
A bayesian network.
setOrdering: a function for selecting the ordering method in the elimination process.
Description
setOrdering: a function for selecting the ordering method in the elimination process.
Usage
setOrdering(bn, ordMethod, vars = NULL, orderElim = NULL)
Arguments
bn |
A bayesian network for pedigree object with information of the genotyped members. The ped object must be in Familias format. |
ordMethod |
Ordering method. |
vars |
Vars |
orderElim |
Order elimination criteria. |
Value
A bayesian network after ordering process.
stateRemoval: a function for processing the bayesian network.
Description
stateRemoval: a function for processing the bayesian network.
Usage
stateRemoval(bn)
Arguments
bn |
A bayesian network (output of buildBN function). |
Value
A preprocessed bayesian network.
stateRemoval2: a function for processing the bayesian network. It implements another approach from the described in stateRemoval function.
Description
stateRemoval2: a function for processing the bayesian network. It implements another approach from the described in stateRemoval function.
Usage
stateRemoval2(bn, verbose = FALSE)
Arguments
bn |
A bayesian network (output of buildBN function). |
verbose |
Computation output. |
Value
A preprocessed bayesian network.
stateRemovalSubnucs: a fuctiong for variable state pruning.
Description
stateRemovalSubnucs: a fuctiong for variable state pruning.
Usage
stateRemovalSubnucs(bn, verbose = FALSE)
Arguments
bn |
A bayesian network (output of buildBN function). |
verbose |
Computation output. |
Value
A preprocessed bayesian network.
prodFactor: a function for performing sum between probability tables.
Description
prodFactor: a function for performing sum between probability tables.
Usage
sumFactor(cpt, Z)
Arguments
cpt |
Conditional probability table |
Z |
factor |
Value
A dataframe with probabilities.
Toy allele frequency database.
Description
Toy allele frequency database.
Usage
toybase
Format
A data frame two markers allele frequencies
STRs allelic frequencies from specified country.
Description
STRs allelic frequencies from specified country.
Usage
toyped
Format
A toy pedigree. Nuclear family.
velim.bn: a function for variable elimination in a bayesian network.
Description
velim.bn: a function for variable elimination in a bayesian network.
Usage
velim.bn(
bn,
ordMethod = c("id", "min_degree", "min_fill", "fixed")[2],
orderElim = NULL,
verbose = FALSE
)
Arguments
bn |
A bayesian network for pedigree object with information of the genotyped members. The ped object must be in Familias format. |
ordMethod |
Selected ordering method between id, min_degree, min_fill and fixed. |
orderElim |
Elimination order. |
verbose |
Computation output. |
Value
Variable elimination result.