将TPM数据转换为Seurat的读取计数

问题描述 投票:0回答:1

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

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

谢谢!

r seurat
1个回答
0
投票

您需要总计数和基因(或转录本)长度才能近似转换。参见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将取决于用于读取摘要的基因模型。

所以您可能不走运,并且如果可能的话,使用salmonkallisto之类的东西从fastq文件中获取计数矩阵(如果有的话)可能会更好,具体取决于基于基因或转录本的模型您在要与之进行比较的数据中使用过。

[如果您除了使用TPM数据外别无选择(不建议这样做,Seurat也可以使用它-请参阅https://github.com/satijalab/seurat/issues/171

© www.soinside.com 2019 - 2024. All rights reserved.