首页 > 解决方案 > 将 TPM 数据转换为 Seurat 的读取计数

问题描述

我想用 Seurat 在 R 中进行分析,但为此我需要一个带有读取计数的计数矩阵。但是,我想使用的数据是在TPM中提供的,它不适合用作输入,因为我想与其他使用读取计数的分析进行比较。

有谁知道将 TPM 数据转换为读取计数的方法?

提前致谢!

标签: rseurat

解决方案


您需要总计数和基因(或转录本)长度来近似于该转换。有关反向操作,请参阅https://support.bioconductor.org/p/91218/

从那个链接:

You can create a TPM matrix by dividing each column of the counts matrix by some estimate of the gene length (again this is not ideal for the reasons stated above).

x <- counts.mat / gene.length

Then with this matrix x, you do the following:

tpm.mat <- t( t(x) * 1e6 / colSums(x) )

Such that the columns sum to 1 million.

colSums(x)将是与 TPM 矩阵中的基因对齐的每个样本的计数,并且gene.length取决于用于读取摘要的基因模型。

因此,您可能不走运,并且可能最好还是使用诸如三文鱼kallisto 之类的东西来从 fastq 文件中获取计数矩阵,如果这些文件可用,则基于您在数据中使用的基因或转录模型想比较一下。

如果您别无选择,只能使用 TPM 数据(不是很推荐),Seurat 也可以使用它 - 请参阅https://github.com/satijalab/seurat/issues/171


推荐阅读