inferEvidence: inferEvidence

View source: R/inferEvidence.R

inferEvidenceR Documentation

inferEvidence

Description

Function to perform inference of new evidence (MLE based) restricted on calibration inference

Usage

inferEvidence(
  samples,
  popFreq,
  refData = NULL,
  hypothesis,
  calibration,
  kit = NULL,
  platform = "MPS",
  nDone = 3,
  delta = 1,
  steptol = 1e-04,
  seed = NULL,
  verbose = FALSE,
  model = "GA"
)

Arguments

samples

Sample information for evidence profile(s). Must be a list[[sample]][[loc]] = list(adata,hdata)

popFreq

Allele frequencies for a given population. Must be a list[[loc]] = freqs

refData

Sample information for reference profile(s). Must be a list[[sample]][[loc]] = adata

hypothesis

A list which defines the hypothesis to evaluate. Must contain the following elements: NOC Number of contributors in model (Mandatory). condOrder (conditioning references from refData (must be consistent order). For instance condOrder=(0,2,1,0) means that we restrict the model such that Ref2 and Ref3 are respectively conditioned as 2. contributor and 1. contributor in the model. fst The co-ancestry coefficient. Can be a vector (must contain the marker names). Default is 0. knownRef Specify known non-contributing references from refData (indices). For instance knownRef=(1,2) means that reference 1 and 2 is known non-contributor in the hypothesis. This affectes coancestry correction.

calibration

A list from calibration results (per marker). Must contain the following elements (in following order): AT Analytical threshold markerEff Marker efficiency param (possibly also SD if running inferEvidence2) nNoiseParam Parameter for modeling distr of number of noise (Noise model) noiseSizeParam Parameter for modeling size of noise alleles (Noise model) Reg-coeffs (b0,b1,b2) for different stutter types (each element considers a particular stutter type)

kit

Selected kit for assuming degradation model.

platform

Which platform that is used (MPS or CE)

nDone

Number of optimizations required providing equivalent results (same logLik value obtained)

delta

Scaling of variation of normal distribution when drawing random startpoints. Default is 1.

steptol

Argument used in the nlm function for faster return from the optimization (tradeoff is lower accuracy).

seed

The user can set seed if wanted

verbose

Whether to print out progress

model

Selected model for the signals (read/peak heights): "GA"=gamma,"NB"=negative binomial

Details

Optimizes only sample specific params (mx,mu,omega). Fixating params from fitted calibration (marker efficiency, noise, stutter expectations).

Value

Fitted object for evidence (similar as euroformix::contLikMLE)

Examples

## Not run:  
kit = "ForenSeq"
pkg = path.package("MPSproto")
calib =  readRDS(paste0(pkg,"/paper_stutterChar/calibrated_MPSproto.RDS"))
popFreq =  importMPSfreqs(paste0(pkg,"/paper_stutterChar/freqFile_ForenSeqFWbrack_Norway.csv"))[[1]]
gen = genMPSevidence(calib,2,popFreq,mu=1000,omega=0.2,beta=1,kit=kit )
plotMPS(gen$samples,gen$refData,AT=10)
hyp = list(NOC=2,cond=c(1,0),fst=0.01)
fit = inferEvidence(gen$samples,popFreq,gen$refData, hyp,calib)
valid = validMLE(fit)

## End(Not run)

oyvble/MPSproto documentation built on March 19, 2024, 5:32 a.m.