supersigs is a companion R package to a method proposed by Afsari, et al. (2021, ELife) to generate mutational signatures from single nucleotide variants in the cancer genome. Note: Package is under active development.
More details on the statistical method can be found in this paper:
# Install package from Bioconductor if(!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install("supersigs")
You can also install the development version of supersigs from github using the
install_github() function from the
# Install development version from GitHub devtools::install_github("TomasettiLab/supersigs")
At a minimum, the data you will need are the age and mutations for each patient. An example is provided below. (Note that you will need to process the data before running the core functions, see
vignette("supersigs") for details.)
#> sample_id age chromosome position ref alt #> 1 1 50 chr1 94447621 G C #> 2 1 50 chr2 202005395 A C #> 3 1 50 chr7 20784978 T A #> 4 1 50 chr7 87179255 C G #> 5 1 50 chr19 1059712 G T #> 6 2 55 chr1 76226977 T C
In brief, the
supersigs package contains three core functions:
get_signature trains a supervised signature for a given factor (e.g. smoking).
supersig <- get_signature(data = data, factor = "smoking", wgs = F)
predict_signature uses the trained supervised signature to obtain predicted probabilities (e.g. probability of smoker) on a new dataset.
pred <- predict_signature(object = supersig, newdata = data, factor = "smoking")
partial_signature removes the contribution of a trained signature from the dataset.
data <- partial_signature(data = data, object = supersig)