Skip to content

Commit

Permalink
add SingleCellExperiment example
Browse files Browse the repository at this point in the history
  • Loading branch information
MelodyJIN-Y committed Nov 9, 2024
1 parent b73b7a3 commit 861773a
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion vignettes/jazzPanda.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ seu_clusters <- as.data.frame(example_seu$seurat_clusters,nm="cluster")
seu_clusters$cell_id <- colnames(example_seu)
# -----------------------------------------------------------------------------
# combine cluster labels and the coordiantes
# combine cluster labels and the coordinates
# make sure the cluster information contains column names:
# cluster, x, y, sample and cell_id
clusters_info <- as.data.frame(spe_example@int_colData$spatialCoords)
Expand Down Expand Up @@ -282,6 +282,25 @@ example_vectors_tr <- get_vectors(trans_lst= example_sfe_lst$trans_lst,
```

### From a SingleCellExperiment object
```{r, eval=FALSE}
sce_example <- SingleCellExperiment(list(sample01 = cm))
example_sce_lst <- convert_data(x=sce_example,sample_names = "sample01")
# -----------------------------------------------------------------------------
# build spatial vectors from count matrix and cluster coordinates
# make sure the cluster information contains column names:
# cluster, x, y, sample and cell_id
example_vectors_cm <- get_vectors(trans_lst= NULL,
cm_lst=example_sce_lst$cm_lst,
cluster_info = clusters_info,
bin_type="square",
bin_param=c(10,10),
all_genes = all_genes,
w_x=w_x, w_y=w_y)
```

### From a Seurat object
```{r eval=FALSE}
# cm is the count matrix
Expand Down

0 comments on commit 861773a

Please sign in to comment.