Skip to content

Commit

Permalink
Merge pull request #28 from ccb-hms/add_exercises
Browse files Browse the repository at this point in the history
solns to end exercises
  • Loading branch information
andrewGhazi authored Sep 9, 2024
2 parents ce47918 + 1d939c4 commit 286327c
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion episodes/intro-sce.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,37 @@ The `SingleCellExperiment` constructor function can be used to create a new `Sin

:::::::::::::::::::::::


::: solution

```{r}
mat = matrix(runif(30), ncol = 5)
my_sce = SingleCellExperiment(assays = list(logcounts = mat))
my_sce$my_col_info = runif(5)
my_sce
```

:::

:::::::::::::::::::::::::::::::::::::::::::::

:::::::::::::::::::::::::::::::::: challenge

#### Exercise 2

Combining two objects: The `MouseGastrulationData` package contains several datasets. Download sample 6 of the chimera experiment by running `sce6 <- WTChimeraData(sample=6)`. Use the `cbind` function to combine the new data with the `sce` object created before.
Combining two objects: The `MouseGastrulationData` package contains several datasets. Download sample 6 of the chimera experiment by running `sce6 <- WTChimeraData(samples=6)`. Use the `cbind` function to combine the new data with the `sce` object created before.

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


:::::::::::::::::::::::::::::::::::::::::::::

Expand Down

0 comments on commit 286327c

Please sign in to comment.