Skip to content

Commit

Permalink
Fixed azimuth saving pred and some fig dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
royfrancis committed Feb 25, 2024
1 parent 90b638e commit 73947f2
Show file tree
Hide file tree
Showing 27 changed files with 149 additions and 3,299 deletions.
15 changes: 12 additions & 3 deletions compiled/labs/seurat/seurat_06_celltyping.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ saveRDS(C, file = "data/covid/results/ctrl13_count_matrix.rds")
Instead load the results and visualize:

``` {r}
#| fig-height: 7
#| fig-width: 8
path_data <- "https://export.uppmax.uu.se/naiss2023-23-3/workshops/workshop-scrnaseq"
path_file <- "data/covid/results/azimuth_pred.tsv"
if (!dir.exists(dirname(path_file))) dir.create(dirname(path_file), recursive = TRUE)
Expand All @@ -246,7 +249,7 @@ if (fetch_data && !file.exists(path_file)) download.file(url = file.path(path_da
azimuth_pred <- read.table(path_file, sep = "\t", header = T)
# add predictions to the seurat object
ctrl$azimuth = azimuth_pred$predicted.celltype.l2
ctrl$azimuth = azimuth_pred$predicted.celltype.l2[match(colnames(ctrl), azimuth_pred$cell)]
DimPlot(ctrl, group.by = "azimuth", label = T, repel = T) + NoAxes()
```

Expand All @@ -263,11 +266,14 @@ crossTab(ctrl, "predicted.id", "scpred_prediction")
We can also plot all the different predictions side by side

``` {r}
#| fig-height: 5
#| fig-width: 16
wrap_plots(
DimPlot(ctrl, label = T, group.by = "predicted.id") + NoAxes(),
DimPlot(ctrl, label = T, group.by = "scpred_prediction") + NoAxes(),
DimPlot(ctrl, label = T, group.by = "azimuth") + NoAxes(),
ncol = 2
ncol = 3
)
```

Expand Down Expand Up @@ -376,6 +382,9 @@ instance the ncMono and cMono celltypes are equally good for some
clusters.

``` {r}
#| fig-height: 5
#| fig-width: 11
new.cluster.ids <- unlist(lapply(res, function(x) {
as.data.frame(x)[1, 1]
}))
Expand Down Expand Up @@ -403,7 +412,7 @@ wrap_plots(
DimPlot(ctrl, label = T, group.by = "predicted.id") + NoAxes() + ggtitle("LabelTransfer"),
DimPlot(ctrl, label = T, group.by = "scpred_prediction") + NoAxes() + ggtitle("scPred"),
ncol = 3
) + plot_layout(guides = "collect")
)
```

### With annotated gene sets
Expand Down
4 changes: 2 additions & 2 deletions docs/labs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ <h5 class="no-anchor card-title listing-title">
</div>
</a>
</div>
<div class="g-col-1" data-index="5" data-listing-file-modified-sort="1707250431017" data-listing-reading-time-sort="7">
<div class="g-col-1" data-index="5" data-listing-file-modified-sort="1708858768426" data-listing-reading-time-sort="7">
<a href="../labs/seurat/seurat_06_celltyping.html" class="quarto-grid-link">
<div class="quarto-grid-item card h-100 card-left">
<p class="card-img-top">
Expand Down Expand Up @@ -858,7 +858,7 @@ <h5 class="no-anchor card-title listing-title">
</div>
</div>
</footer>
<script>var lightboxQuarto = GLightbox({"selector":".lightbox","openEffect":"zoom","descPosition":"bottom","closeEffect":"zoom","loop":true});</script>
<script>var lightboxQuarto = GLightbox({"closeEffect":"zoom","loop":true,"descPosition":"bottom","openEffect":"zoom","selector":".lightbox"});</script>



Expand Down
234 changes: 117 additions & 117 deletions docs/labs/seurat/seurat_06_celltyping.html

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 73947f2

Please sign in to comment.