Obtain or Modify Signature Information
a Signature
object obtained either from sig_extract or sig_auto_extract.
new signature names.
one of 'row', 'column', 'raw' and "feature", for row normalization (signature), column normalization (component), raw data, row normalization by feature, respectively.
one of 'absolute' and 'relative'.
a Signature
object or data.
## Operate signature names
load(system.file("extdata", "toy_mutational_signature.RData",
package = "sigminer", mustWork = TRUE
))
sig_names(sig2)
#> [1] "Sig1" "Sig2" "Sig3"
cc <- sig_modify_names(sig2, new_names = c("Sig2", "Sig1", "Sig3"))
sig_names(cc)
#> [1] "Sig2" "Sig1" "Sig3"
# The older names are stored in tags.
print(attr(cc, "tag"))
#> [1] "Older names:Sig1,Sig2,Sig3;"
## Get signature number
sig_number(sig2)
#> [1] 3
## Get signature attributes
sig_number(sig2)
#> [1] 3
## Get signature matrix
z <- sig_signature(sig2)
z <- sig_signature(sig2, normalize = "raw")
## Get exposure matrix
## Of note, this is different from get_sig_exposure()
## it returns a matrix instead of data table.
z <- sig_exposure(sig2) # it is same as sig$Exposure
z <- sig_exposure(sig2, type = "relative") # it is same as sig2$Exposure.norm