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. c++中ifstream一次读取整个文件

    转载:http://www.cnblogs.com/kex1n/p/4028428.html 第一种方法: 读取至std::string的情况: #include <string> #in ...

  2. 【python001-IDLE】

    一.python的下载地址:http://www.python.org 二. python的注释:# 三.>>> print("i love python")i ...

  3. uniGUI出新版本了,0.97.0.1081

    uniGUI出新版本了,0.97.0.1081,试用版0.97.0.1075,支持Delphi2006~XE7.下载地址是: http://www.unigui.com/downloads 已在XE6 ...

  4. mysql中的中文乱码解决方案, 全部是 这篇文章的内容: https://www.52jbj.com/jbdq/18755.html

    我们自己鼓捣mysql时,总免不了会遇到这个问题:插入中文字符出现乱码,虽然这是运维先给配好的环境,但是在自己机子上玩的时候咧,总得知道个一二吧,不然以后如何优雅的吹牛B. 如果你也遇到了这个问题,咱 ...

  5. 如何安装整个linux系统中所需要的mp3播放库插件? 可以在安装rpmfusion仓库后直接通过dnf install进行按照就可以了

    在vi的界面中, 前面的数字, 表示一行. 而对于中文而言, 并不一定是"一个文本行"就是一行, 而是以 回车(硬回车)为标志, 来判定一行的. 而dd, yy等也是以" ...

  6. 最大公约数gcd与最小公倍数lcm

    最大公约数:gcd 最大公倍数:lcm gcd和lcm的性质:(我觉得主要是第三点性质) 若gcd (

  7. 关于 RabbitMQ 的 Dead-Letters-Queue “死信队列”

      来自一个队列的消息可以被当做‘死信’,即被重新发布到另外一个“exchange”去,这样的情况有: 消息被拒绝 (basic.reject or basic.nack) 且带 requeue=fa ...

  8. JS获取节点的兄弟,父级,子级元素

    https://blog.csdn.net/duanshuyong/article/details/7562423 先说一下JS的获取方法,其要比JQUERY的方法麻烦很多,后面以JQUERY的方法作 ...

  9. 比赛总结——牛客网 NOIP赛前集训营提高组模拟第一场

    第一场打的很惨淡啊 t1二分+前缀最小值没想出来,20分的暴力也挂了,只有10分 t2数位dp,调了半天,结果因为忘了判0的特殊情况WA了一个点,亏死 t3emmmm.. 不会 imone说是DSU ...

  10. 【Mybatis】-- Mapper动态代理开发注意事项

    1.1. Mapper动态代理方式 1.1.1. 开发规范 Mapper接口开发方法只需要程序员编写Mapper接口(相当于Dao接口),由Mybatis框架根据接口定义创建接口的动态代理对象,代理对 ...