Skip to content

Commit

Permalink
markdown source builds
Browse files Browse the repository at this point in the history
Auto-generated via {sandpaper}
Source  : 62aa52b
Branch  : main
Author  : Andrew Ghazi <[email protected]>
Time    : 2024-10-04 17:07:47 +0000
Message : Merge pull request #53 from ccb-hms/eval_meta_ex

eval exercises
  • Loading branch information
actions-user committed Oct 4, 2024
1 parent cb39e46 commit 8b3e092
Show file tree
Hide file tree
Showing 15 changed files with 108 additions and 43 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
68 changes: 68 additions & 0 deletions hca.md
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,23 @@ metadata |>
count(tissue) |>
arrange(-n)
```

``` output
# A tibble: 33 × 2
tissue n
<chr> <int>
1 cortex of kidney 36940
2 kidney 23549
3 lung parenchyma 16719
4 renal medulla 7729
5 respiratory airway 7153
6 blood 4248
7 bone marrow 4113
8 heart left ventricle 1454
9 transition zone of prostate 1140
10 lung 1137
# ℹ 23 more rows
```
:::::::::::::::::::::::

:::::::::::::::::::::::::::::::::::::::::::::
Expand All @@ -390,6 +407,13 @@ metadata |>
arrange(-n) |>
head(n = 1)
```

``` output
# A tibble: 1 × 3
tissue cell_type n
<chr> <chr> <int>
1 cortex of kidney epithelial cell of proximal tubule 29986
```
:::::::::::::::::::::::

:::::::::::::::::::::::::::::::::::::::::::::
Expand All @@ -408,12 +432,56 @@ Use `count` to summarise.
metadata |>
count(tissue) |>
arrange(-n)
```

``` output
# A tibble: 33 × 2
tissue n
<chr> <int>
1 cortex of kidney 36940
2 kidney 23549
3 lung parenchyma 16719
4 renal medulla 7729
5 respiratory airway 7153
6 blood 4248
7 bone marrow 4113
8 heart left ventricle 1454
9 transition zone of prostate 1140
10 lung 1137
# ℹ 23 more rows
```

``` r
metadata |>
count(tissue_harmonised) |>
arrange(-n)
```

``` output
# A tibble: 19 × 2
tissue_harmonised n
<chr> <int>
1 kidney 68851
2 lung 25737
3 blood 4248
4 bone 4113
5 heart 1454
6 lymph node 1210
7 prostate 1156
8 intestine large 816
9 liver 793
10 thymus 753
11 intestine small 530
12 eye 437
13 intestine 360
14 esophagus 334
15 nose 290
16 vasculature 143
17 brain 97
18 adrenal gland 20
19 axilla 13
```

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

Expand Down
79 changes: 38 additions & 41 deletions large_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -438,21 +438,21 @@ table(exact = colLabels(sce), approx = clusters)

``` output
approx
exact 1 2 3 4 5 6 7 8 9 10 11 12 13 14
1 90 0 0 0 0 0 0 0 1 0 0 0 0 0
2 0 143 0 1 0 0 0 0 0 0 0 0 0 0
3 0 0 77 0 0 0 0 0 0 0 0 0 0 0
4 0 0 0 397 0 0 0 0 0 0 0 0 0 0
5 0 0 0 0 393 0 0 2 0 0 0 5 0 0
6 0 0 0 0 0 204 6 0 0 0 1 0 0 0
7 0 0 0 0 0 0 245 0 0 1 0 0 0 0
8 0 0 0 0 1 0 0 93 0 0 0 0 0 0
9 1 0 0 0 1 0 0 0 106 0 0 0 0 0
10 0 0 0 0 0 0 0 0 0 116 2 1 0 0
11 0 0 0 0 0 0 0 0 0 2 139 0 6 0
12 0 0 0 0 1 0 0 0 0 0 0 210 0 0
13 0 0 0 0 0 0 0 0 0 0 0 0 146 0
14 0 0 0 0 0 0 0 0 0 0 0 0 0 20
exact 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 90 0 0 0 1 0 0 0 1 0 0 0 0 0 0
2 0 143 0 0 0 0 0 0 0 0 0 0 0 0 1
3 0 0 75 0 2 0 0 0 0 0 0 0 0 0 0
4 0 0 0 341 0 0 0 0 0 0 0 0 0 0 56
5 0 0 0 0 392 0 0 1 0 1 0 0 0 0 0
6 0 0 0 0 0 79 131 0 0 0 0 0 0 0 0
7 0 0 0 0 0 245 0 0 0 1 0 0 0 0 0
8 0 0 0 0 0 0 0 95 0 0 0 0 0 0 0
9 1 0 0 0 2 0 0 0 106 0 0 0 0 0 0
10 0 0 0 0 0 0 0 0 0 105 0 0 0 0 0
11 0 0 0 0 0 0 1 0 0 5 147 0 0 0 0
12 0 0 0 0 1 0 0 0 0 23 0 199 0 0 0
13 0 0 0 0 0 0 0 0 0 0 0 0 146 0 0
14 0 0 0 0 0 0 0 0 0 0 0 0 0 20 0
```

The similarity of the two clusterings can be quantified by calculating the pairwise Rand index:
Expand Down Expand Up @@ -565,11 +565,11 @@ accurate, though RSVD is much faster for file-backed matrices.

:::: challenge

The uncertainty from approximation error is sometimes psychologically
objectionable. "Why can't my computer just give me the right answer?" One way to
alleviate this feeling is to quantify the approximation error on a small test
set like the sce we have here. Using the `ExactParam()` class, visualize the
error in PC1 coordinates compared to the RSVD results.
The uncertainty from approximation error is sometimes aggravating. "Why can't my
computer just give me the right answer?" One way to alleviate this feeling is to
quantify the approximation error on a small test set like the sce we have here.
Using the `ExactParam()` class, visualize the error in PC1 coordinates compared
to the RSVD results.

::: solution
This code block calculates the exact PCA coordinates. Another thing to note: PC vectors are only identified up to a sign flip. We can see that the RSVD PC1 vector points in the
Expand Down Expand Up @@ -964,47 +964,44 @@ function for writing to HDF5 from the *[HDF5Array](https://bioconductor.org/pack
wt_out <- tempfile(fileext = ".h5")

wt_counts <- counts(WTChimeraData())
```

