r - 将 TPM 数据转换为 Seurat 的读取计数
问题描述
我想用 Seurat 在 R 中进行分析,但为此我需要一个带有读取计数的计数矩阵。但是,我想使用的数据是在TPM中提供的,它不适合用作输入,因为我想与其他使用读取计数的分析进行比较。
有谁知道将 TPM 数据转换为读取计数的方法?
提前致谢!
解决方案
您需要总计数和基因(或转录本)长度来近似于该转换。有关反向操作,请参阅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。
推荐阅读
- regex - 如何用sed模仿“cut -d:-f2”?("(.*):(.*):" 匹配的字段太多)
- node.js - 如何注销 Spotify API 身份验证流程演示
- python - 如何为 pandas DataFrame 设置全新的索引,而不是基于以前的索引数据关系?
- javascript - 如何检查一个div是否与jQuery中的另一个div具有相同的文本
- .net - .Net 捕获警报事件
- java - 打印数组列表中的元素
- java - 弹出窗口中的Android GridLayout不显示数据
- javascript - 如何通过函数id参数在jQuery中选择元素?
- python - 如何使用 pandas.read_excel() 直接从 Dropbox 的 API 读取 Excel 文件?
- javascript - 如何返回分离的元素?