The normalization method described above aims to reduce the effect of technical factors in scRNA-seq data (primarily, depth) from downstream analyses. However, heterogeneity in cell cycle stage, particularly among mitotic cells transitioning between S and G2/M phases, also can drive substantial transcriptomic variation that can mask biological signal. To mitigate this effect, we use a two-step approach:

1) quantify cell cycle stage for each cell using supervised analyses with known stage-specific markers,

2) regress the effect of cell cycle stage using the same negative binomial regression as outlined above.

For the first step we use a previously published list of cell cycle dependent genes (43S phase genes, 54 G2/M phase genes) for an enrichment analysis similar to that proposed in ref. 11.

For each cell, we compare the sum of phase-specific gene expression (log10 transformed UMIs) to the distribution of 100 random background genes sets, where the number of background genes is identical to the phase gene set, and the background genes are drawn from the same expression bins. Expression bins are defined by 50 non-overlapping windows of the same range based on log10(mean UMI). The phase-specific enrichment score is the expression z-score relative to the mean and standard deviation of the background gene sets. Our final ‘cell cycle score’ (Extended Data Fig. 1) is the difference between S-phase score and G2/M-phase score.

For a final normalized dataset with cell cycle effect removed, we perform negative binomial regression with technical factors and cell cycle score as predictors. Although the cell cycle activity was regressed out of the data for downstream analysis, we stored the computed cell cycle score before regression, enabling us to remember the mitotic phase of each individual cell. Notably, our regression strategy is tailored to mitigate the effect of transcriptional heterogeneity within mitotic cells in different phases, and should not affect global differences between mitotic and non-mitotic cells that may be biologically relevant.

get.cc.score <- function(cm, N=100, seed=42) {
set.seed(seed)
cat('get.cc.score, ')
cat('number of random background gene sets set to', N, '\n') min.cells <- 5 cells.mols <- apply(cm, 2, sum)
gene.cells <- apply(cm>0, 1, sum)
cm <- cm[gene.cells >= min.cells, ] gene.mean <- apply(cm, 1, mean) breaks <- unique(quantile(log10(gene.mean), probs = seq(0,1, length.out = 50)))
gene.bin <- cut(log10(gene.mean), breaks = breaks, labels = FALSE)
names(gene.bin) <- rownames(cm)
gene.bin[is.na(gene.bin)] <- 0 regev.s.genes <- read.table(file='./annotation/s_genes.txt', header=FALSE, stringsAsFactors=FALSE)$V1
regev.g2m.genes <- read.table(file='./annotation/g2m_genes.txt', header=FALSE, stringsAsFactors=FALSE)$V1 goi.lst <- list('S'=rownames(cm)[!is.na(match(toupper(rownames(cm)), regev.s.genes))],
'G2M'=rownames(cm)[!is.na(match(toupper(rownames(cm)), regev.g2m.genes))]) n <- min(40, min(sapply(goi.lst, length)))
goi.lst <- lapply(goi.lst, function(x) x[order(gene.mean[x], decreasing = TRUE)[1:n]]) bg.lst <- list('S'=get.bg.lists(goi.lst[['S']], N, gene.bin),
'G2M'=get.bg.lists(goi.lst[['G2M']], N, gene.bin)) all.genes <- sort(unique(c(unlist(goi.lst, use.names=FALSE), unlist(bg.lst, use.names=FALSE)))) expr <- log10(cm[all.genes, ]+1) s.score <- enr.score(expr, goi.lst[['S']], bg.lst[['S']])
g2m.score <- enr.score(expr, goi.lst[['G2M']], bg.lst[['G2M']]) phase <- as.numeric(g2m.score > 2 & s.score <= 2)
phase[g2m.score <= 2 & s.score > 2] <- -1 return(data.frame(score=s.score-g2m.score, s.score, g2m.score, phase))
}

  