``` error
Error in h(simpleError(msg, call)): error in evaluating the argument 'object' in selecting a method for function 'counts': failed to load resource
name: EH2973
title: WT chimera processed counts (sample 9)
reason: 1 resources failed to download
```

``` r
writeHDF5Array(wt_counts,
name = "wt_counts",
file = wt_out)
```

``` error
Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'is_sparse': object 'wt_counts' not found
``` output
<29453 x 30703> sparse HDF5Matrix object of type "double":
cell_1 cell_2 cell_3 ... cell_30702 cell_30703
ENSMUSG00000051951 0 0 0 . 0 0
ENSMUSG00000089699 0 0 0 . 0 0
ENSMUSG00000102343 0 0 0 . 0 0
ENSMUSG00000025900 0 0 0 . 0 0
ENSMUSG00000025902 0 0 0 . 0 0
... . . . . . .
ENSMUSG00000095041 0 1 2 . 0 0
ENSMUSG00000063897 0 0 0 . 0 0
ENSMUSG00000096730 0 0 0 . 0 0
ENSMUSG00000095742 0 0 0 . 0 0
tomato-td 1 0 1 . 0 0
```

``` r
oom_wt <- HDF5Array(wt_out, "wt_counts")
```

``` error
Error in file_path_as_absolute(path): file '/tmp/Rtmp6Q9gmL/file1e892f562866.h5' does not exist
```

``` r
object.size(wt_counts)
```

``` error
Error in eval(expr, envir, enclos): object 'wt_counts' not found
``` output
1520366960 bytes
```

``` r
object.size(oom_wt)
```

``` error
Error in eval(expr, envir, enclos): object 'oom_wt' not found
``` output
2488 bytes
```

:::::::::::::::::::::::
Expand Down
4 changes: 2 additions & 2 deletions md5sum.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"episodes/eda_qc.Rmd" "d1a9a8a578fff2b0e9566ec613da388d" "site/built/eda_qc.md" "2024-10-03"
"episodes/cell_type_annotation.Rmd" "8fab6e0cbb60d6fe6a67a0004c5ce5ab" "site/built/cell_type_annotation.md" "2024-10-02"
"episodes/multi-sample.Rmd" "6d47bd1941b7a83000873da8d836fba0" "site/built/multi-sample.md" "2024-10-04"
"episodes/large_data.Rmd" "f19fa53e9e63d4cb8fe0f6ab61c8fc3a" "site/built/large_data.md" "2024-10-02"
"episodes/hca.Rmd" "247c19cda5e903d2eb1a5dd547d95506" "site/built/hca.md" "2024-10-03"
"episodes/large_data.Rmd" "ba9660bc24664972f540bbe5fdc34d08" "site/built/large_data.md" "2024-10-04"
"episodes/hca.Rmd" "1577de2f4a851c7e99e3a8459230d6f1" "site/built/hca.md" "2024-10-04"
"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 8b3e092

Please sign in to comment.