对R包的介绍:这篇博文是由生物导体社区经理Maria Doyle和CuratedAtlasQueryR的首席开发人员Stefano Mangiola共同撰写的。
我们很高兴宣布推出CuratedAtlasQueryR包!数百万细胞现在就在您的指尖,因为可以在Bioconductor SingleCellExperiment数据结构中探索和检索协调和重新标记的CELLxGENE单细胞人类图谱。
![](https://img.haomeiwen.com/i28631256/44263ae66327ded2.png)
这个包创建的目的
人类细胞图谱是一项大规模的单细胞测序计划,旨在绘制人体内的每种细胞类型。它有可能彻底改变我们对人类细胞生物学和免疫系统的理解。数据协调、管理和有效的数据查询对于从这些复杂的图谱中提取知识至关重要。CELLxGENE人类细胞图谱提供了一个可探索和可搜索的人类图谱。然而,CELLxGENE在数据集之间并不协调。
为了通过R对数据集、组织和疾病进行探索和分析,我们开发了CuratedAtlasQueryR,这是一种细胞解析查询系统,允许研究人员根据细胞类型、来源组织和人口统计信息选择细胞。该包将提交给Bioconductor。我们还创建了即将推出的CuratedAtlasQueryR的Python版本。
这个包和别的包的区别
我们使用现有的Bioconductor包cellxgenedp作为CELLxGENE中包含的数据集的下载源。
然后,我们对数据(免疫细胞标签)进行协调、整理和重新标注。
列类,以便它们可以表示为唯一的表。
我们对整个图谱中最常见的列进行了子集(可以通过cellxgenedp包检索特定数据集的完整列)。
我们合并了样本标识符。
我们统一了组织标签。
我们在一个共同的本体下统一了细胞类型标签。
我们提供了基于共识的免疫细胞标签和置信标签。在原始注释和三个独立参考文献(摩纳哥、BLUEPRINT和方位角PBMC)之间建立了共识。
我们引入了原始CELLxGENE元数据中不存在的自定义列。
tissue_harmonized:用于更好过滤的更粗糙的组织名称
age_days:与年龄对应的天数
cell_type_hharmonized:使用Seurat Azimuth和SingleR的原始注释和三个新注释的共识调用身份(针对免疫细胞)
confidenceclass:表示单元类型和谐程度的序数类。1表示完全一致,2表示四分之三,依此类推。
cell_annotation_azimuth_l2:方位角单元格注释
cell_annotation_blueprint_singler:使用blueprint引用的singler单元格注释
cell_annotation_blueprint_monaco:使用monaco引用的SingleR单元格注释
sample_id_db:内部使用的样本细分
file_id_db:内部使用的文件细分
.sample:样本ID
.sample_name:如何定义样本
与cellxgenedp不同的是,我们可以基于注释跨数据集查询特定的单元格,元数据探索和数据下载在磁盘上完成,无需加载到内存中。
可以以Bioconductor SingleCellExperiment格式探索和检索协调和重新标记的CELLxGENE单细胞人类图谱。
我们在包中使用DuckDB,因为它的速度快,并且在处理大量数据时磁盘占用低。
如何使用这个包
通过使用tidyverse探索2800万个单元(磁盘上)的集成元数据,开始使用CuratedAtlasQueryR。该图谱包括40个组织的344项研究,提供原始丰度和百万分之数
第一步
library(CuratedAtlasQueryR)
cache_dir = "~/tmp" 如果不想使用默认值,请指定缓存目录
metadata <- get_metadata(cache_directory = cache_dir)#获取metadata
metadata
第二步
使用tidyverse过滤感兴趣的细胞,无论是特定的数据集还是跨组织和疾病的细胞类型。CuratedAtlasQueryR可以很容易地找到你要找的东西
metadata |> dplyr::filter( ethnicity == "African" & stringr::str_like(assay, "%10x%") & tissue == "lung parenchyma" & stringr::str_like(cell_type, "%CD4%") )
第三步
收集感兴趣的单元格的singlecel实验。我们的对象使用HDF5 format来保持R会话的轻便,使其更容易处理更大的数据集。
metadata |> dplyr::filter( ethnicity == "African" & stringr::str_like(assay, "%10x%") & tissue == "lung parenchyma" & stringr::str_like(cell_type, "%CD4%") ) |> get_SingleCellExperiment(cache_directory = cache_dir)
第四步
使用CuratedAtlasQueryR和tidySingleCellExperiment,只需几行代码就可以在疾病、组织和数百个数据集中检查您最喜爱的基因和细胞类型的转录丰度!
library(tidySingleCellExperiment) library(ggplot2)
metadata |>
*# Filter and subset filter(cell_type_harmonised=="cd14 mono") |>
# Get counts per million for NCAM1 gene get_SingleCellExperiment(assays = "cpm", features = "HLA-A", cache_directory = cache_dir) |>
# Plot (styling code is omitted) join_features("HLA-A", shape = "wide") |> ggplot(aes( disease, HLA.A
,color = file_id)) + geom_jitter(shape=".")
![](https://img.haomeiwen.com/i28631256/814974f38248ccce.png)
metadata |> # Filter and subset filter(cell_type_harmonised=="nk") |>
# Get counts per million for NCAM1 gene get_SingleCellExperiment(assays = "cpm", features = "NCAM1", cache_directory = cache_dir) |>
<pre spellcheck="false" class="md-fences md-end-block ty-contain-cm modeLoaded" lang="" contenteditable="true" cid="n129" mdtype="fences" style="box-sizing: border-box; overflow: visible; font-family: var(--monospace); font-size: 0.9em; display: block; break-inside: avoid; text-align: left; white-space: normal; background-image: inherit; background-position: inherit; background-size: inherit; background-repeat: inherit; background-attachment: inherit; background-origin: inherit; background-clip: inherit; background-color: rgb(248, 248, 248); position: relative !important; border: 1px solid rgb(231, 234, 237); border-radius: 3px; padding: 8px 1em 6px; margin-bottom: 15px; margin-top: 15px; width: inherit; color: rgb(51, 51, 51); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"># Plot (styling code is omitted)</pre>
join_features("NCAM1", shape = "wide") |> ggplot(aes( tissue_harmonised, NCAM1,color = file_id)) + geom_jitter(shape=".")
![](https://img.haomeiwen.com/i28631256/64c106d8dec3b8ab.png)
网友评论