Skip to content

Commit

Permalink
fix coding error X not found
Browse files Browse the repository at this point in the history
  • Loading branch information
shazanfar committed Nov 7, 2024
1 parent aa256ab commit 799fb69
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Package:BioCAsia2024wSIR
Package: BioCAsia2024wSIR
Title: wSIR: Weighted Sliced Inverse Regression for supervised dimension reduction of spatial transcriptomics and single cell gene expression data
Version: 2.0.1
Authors@R: c(
Expand All @@ -17,7 +17,7 @@ License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.1.0
RoxygenNote: 7.3.2
Depends:
wSIR,
magrittr,
Expand All @@ -31,4 +31,4 @@ Remotes: SydneyBioX/wSIR
URL: https://github.com/SydneyBioX/BioCAsia_2024_wSIR
BugReports: https://github.com/SydneyBioX/BioCAsia_2024_wSIR/issues/new/choose
VignetteBuilder: knitr
DockerImage: ghcr.io/sydneybiox/BioCAsia_2024_wSIR:latest
DockerImage: ghcr.io/sydneybiox/BioCAsia2024wSIR:latest
29 changes: 14 additions & 15 deletions vignettes/wSIR_workshop.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -291,15 +291,15 @@ We recommend you don't adjust `nrep` or `varThreshold`, as this can make it take
```{r}
subsetted = 0.2 # Change this to specify the proportion of the data you want to use for this exploration
rsample <- sample(c(TRUE, FALSE), size = n3, replace = TRUE, prob = c(subsetted, 1-subsetted))
# FIXME
EWP_object <- exploreWSIRParams(exprs = exprs3[rsample,],
EWP_object <- exploreWSIRParams(X = exprs3[rsample,],
coords = coords3[rsample,],
nrep = 3, # This function computes a random train/test split of the data nrep times
varThreshold = 0.95,
alpha_vals = c(0,4,10,20),
slice_vals = c(5,10,15,20))
optim_alpha = c(0,4,10,20),
optim_slices = c(5,10,15,20))
ggplot(EWP_object$results_dataframe, aes(x = alpha, y = slices, fill = value)) +
ggplot(EWP_object$results_dataframe, aes(x = factor(alpha), y = slices, fill = metric)) +
geom_tile() +
theme_classic() +
scale_fill_viridis_c() +
Expand All @@ -323,8 +323,8 @@ wsir_object <- wSIR::wSIR(X = exprs3,
coords = coords3,
optim_params = TRUE,
nrep = 3,
alpha_vals = c(0,5,10),
slice_vals = c(8,12,15),
optim_alpha = c(0,5,10),
optim_slices = c(8,12,15),
varThreshold = 0.95)
# wSIR specifying some parameter values
Expand Down Expand Up @@ -379,7 +379,7 @@ all contain information about cell types, which we can tell by the regions of
high and low wSIR column values spread across the tissue.

```{r}
vis_obj = visualiseWSIRDirections(coords = sample1_coords, WSIR = wsir_obj, dirs = 8) # create visualisations
vis_obj = visualiseWSIRDirections(coords = coords3, WSIR = wsir_obj, dirs = 8) # create visualisations
vis_obj
```

Expand Down Expand Up @@ -412,7 +412,7 @@ that the wSIR space separates cells based on their expression for those genes.

```{r}
umap_coords = generateUmapFromWSIR(WSIR = wsir_obj)
umap_plots = plotUmapFromWSIR(X = sample1_exprs,
umap_plots = plotUmapFromWSIR(X = exprs3,
umap_coords = umap_coords,
highest_genes = top_genes_obj,
n_genes = 6)
Expand Down Expand Up @@ -442,7 +442,7 @@ Here, we will show how this method can be applied to Tangram, a popular deep-lea

For this simulation, we will use embryo 3 as our spatial sample, and embryo 1 as our single-cell sample. The method workflow is detailed below. The concept will be to use the wSIR low-dimensional embedding to predict the spatial coordinates of the single-cell data.

![Tangram downstream analysis example workflow](/tangram_workflow.png)
![Tangram downstream analysis example workflow](inst/images/tangram_workflow.png)

Note that for this workshop, we will not actually compute the Tangram predicted coordinates, as it takes too long to run. We will load in the predicted coordinates which we have already computed, and we will create a results plot from that.

Expand Down Expand Up @@ -504,10 +504,9 @@ dim(proj1_from23) # gene expression data from sample 1 projected into low-dimens

We will not explore it here, but our results (manuscript on the way!) show that wSIR performance improves when you incorporate multiple spatial samples. Therefore, if you are in a situation where you do have multiple spatial samples, it is best to use wSIR and account for the multiple samples as above.

Finish






```{r}
sessionInfo()
```

0 comments on commit 799fb69

Please sign in to comment.