Prediction of exposures in new samples using pre-existing signatures
Source:R/discovery_prediction.R
predict_exposure.Rd
Exposures for samples will be predicted using an existing set
of signatures stored in a result_model
object.
Algorithms available for prediction include a modify version of "lda"
,
and "decompTumor2Sig"
.
Usage
predict_exposure(
musica,
modality,
signature_res,
algorithm = c("lda", "decompTumor2Sig"),
result_name = "result",
model_id = NULL,
signatures_to_use = seq_len(ncol(signatures(signature_res))),
verbose = FALSE,
make_copy = FALSE,
table_name = NULL
)
Arguments
- musica
A
musica
object.- modality
Modality for posterior prediction. Must match the table type used to generate the prediction signatures
- signature_res
Signatures used to predict exposures for the samples
musica
object. Existing signatures need to stored in aresult_model
object.- algorithm
Algorithm to use for prediction of exposures. One of
"lda"
or"decompTumor2Sig"
.- result_name
Name for result_list entry to save the results to. Default
"result"
.- model_id
Identifier for the result. If
NULL
, will be automatically set to the algorithm and number of signatures. DefaultNULL
.- signatures_to_use
Which signatures in the
signature_res
result object to use. Default is to use all signatures.- verbose
If
TRUE
, progress will be printing. Only used ifalgorithm = "lda"
. DefaultFALSE
.- make_copy
If
FALSE
, the inputtedmusica
object is updated and nothing is returned. IfTRUE
, a newmusica
object is created and returned. DefaultFALSE
.- table_name
Use modality instead
Value
Returns nothing or a new musica
object,
depending on the make_copy
parameter.
Examples
data(musica)
data(cosmic_v2_sigs)
g <- select_genome("19")
build_standard_table(musica, g, "SBS96", overwrite = TRUE)
#> Building count table from SBS with SBS96 schema
#> Warning: Overwriting counts table: SBS96
result <- predict_exposure(
musica = musica, modality = "SBS96",
signature_res = cosmic_v2_sigs, algorithm = "lda"
)
# Predict using LDA-like algorithm with seed set to 1
set.seed(1)
predict_exposure(
musica = musica, modality = "SBS96",
signature_res = cosmic_v2_sigs, algorithm = "lda"
)
#> model_id lda30_exp_pred already exists. model_id updated to lda30_exp_pred.1