Sums a list of sigverse catalogues, or two individual catalogues, into a single result.
Arguments
- catalogues
A named list of
sigverse
catalogue data.frames. Seesigshared::example_catalogue_collection()
Value
A sigverse
catalogue data.frame representing the total. See sigshared::example_catalogue()
.
Details
This function is useful for aggregating catalogues across samples or replicates.
If you only need to add two catalogues, you may use the %+%
operator instead.
See also
%+%
for summing two catalogues
Examples
library(sigstash)
# Load a signature collection
signatures <- sig_load("COSMIC_v3.3.1_SBS_GRCh38")
# Reconstruct catalogues for two pure samples (each with 100 mutations)
catalogue1 <- sig_reconstruct(signatures[['SBS3']], n = 100)
catalogue2 <- sig_reconstruct(signatures[['SBS4']], n = 100)
# Sum catalogue1 and catalogue2
catalogue_sum <- catalogue1 %+% catalogue2
# Sum a collection
collection <- list(cat1 = catalogue1, cat2 = catalogue2)
collection <- sig_sum(collection)