Skip to content

Commit

Permalink
Ensured same code writing style across code blocks and vignettes.
Browse files Browse the repository at this point in the history
  • Loading branch information
enblacar committed Jul 21, 2024
1 parent b3f3411 commit a9632fb
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vignettes/decoupleR.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ res_gsea <- decoupleR::run_fgsea(mat = mat,
.target = 'target',
nproc = 1,
minsize = 0)
res_gsea
```

Expand All @@ -202,6 +203,7 @@ res_ulm <- decoupleR::run_ulm(mat = mat,
.target = 'target',
.mor = 'mor',
minsize = 0)
res_ulm
```

Expand Down Expand Up @@ -285,6 +287,7 @@ res_decouple <- decoupleR::decouple(mat,
.source ='source',
.target ='target',
minsize = 0)
res_decouple
```

Expand Down
2 changes: 2 additions & 0 deletions vignettes/pw_bk.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ head(counts)
The design meta-data:
```{r "design"}
design <- data$design
design
```

Expand Down Expand Up @@ -197,6 +198,7 @@ contrast_acts <- decoupleR::run_mlm(mat =deg,
.target = 'target',
.mor = 'weight',
minsize = 5)
contrast_acts
```

Expand Down
8 changes: 8 additions & 0 deletions vignettes/tf_bk.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,14 @@ counts <- data$counts %>%
~ dplyr::if_else(is.na(.x), 0, .x)) %>%
tibble::column_to_rownames(var = "gene") %>%
as.matrix()
head(counts)
```

The design meta-data:
```{r "design"}
design <- data$design
design
```

Expand All @@ -97,6 +99,7 @@ deg <- data$limma_ttop %>%
dplyr::filter(!is.na(t)) %>%
tibble::column_to_rownames(var = "ID") %>%
as.matrix()
head(deg)
```

Expand All @@ -118,6 +121,7 @@ recommend to keep complexes together.
```{r "collectri"}
net <- decoupleR::get_collectri(organism = 'human',
split_complexes = FALSE)
net
```

Expand All @@ -140,6 +144,7 @@ sample_acts <- decoupleR::run_ulm(mat = counts,
.target = 'target',
.mor = 'mor',
minsize = 5)
sample_acts
```

Expand Down Expand Up @@ -199,6 +204,7 @@ contrast_acts <- decoupleR::run_ulm(mat = deg[, 't', drop = FALSE],
.target = 'target',
.mor='mor',
minsize = 5)
contrast_acts
```

Expand Down Expand Up @@ -247,6 +253,7 @@ p <- ggplot2::ggplot(data = f_contrast_acts,
panel.grid.major = element_blank(),
panel.grid.minor = element_blank()) +
ggplot2::xlab("TFs")
p
```

Expand Down Expand Up @@ -295,6 +302,7 @@ p <- ggplot2::ggplot(data = df,
ggplot2::geom_vline(xintercept = 0, linetype = 'dotted') +
ggplot2::geom_hline(yintercept = 0, linetype = 'dotted') +
ggplot2::ggtitle(tf)
p
```

Expand Down
6 changes: 6 additions & 0 deletions vignettes/tf_sc.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ p <- Seurat::DimPlot(data,
label = TRUE,
pt.size = 0.5) +
Seurat::NoLegend()
p
```

Expand All @@ -90,6 +91,7 @@ recommend to keep complexes together.
```{r "collectri"}
net <- decoupleR::get_collectri(organism = 'human',
split_complexes = FALSE)
net
```

Expand All @@ -115,6 +117,7 @@ acts <- decoupleR::run_ulm(mat = mat,
.target = 'target',
.mor='mor',
minsize = 5)
acts
```

Expand Down Expand Up @@ -168,14 +171,17 @@ p3 <- Seurat::FeaturePlot(data,
ggplot2::ggtitle('PAX5 expression')
Seurat::DefaultAssay(data) <- "tfsulm"
p <- p1 | p2 | p3
p
```

# Exploration
We can also see what is the mean activity per group of the top 20 more variable
TFs:
```{r "mean_acts", message = FALSE, warning = FALSE}
n_tfs <- 25
# Extract activities from object as a long dataframe
df <- t(as.matrix(data@assays$tfsulm@data)) %>%
as.data.frame() %>%
Expand Down

0 comments on commit a9632fb

Please sign in to comment.