betaBinomXI {XCIR} | R Documentation |
Fit a mixture model to estimate mosaicism and XCI-escape.
betaBinomXI(genic_dt, model = "AUTO", plot = FALSE, hist = FALSE, flag = 0, xciGenes = NULL, a0 = NULL, optimizer = c("nlminb", "optim"), method = NULL, limits = TRUE, debug = FALSE)
genic_dt |
A |
model |
A |
plot |
A |
hist |
A |
flag |
A |
xciGenes |
A |
a0 |
A |
optimizer |
A |
method |
A |
limits |
A |
debug |
A |
The model determines the number of components used in the mixture model. By default, "AUTO" tries all combinations of mixtures and the best estimate is kept using backward selection based on AIC. BB is a simple beta-binomial. MM adds a binomial component to model the sequencing errors. MM2 jointly models the probability of misclasification in the training set. MM3 include all 3 components.
Flags in the output reports issues in convergence. If flag
is set to 0,
nothing is done. If set to 1, the model selection will avoid flagged models
(will favor parcimonious models).
If set to 2, calls for which the best selected model had convergence issue
will be removed.
A data.table
with an entry per sample and per gene.
getGenicDP readXCI
library(data.table) # Simulated data dtf <- system.file("extdata/data2_vignette.tsv", package = "XCIR") dt <- fread(dtf) xcigf <- system.file("extdata/xcig_vignette.txt", package = "XCIR") xcig <- readLines(xcigf) # Run all models on the data all <- betaBinomXI(dt, xciGenes = xcig) # Simple BetaBinomial model and show histogram of skewing bb <- betaBinomXI(dt, xciGenes = xcig, model = "BB", hist = TRUE) # Plotting fits stoshow <- paste0("sample", c(31, 33, 35, 40)) #interesting samples plotQC(all[sample %in% stoshow], xcig = xcig) # Summarizing results # Sample information samps <- sample_clean(all) # Gene-level predictions xcistates <- getXCIstate(all)