Skip to content

Commit

Permalink
spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewGhazi committed Sep 13, 2024
1 parent 828d67f commit 58d312d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions episodes/intro-sce.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ knitr::include_graphics("http://bioconductor.org/books/release/OSCA.intro/images
Let's look at an example dataset. `WTChimeraData` comes from a study on mouse development. We can assign one sample to a `SingleCellExperiment` object named `sce` like so:

```{r, message = FALSE, warning=FALSE}
sce <- WTChimeraData(samples=5)
sce <- WTChimeraData(samples = 5)
sce
```

Expand Down Expand Up @@ -148,6 +149,7 @@ This is arguably the most fundamental part of the object that contains the count

```{r}
names(assays(sce))
counts(sce)[1:3, 1:3]
```

Expand All @@ -161,13 +163,15 @@ One can interact with them as usual, e.g., by extracting columns or adding addit

```{r}
colData(sce)[1:3, 1:4]
rowData(sce)[1:3, 1:2]
```

You can access columns of the colData with the `$` accessor to quickly add cell-wise metadata to the colData

```{r}
sce$my_sum <- colSums(counts(sce))
colData(sce)[1:3,]
```

Expand Down Expand Up @@ -207,6 +211,7 @@ Here, we use `scater`'s `plotReducedDim` function as an example of how to extrac

```{r, message = FALSE, warning = FALSE}
library(scater)
plotReducedDim(sce, "pca.corrected.E8.5", colour_by = "celltype.mapped")
```

Expand Down Expand Up @@ -247,10 +252,12 @@ Combining two objects: The `MouseGastrulationData` package contains several data

::: solution
```{r message = FALSE, warning=FALSE}
sce <- WTChimeraData(samples = 5)
sce <- WTChimeraData(samples = 5)
sce6 <- WTChimeraData(samples = 6)
combined_sce = cbind(sce, sce6)
combined_sce
```
:::
Expand Down

0 comments on commit 58d312d

Please sign in to comment.