Skip to content

Commit

Permalink
markdown source builds
Browse files Browse the repository at this point in the history
Auto-generated via {sandpaper}
Source  : cd3de4f
Branch  : main
Author  : Andrew Ghazi <[email protected]>
Time    : 2024-09-30 15:12:56 +0000
Message : Merge pull request #45 from ccb-hms/hca_refresh

hca_refresh question titles
  • Loading branch information
actions-user committed Sep 30, 2024
1 parent 801d3cf commit c0d42dd
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 13 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
31 changes: 19 additions & 12 deletions hca.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ $ sample_id_db <chr> "0c1d320a7d0cbbc281a535912722d272",
$ `_sample_name` <chr> "BPH340PrSF_Via___transition zone of…
```

## A note on the piping operator
## A note on the pipe operator

The vignette materials provided by `CuratedAtlasQueryR` show the use of the
'native' R pipe (implemented after R version `4.1.0`). For those not familiar
Expand Down Expand Up @@ -253,9 +253,9 @@ For the sake of demonstration, we'll focus this small subset of samples:
sample_subset = metadata |>
filter(
ethnicity == "African" &
stringr::str_like(assay, "%10x%") &
grepl("10x", assay) &
tissue == "lung parenchyma" &
stringr::str_like(cell_type, "%CD4%")
grepl("CD4", cell_type)
)
```

Expand Down Expand Up @@ -367,7 +367,7 @@ single_cell_counts |> saveHDF5SummarizedExperiment("single_cell_counts")

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

#### Exercise 1
#### Exercise 1: Basic counting + piping

Use `count` and `arrange` to get the number of cells per tissue in descending
order.
Expand All @@ -386,27 +386,28 @@ metadata |>

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

#### Exercise 2
#### Exercise 2: Tissue & type counting

Use `dplyr`-isms to group by `tissue` and `cell_type` and get a tally of the
highest number of cell types per tissue combination. What tissue has the most
numerous type of cells?
`count()` can group by multiple factors by simply adding another grouping column
as an additional argument. Get a tally of the highest number of cell types per
tissue combination. What tissue has the most numerous type of cells?

:::::::::::::: solution


``` r
metadata |>
count(tissue, cell_type) |>
arrange(-n)
arrange(-n) |>
head(n = 1)
```
:::::::::::::::::::::::

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

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

#### Exercise 3
#### Exercise 3: Comparing metadata categories

Spot some differences between the `tissue` and `tissue_harmonised` columns.
Use `count` to summarise.
Expand All @@ -423,6 +424,10 @@ metadata |>
count(tissue_harmonised) |>
arrange(-n)
```

For example you can see that `tissue_harmonised` merges the `cortex of kidney`
and `kidney` groups in `tissue`.

To see the full list of curated columns in the metadata, see the Details section
in the `?get_metadata` documentation page.

Expand All @@ -432,7 +437,7 @@ in the `?get_metadata` documentation page.

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

#### Exercise 4
#### Exercise 4: Highly specific cell groups

Now that we are a little familiar with navigating the metadata, let's obtain
a `SingleCellExperiment` of 10X scRNA-seq counts of `cd8 tem` `lung` cells for
Expand All @@ -447,7 +452,7 @@ metadata |>
filter(
sex == "female" &
age_days > 80 * 365 &
stringr::str_like(assay, "%10x%") &
grepl("10x", assay) &
disease == "COVID-19" &
tissue_harmonised == "lung" &
cell_type_harmonised == "cd8 tem"
Expand All @@ -469,6 +474,8 @@ reducedDimNames(0):
mainExpName: NULL
altExpNames(0):
```

You can see we don't get very many cells given the strict set of conditions we used.
:::::::::::::::::::::::

:::::::::::::::::::::::::::::::::::::::::::::
Expand Down
2 changes: 1 addition & 1 deletion md5sum.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"episodes/cell_type_annotation.Rmd" "dc23fda097f772bec1b7172277298221" "site/built/cell_type_annotation.md" "2024-09-30"
"episodes/multi-sample.Rmd" "2d38d9903358ea8a8067abd82a1f1f54" "site/built/multi-sample.md" "2024-09-24"
"episodes/large_data.Rmd" "b9710492c6792ea435778c4e42f27e02" "site/built/large_data.md" "2024-09-24"
"episodes/hca.Rmd" "e01d3fd1e07f158bed08b72d657ae1d1" "site/built/hca.md" "2024-09-24"
"episodes/hca.Rmd" "20f753a47fcae8ed5d0631fbc582f549" "site/built/hca.md" "2024-09-30"
"instructors/instructor-notes.md" "205339793f625a1844a768dea8e4a9c8" "site/built/instructor-notes.md" "2024-09-24"
"learners/reference.md" "40fc1d0be2412d2d9d434a5bc84e4de8" "site/built/reference.md" "2024-09-24"
"learners/setup.md" "25772142a26fe3c0cebbe650f5683269" "site/built/setup.md" "2024-09-24"
Expand Down

0 comments on commit c0d42dd

Please sign in to comment.