单细胞数据高级分析之消除细胞周期因素 | Removal of cell cycle effect的更多相关文章

  1. 单细胞数据高级分析之初步降维和聚类 | Dimensionality reduction | Clustering

    个人的一些碎碎念: 聚类,直觉就能想到kmeans聚类,另外还有一个hierarchical clustering,但是单细胞里面都用得不多,为什么?印象中只有一个scoring model是用kme ...

  2. 单细胞数据高级分析之构建成熟路径 | Identifying a maturation trajectory

    其实就是另一种形式的打分. 个人点评这种方法: 这篇文章发表在nature上,有点奇怪,个人感觉创新性和重要性还不够格,工具很多,但是本文基本都是自己开发的算法(毕竟satji就是搞统计出身的). 但 ...

  3. 第二篇:智能电网(Smart Grid)中的数据工程与大数据案例分析

    前言 上篇文章中讲到,在智能电网的控制与管理侧中,数据的分析和挖掘.可视化等工作属于核心环节.除此之外,二次侧中需要对数据进行采集,数据共享平台的搭建显然也涉及到数据的管理.那么在智能电网领域中,数据 ...

  4. Lakehouse: 统一数据仓库和高级分析的新一代开放平台

    1. 摘要 数仓架构在未来一段时间内会逐渐消亡,会被一种新的Lakehouse架构取代,该架构主要有如下特性 基于开放的数据格式,如Parquet: 机器学习和数据科学将被作为头等公民支持: 提供卓越 ...

  5. 《Wireshark数据包分析实战》 - http背后,tcp/ip抓包分析

    作为网络开发人员,使用fiddler无疑是最好的选择,方便易用功能强. 但是什么作为爱学习的同学,是不应该止步于http协议的,学习wireshark则可以满足这方面的需求.wireshark作为抓取 ...

  6. 单细胞数据初步处理 | drop-seq | QC | 质控 | 正则化 normalization

    比对 The raw Drop-seq data was processed with the standard pipeline (Drop-seq tools version 1.12 from ...

  7. 【Social listening实操】作为一个合格的“增长黑客”,你还得重视外部数据的分析!

    本文转自知乎 作者:苏格兰折耳喵 ----------------------------------------------------- 在本文中,作者引出了"外部数据"这一概 ...

  8. Wireshark数据包分析(一)——使用入门

    Wireshark简介: Wireshark是一款最流行和强大的开源数据包抓包与分析工具,没有之一.在SecTools安全社区里颇受欢迎,曾一度超越Metasploit.Nessus.Aircrack ...

  9. 关于RECOVERY清除数据的分析

    [前言] 讨论:双清和清空所有数据的问题 说明:以前写的帖子都写三清,那个是为了保险起见才叫大家三项清除,毕竟人都有刚开始的时候,但看了郭贤普的帖子<系统与数据兼容性测试>之后,我觉得有必 ...

随机推荐

  1. mac 10.8 编译提示找不到GCC

    本机已安装xcode,但是在编译prce时提示找不到GCC,要不安装gcc.pkg ,简单起见,启动xcode->menu->preferences->Dowloads 把里面的co ...

  2. HashMap 读后感

    HashMap是一个哈希表,内部通过链地址法解决哈希冲突.内部用Entry数组保存数据,每个Entry是一个单向链表. HashMap不保证插入的顺序,线程不同步,允许null 下面是几个重要点: 保 ...

  3. Ubuntu 使用top/free查看内存占用大的原因

    Ubuntu 使用top/free查看内存占用大的原因     linux/ubuntu下free/top查看内存占用大的原因 使用free/top查看内存占用的时候,吓了一大跳,机器4GB的内存,显 ...

  4. 利用merge优化

    create table a1(TP_END_DATE NUMBER,WK_END_DATE NUMBER, MTH_START_DATE NUMBER, MTH_END_DATE NUMBER, T ...

  5. VS快捷方式小技巧

    VS2005代码编辑器的展开和折叠代码确实很方便和实用.以下是展开代码和折叠代码所用到的快捷键,很常用: Ctrl + M + O: 折叠所有方法 Ctrl + M + M: 折叠或者展开当前方法 C ...

  6. C++ cin.get及getline的用法

    1.cin.get() 从指定的输入流中提取一个字符,函数的返回值就是这个字符.文件结束符会返回EOF,一般以-1代表EOF. #include<iostream> using names ...

  7. vmware安装centOs操作系统配置网络的一系列问题

    1:最近公司在测试项目,需要在linux操作系统上面测试,可惜自己之前学linux操作系统不是很深,配置网络也不是很熟练,网上方法太多,但是不是很好用,确实难为了自己一把,在这里自己总结一下配置网络的 ...

  8. 学习笔记9—python数据表的合并(join(), merge()和concat())

    merage# pandas提供了一个类似于关系数据库的连接(join)操作的方法<Strong>merage</Strong>,可以根据一个或多个键将不同DataFrame中 ...

  9. spi and sensor

    http://blog.csdn.net/DroidPhone/article/details/23367051 https://www.kernel.org/doc/html/v4.14/drive ...

  10. 洛谷 P4592: bzoj 5338: [TJOI2018]异或

    题目传送门:洛谷P4592. 题意简述: 题面说的很清楚了. 题解: 发现没有修改很快乐.再看异或最大值操作,很容易想到可持久化 01trie. 这里要把 01trie 搬到树上,有点难受. 树剖太捞 ...