Skip to content

Commit

Permalink
revised intro wording
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewGhazi committed Sep 6, 2024
1 parent 8c69813 commit 663c32b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions episodes/intro-sce.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,14 @@ Before `SingleCellExperiment`, coders working with single cell data would someti

### `assays`

This is arguably the most fundamental part of the object that contains the count matrix, and potentially other matrices with transformed data. We can access the _list_ of matrices with the `assays` function and individual matrices with the `assay` function. If one of these matrices is called "counts", we can use the special `counts` getter (and the analogous `logcounts`).
This is arguably the most fundamental part of the object that contains the count matrix, and potentially other matrices with transformed data. We can access the _list_ of matrices with the `assays` function and individual matrices with the `assay` function. If one of these matrices is called "counts", we can use the special `counts` getter (likewise for `logcounts`).

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

You will notice that in this case we have a sparse matrix of class "dgTMatrix" inside the object. More generally, any "matrix-like" object can be used, e.g., dense matrices or HDF5-backed matrices (see "Working with large data").
You will notice that in this case we have a sparse matrix of class "dgTMatrix" inside the object. More generally, any "matrix-like" object can be used, e.g., dense matrices or HDF5-backed matrices (see the "Working with large data" episode).

### `colData` and `rowData`

Expand Down Expand Up @@ -183,6 +183,8 @@ Here we add a column called "conservation" that is just an integer sequence from
rowData(sce)$conservation = 1:nrow(sce)
```

This is just a made-up example with a simple sequence of numbers, but in practice its convenient to store any sort of gene-wise information in the columns of the rowData.

:::

::::
Expand All @@ -191,7 +193,7 @@ rowData(sce)$conservation = 1:nrow(sce)

Everything that we have described so far (except for the `counts` getter) is part of the `SummarizedExperiment` class that SingleCellExperiment extends. You can find a complete lesson on the `SummarizedExperiment` class in [Introduction to data analysis with R and Bioconductor](https://carpentries-incubator.github.io/bioc-intro/60-next-steps.html) course.

One of the peculiarity of SingleCellExperiment is its ability to store reduced dimension matrices within the object. These may include PCA, t-SNE, UMAP, etc.
One peculiarity of `SingleCellExperiment` is its ability to store reduced dimension matrices within the object. These may include PCA, t-SNE, UMAP, etc.

```{r}
reducedDims(sce)
Expand Down

0 comments on commit 663c32b

Please sign in to comment.