DecoupleR integration
2024-02-27
spacedeconv-decoupleR.Rmd
We provide wrapper functions to spatially quantify Pathway and Transcription Factor activities using DecoupleR.
library(spacedeconv)
## → checking spacedeconv environment and dependencies
To compute activities you need to obtain a reference from OmniPathR.
The method
can be one of “progeny”, “dorothea” or
“collectri”.
ref <- get_decoupleR_reference(method = "progeny", organism = "human")
## ── spacedeconv ─────────────────────────────────────────────────────────────────
## ℹ Getting decoupleR reference
## ✔ Got decoupleR reference [3.8s]
##
head(ref)
## # A tibble: 6 × 4
## source target weight p_value
## <chr> <chr> <dbl> <dbl>
## 1 Androgen TMPRSS2 11.5 2.38e-47
## 2 Androgen NKX3-1 10.6 2.21e-44
## 3 Androgen MBOAT2 10.5 4.63e-44
## 4 Androgen KLK2 10.2 1.94e-40
## 5 Androgen SARG 11.4 2.79e-40
## 6 Androgen SLC38A4 7.36 1.25e-39
In the next step the activities can be computed.
data("spatial_data_3")
spatial_data_3 <- preprocess(spatial_data_3)
spatial_data_3 <- normalize(spatial_data_3)
spe <- compute_activities(spatial_data_3, reference = ref, method = "wmean", assay = "cpm")