@@ -13,7 +13,7 @@ Load the metadata
1313``` r
1414get_metadata()
1515# > # Source: table<metadata> [?? x 56]
16- # > # Database: sqlite 3.40.0 [/vast/scratch/users/milton.m/cache/hca_harmonised/ metadata.sqlite ]
16+ # > # Database: postgres [[email protected] :5432/ metadata]1717# > .cell sampl…¹ .sample .samp…² assay assay…³ file_…⁴ cell_…⁵ cell_…⁶ devel…⁷ devel…⁸ disease disea…⁹ ethni…˟ ethni…˟ file_id is_pr…˟ organ…˟ organ…˟ sampl…˟ sex sex_o…˟ tissue
1818# > <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
1919# > 1 AAACCT… 8a0fe0… 5f20d7… D17PrP… 10x … EFO:00… 1e334b… basal … CL:000… 31-yea… HsapDv… normal PATO:0… Europe… HANCES… 00d626… FALSE Homo s… NCBITa… <NA> male PATO:0… perip…
@@ -43,33 +43,34 @@ get_metadata() |>
4343 count(tissue ) | >
4444 arrange(desc(n ))
4545# > # Source: SQL [?? x 2]
46- # > # Database: sqlite 3.40.0 [/vast/scratch/users/milton.m/cache/hca_harmonised/ metadata.sqlite ]
46+ # > # Database: postgres [[email protected] :5432/ metadata]4747# > # Ordered by: desc(n)
48- # > tissue n
49- # > <chr> <int >
50- # > 1 blood 47
51- # > 2 heart left ventricle 46
52- # > 3 cortex of kidney 31
53- # > 4 renal medulla 29
54- # > 5 lung 27
55- # > 6 middle temporal gyrus 24
56- # > 7 liver 24
57- # > 8 kidney 19
58- # > 9 intestine 18
59- # > 10 thymus 17
48+ # > tissue n
49+ # > <chr> <int64 >
50+ # > 1 blood 47
51+ # > 2 heart left ventricle 46
52+ # > 3 cortex of kidney 31
53+ # > 4 renal medulla 29
54+ # > 5 lung 27
55+ # > 6 liver 24
56+ # > 7 middle temporal gyrus 24
57+ # > 8 kidney 19
58+ # > 9 intestine 18
59+ # > 10 thymus 17
6060# > # … with more rows
6161```
6262
6363Query raw counts
6464
6565``` r
66+ library(stringr )
6667sce <-
6768 get_metadata() | >
6869 filter(
6970 ethnicity == " African" &
70- assay % LIKE % " %10x%" &
71- tissue == " lung parenchyma" &
72- cell_type % LIKE % " %CD4%"
71+ str_like( assay , " %10x%" ) &
72+ tissue == " lung parenchyma" &
73+ str_like( cell_type , " %CD4%" )
7374 ) | >
7475 get_SingleCellExperiment()
7576# > ℹ Realising metadata.
@@ -99,9 +100,9 @@ sce <-
99100 get_metadata() | >
100101 filter(
101102 ethnicity == " African" &
102- assay % LIKE % " %10x%" &
103- tissue == " lung parenchyma" &
104- cell_type % LIKE % " %CD4%"
103+ str_like( assay , " %10x%" ) &
104+ tissue == " lung parenchyma" &
105+ str_like( cell_type , " %CD4%" )
105106 ) | >
106107 get_SingleCellExperiment(assays = " cpm" )
107108# > ℹ Realising metadata.
@@ -129,9 +130,9 @@ Extract only a subset of genes:
129130get_metadata() | >
130131 filter(
131132 ethnicity == " African" &
132- assay % LIKE % " %10x%" &
133- tissue == " lung parenchyma" &
134- cell_type % LIKE % " %CD4%"
133+ str_like( assay , " %10x%" ) &
134+ tissue == " lung parenchyma" &
135+ str_like( cell_type , " %CD4%" )
135136 ) | >
136137 get_SingleCellExperiment(features = " PUM1" )
137138# > ℹ Realising metadata.
@@ -157,9 +158,9 @@ Extract the counts as a Seurat object:
157158get_metadata() | >
158159 filter(
159160 ethnicity == " African" &
160- assay % LIKE % " %10x%" &
161- tissue == " lung parenchyma" &
162- cell_type % LIKE % " %CD4%"
161+ str_like( assay , " %10x%" ) &
162+ tissue == " lung parenchyma" &
163+ str_like( cell_type , " %CD4%" )
163164 ) | >
164165 get_seurat()
165166# > ℹ Realising metadata.
@@ -190,30 +191,34 @@ sessionInfo()
190191# > [1] stats graphics grDevices utils datasets methods base
191192# >
192193# > other attached packages:
193- # > [1] dplyr_1.0.10 HCAquery_0.1.0
194+ # > [1] stringr_1.5.0 dplyr_1.0.10 HCAquery_0.1.0 testthat_3.1.6 RPostgres_1.4.4
194195# >
195196# > loaded via a namespace (and not attached):
196197# > [1] plyr_1.8.8 igraph_1.3.5 lazyeval_0.2.2 sp_1.5-1 splines_4.2.1 listenv_0.9.0
197- # > [7] scattermore_0.8 GenomeInfoDb_1.32.4 ggplot2_3.4.0 digest_0.6.31 htmltools_0.5.4 fansi_1.0.3
198- # > [13] magrittr_2.0.3 memoise_2.0.1 tensor_1.5 cluster_2.1.3 ROCR_1.0-11 globals_0.16.2
199- # > [19] matrixStats_0.63.0 spatstat.sparse_3.0-0 colorspace_2.0-3 blob_1.2.3 rappdirs_0.3.3 ggrepel_0.9.2
200- # > [25] xfun_0.36 RCurl_1.98-1.9 jsonlite_1.8.4 progressr_0.12.0 spatstat.data_3.0-0 survival_3.3-1
201- # > [31] zoo_1.8-11 glue_1.6.2 polyclip_1.10-4 gtable_0.3.1 zlibbioc_1.42.0 XVector_0.36.0
202- # > [37] leiden_0.4.3 DelayedArray_0.22.0 Rhdf5lib_1.18.2 future.apply_1.10.0 SingleCellExperiment_1.18.1 BiocGenerics_0.42.0
203- # > [43] HDF5Array_1.24.2 abind_1.4-5 scales_1.2.1 DBI_1.1.3 spatstat.random_3.0-1 miniUI_0.1.1.1
204- # > [49] Rcpp_1.0.9 viridisLite_0.4.1 xtable_1.8-4 reticulate_1.26 bit_4.0.5 stats4_4.2.1
205- # > [55] htmlwidgets_1.6.0 httr_1.4.4 RColorBrewer_1.1-3 ellipsis_0.3.2 Seurat_4.3.0 ica_1.0-3
206- # > [61] pkgconfig_2.0.3 uwot_0.1.14 dbplyr_2.2.1 deldir_1.0-6 utf8_1.2.2 tidyselect_1.2.0
207- # > [67] rlang_1.0.6 reshape2_1.4.4 later_1.3.0 munsell_0.5.0 tools_4.2.1 cachem_1.0.6
208- # > [73] cli_3.5.0 generics_0.1.3 RSQLite_2.2.20 ggridges_0.5.4 evaluate_0.19 stringr_1.5.0
209- # > [79] fastmap_1.1.0 yaml_2.3.6 goftest_1.2-3 knitr_1.41 bit64_4.0.5 fitdistrplus_1.1-8
210- # > [85] purrr_1.0.0 RANN_2.6.1 pbapply_1.6-0 future_1.30.0 nlme_3.1-157 mime_0.12
211- # > [91] compiler_4.2.1 rstudioapi_0.14 plotly_4.10.1 png_0.1-8 spatstat.utils_3.0-1 tibble_3.1.8
212- # > [97] stringi_1.7.8 lattice_0.20-45 Matrix_1.5-3 vctrs_0.5.1 pillar_1.8.1 lifecycle_1.0.3
213- # > [103] rhdf5filters_1.8.0 spatstat.geom_3.0-3 lmtest_0.9-40 RcppAnnoy_0.0.20 data.table_1.14.6 cowplot_1.1.1
214- # > [109] bitops_1.0-7 irlba_2.3.5.1 httpuv_1.6.7 patchwork_1.1.2 GenomicRanges_1.48.0 R6_2.5.1
215- # > [115] promises_1.2.0.1 KernSmooth_2.23-20 gridExtra_2.3 IRanges_2.30.1 parallelly_1.33.0 codetools_0.2-18
216- # > [121] MASS_7.3-57 assertthat_0.2.1 rhdf5_2.40.0 SummarizedExperiment_1.26.1 withr_2.5.0 SeuratObject_4.1.3
217- # > [127] sctransform_0.3.5 S4Vectors_0.34.0 GenomeInfoDbData_1.2.8 parallel_4.2.1 grid_4.2.1 tidyr_1.2.1
218- # > [133] rmarkdown_2.19 MatrixGenerics_1.8.1 Rtsne_0.16 spatstat.explore_3.0-5 Biobase_2.56.0 shiny_1.7.4
198+ # > [7] scattermore_0.8 usethis_2.1.6 GenomeInfoDb_1.32.4 ggplot2_3.4.0 digest_0.6.31 htmltools_0.5.4
199+ # > [13] fansi_1.0.3 magrittr_2.0.3 memoise_2.0.1 tensor_1.5 cluster_2.1.3 ROCR_1.0-11
200+ # > [19] remotes_2.4.2 globals_0.16.2 matrixStats_0.63.0 timechange_0.2.0 spatstat.sparse_3.0-0 prettyunits_1.1.1
201+ # > [25] colorspace_2.0-3 blob_1.2.3 rappdirs_0.3.3 ggrepel_0.9.2 xfun_0.36 callr_3.7.3
202+ # > [31] crayon_1.5.2 RCurl_1.98-1.9 jsonlite_1.8.4 roxygen2_7.2.3 progressr_0.12.0 spatstat.data_3.0-0
203+ # > [37] survival_3.3-1 zoo_1.8-11 glue_1.6.2 polyclip_1.10-4 gtable_0.3.1 zlibbioc_1.42.0
204+ # > [43] XVector_0.36.0 leiden_0.4.3 DelayedArray_0.22.0 pkgbuild_1.4.0 Rhdf5lib_1.18.2 future.apply_1.10.0
205+ # > [49] SingleCellExperiment_1.18.1 BiocGenerics_0.42.0 HDF5Array_1.24.2 abind_1.4-5 scales_1.2.1 DBI_1.1.3
206+ # > [55] spatstat.random_3.0-1 miniUI_0.1.1.1 Rcpp_1.0.9 viridisLite_0.4.1 xtable_1.8-4 reticulate_1.26
207+ # > [61] bit_4.0.5 stats4_4.2.1 profvis_0.3.7 htmlwidgets_1.6.0 httr_1.4.4 RColorBrewer_1.1-3
208+ # > [67] ellipsis_0.3.2 Seurat_4.3.0 ica_1.0-3 urlchecker_1.0.1 pkgconfig_2.0.3 dbplyr_2.3.0
209+ # > [73] uwot_0.1.14 deldir_1.0-6 utf8_1.2.2 tidyselect_1.2.0 rlang_1.0.6 reshape2_1.4.4
210+ # > [79] later_1.3.0 munsell_0.5.0 tools_4.2.1 cachem_1.0.6 cli_3.5.0 generics_0.1.3
211+ # > [85] RSQLite_2.2.20 devtools_2.4.5 ggridges_0.5.4 evaluate_0.19 fastmap_1.1.0 yaml_2.3.6
212+ # > [91] goftest_1.2-3 knitr_1.41 processx_3.8.0 bit64_4.0.5 fs_1.5.2 fitdistrplus_1.1-8
213+ # > [97] purrr_1.0.1 RANN_2.6.1 nlme_3.1-157 pbapply_1.6-0 future_1.30.0 mime_0.12
214+ # > [103] xml2_1.3.3 brio_1.1.3 compiler_4.2.1 rstudioapi_0.14 plotly_4.10.1 png_0.1-8
215+ # > [109] spatstat.utils_3.0-1 tibble_3.1.8 stringi_1.7.8 ps_1.7.2 desc_1.4.2 lattice_0.20-45
216+ # > [115] Matrix_1.5-3 vctrs_0.5.1 pillar_1.8.1 lifecycle_1.0.3 rhdf5filters_1.8.0 spatstat.geom_3.0-3
217+ # > [121] lmtest_0.9-40 RcppAnnoy_0.0.20 data.table_1.14.6 cowplot_1.1.1 bitops_1.0-7 irlba_2.3.5.1
218+ # > [127] httpuv_1.6.7 patchwork_1.1.2 GenomicRanges_1.48.0 R6_2.5.1 promises_1.2.0.1 KernSmooth_2.23-20
219+ # > [133] gridExtra_2.3 IRanges_2.30.1 parallelly_1.33.0 sessioninfo_1.2.2 codetools_0.2-18 MASS_7.3-57
220+ # > [139] assertthat_0.2.1 pkgload_1.3.2 rhdf5_2.40.0 SummarizedExperiment_1.26.1 rprojroot_2.0.3 withr_2.5.0
221+ # > [145] SeuratObject_4.1.3 sctransform_0.3.5 S4Vectors_0.34.0 GenomeInfoDbData_1.2.8 parallel_4.2.1 hms_1.1.2
222+ # > [151] grid_4.2.1 tidyr_1.2.1 rmarkdown_2.19 MatrixGenerics_1.8.1 Rtsne_0.16 spatstat.explore_3.0-5
223+ # > [157] lubridate_1.9.0 Biobase_2.56.0 shiny_1.7.4
219224```
0 commit comments