View source: R/sig_fit_bootstrap_batch.R
sig_fit_bootstrap_batch | R Documentation |
Read sig_fit_bootstrap for more option setting.
sig_fit_bootstrap_batch(
catalogue_matrix,
methods = c("QP"),
n = 100L,
min_count = 1L,
p_val_thresholds = c(0.05),
use_parallel = FALSE,
seed = 123456L,
job_id = NULL,
result_dir = tempdir(),
...
)
catalogue_matrix |
a numeric matrix |
methods |
a subset of |
n |
the number of bootstrap replicates. |
min_count |
minimal exposure in a sample, default is 1. Any patient has total exposure less than this value will be filtered out. |
p_val_thresholds |
a vector of relative exposure threshold for calculating p values. |
use_parallel |
if |
seed |
random seed to reproduce the result. |
job_id |
a job ID, default is |
result_dir |
see above, default is temp directory defined by R. |
... |
other common parameters passing to sig_fit_bootstrap, including
|
a list
of data.table
.
sig_fit, sig_fit_bootstrap
# For mutational signatures ----------------
# SBS is used for illustration, similar
# operations can be applied to DBS, INDEL, CN, RS, etc.
# Load simulated data
data("simulated_catalogs")
data = simulated_catalogs$set1
data[1:5, 1:5]
# Fitting with COSMIC reference signatures
# Generally set n = 100
rv = sig_fit_bootstrap_batch(data,
sig_index = c(1, 5, 9, 2, 13),
sig_db = "SBS", n = 10)
rv
# For general purpose --------------------
W <- matrix(c(1, 2, 3, 4, 5, 6), ncol = 2)
colnames(W) <- c("sig1", "sig2")
W <- apply(W, 2, function(x) x / sum(x))
H <- matrix(c(2, 5, 3, 6, 1, 9, 1, 2), ncol = 4)
colnames(H) <- paste0("samp", 1:4)
V <- W %*% H
V
if (requireNamespace("quadprog")) {
z10 <- sig_fit_bootstrap_batch(V, sig = W, n = 10)
z10
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.