R/partial_signature.R
partial_signature.Rd
Remove the contribution of a SuperSig from the data and return the data.
partial_signature(data, object)
data | a data frame of mutations containing columns for
|
---|---|
object | an object of class |
predict_signature
returns the original data frame with
the contribution of a supervised signature removed
#> 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 Cinput_dt <- make_matrix(example_dt) # convert to correct format input_dt$IndVar <- c(1, 1, 1, 0, 0) # add IndVar column supersig <- get_signature(data = input_dt, factor = "Age") # get SuperSig#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>partial_signature(data = input_dt, object = supersig)#> # A tibble: 5 x 99 #> sample_id AGE `A[T>G]T` `C[T>A]A` `G[C>A]A` `G[C>G]G` `G[C>G]T` `A[C>G]T` #> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 1 50 0 1 1 0 0 0 #> 2 2 55 0 0 0 0 0 1 #> 3 3 72 0 1 0 0 0 0 #> 4 4 53 0 0 0 0 0 1 #> 5 5 48 0 1 1 0 0 0 #> # … with 91 more variables: C[C>A]T <dbl>, C[T>C]G <dbl>, T[C>A]C <dbl>, #> # T[C>A]T <dbl>, A[T>C]C <dbl>, C[T>C]C <dbl>, T[T>A]C <dbl>, C[C>G]G <dbl>, #> # G[C>T]A <dbl>, A[C>A]T <dbl>, C[C>A]C <dbl>, G[T>G]T <dbl>, C[C>T]C <dbl>, #> # T[C>T]C <dbl>, A[C>T]C <dbl>, G[C>T]C <dbl>, C[C>T]T <dbl>, T[C>T]T <dbl>, #> # A[C>T]T <dbl>, G[C>T]T <dbl>, C[C>T]A <dbl>, T[C>T]A <dbl>, A[C>T]A <dbl>, #> # C[C>T]G <dbl>, T[C>T]G <dbl>, A[C>T]G <dbl>, G[C>T]G <dbl>, A[C>A]C <dbl>, #> # G[C>A]C <dbl>, G[C>A]T <dbl>, C[C>A]A <dbl>, T[C>A]A <dbl>, A[C>A]A <dbl>, #> # C[C>A]G <dbl>, T[C>A]G <dbl>, A[C>A]G <dbl>, G[C>A]G <dbl>, C[C>G]C <dbl>, #> # T[C>G]C <dbl>, A[C>G]C <dbl>, G[C>G]C <dbl>, C[C>G]T <dbl>, T[C>G]T <dbl>, #> # C[C>G]A <dbl>, T[C>G]A <dbl>, A[C>G]A <dbl>, G[C>G]A <dbl>, T[C>G]G <dbl>, #> # A[C>G]G <dbl>, T[T>C]C <dbl>, G[T>C]C <dbl>, C[T>C]T <dbl>, T[T>C]T <dbl>, #> # A[T>C]T <dbl>, G[T>C]T <dbl>, C[T>C]A <dbl>, T[T>C]A <dbl>, A[T>C]A <dbl>, #> # G[T>C]A <dbl>, T[T>C]G <dbl>, A[T>C]G <dbl>, G[T>C]G <dbl>, C[T>A]C <dbl>, #> # A[T>A]C <dbl>, G[T>A]C <dbl>, C[T>A]T <dbl>, T[T>A]T <dbl>, A[T>A]T <dbl>, #> # G[T>A]T <dbl>, T[T>A]A <dbl>, A[T>A]A <dbl>, G[T>A]A <dbl>, C[T>A]G <dbl>, #> # T[T>A]G <dbl>, A[T>A]G <dbl>, G[T>A]G <dbl>, C[T>G]C <dbl>, T[T>G]C <dbl>, #> # A[T>G]C <dbl>, G[T>G]C <dbl>, C[T>G]T <dbl>, T[T>G]T <dbl>, C[T>G]A <dbl>, #> # T[T>G]A <dbl>, A[T>G]A <dbl>, G[T>G]A <dbl>, C[T>G]G <dbl>, T[T>G]G <dbl>, #> # A[T>G]G <dbl>, G[T>G]G <dbl>, IndVar <dbl>