Estimate single-locus allele frequencies with the Incomplete Data Model
Source:R/IDM_wrapper.R
IDM_wrapper.RdEstimates single-locus allele frequencies with the Incomplete Data Model
(or original model). Provide exactly one of allele_table or aa_calls.
Vendored MLE code is from Hashemi & Schneider (2024). Requires Rmpfr and
openxlsx (Suggests).
Usage
IDM_wrapper(
allele_table = "",
aa_calls = "",
slaf_output,
model = "IDM",
lambda_initial = 1,
eps_initial = 0.1
)Arguments
- allele_table
Path to allele table TSV, or
""/NULLif using amino-acid calls. See Inputs.- aa_calls
Path to amino-acid calls TSV, or
""/NULLif using an allele table. See Inputs.- slaf_output
Output TSV path. See Outputs.
- model
"IDM"(incomplete-data model),"OM"(original model), or"IDM_OM"(IDM, falling back to the OM at any locus the IDM leaves unsolved),"OM_CC"(OM with a continuity correction on lineage prevalence), or"IDM_OM_CC"(IDM, falling back to"OM_CC").- lambda_initial
Initial lambda for the numerical iteration.
- eps_initial
Initial epsilon for the numerical iteration.
Details
Inputs
allele_table: Allele table TSV, or""/NULLif usingaa_calls. Seevignette("input-formats", package = "PGEcore").aa_calls: Amino-acid calls TSV, or""/NULLif usingallele_table.
Outputs
slaf_output: Single-locus allele frequencies. Allele-table input is written astarget_name,seq,freq; AA-call input asvariant,freq.
Running
IDM_wrapper(
allele_table = "allele_table.tsv",
slaf_output = "slaf.tsv"
)Requires Rmpfr and openxlsx (Suggests).