热点新闻
单细胞转录组代谢分析-Compass1
2023-09-02 22:59  浏览:7203  搜索引擎搜索“微商筹货网”
温馨提示:信息一旦丢失不一定找得到,请务必收藏信息以备急用!本站所有信息均是注册会员发布如遇到侵权请联系文章中的联系方式或客服删除!
联系我时,请说明是在微商筹货网看到的信息,谢谢。
展会发布 展会网站大全 报名观展合作 软文发布

目前常用的有三种方法:

  • Compass
  • scFEA
  • scmetabolism: 相当于把KEGG和Reactome里面的代谢相关基因集找出来做类似于AUCell或者GSVA,比较简单,仅能用于人类数据,小鼠数据需要做同源转化

参考

Compass

  • 发表于2021年Cell,可信度最高

简单运行Compass可以只设置3个参数,包含表达矩阵(--data)、进程个数(--num-processes)、物种(--species,当前支持的物种有人和小鼠。设置物种后,计算中会自动使用与对应物种适配的基因名),其余参数可以先使用默认值,后续可以根据研究需要进行修改。需要注意的是,Compass计算时间相对较长,每个细胞大约需要30分钟,而另一个用于单细胞代谢预测的工具——scFEA[2]计算速度相对快得多,例如使用8个线程预测100个细胞的测试数据大约只需要1分钟。因此针对较大的数据集,Compass可以通过微池(--microcluster-size)将细胞划分为簇,再以簇的平均值表征该簇,这里也可以使用其他类似方法,例如metaCell。此外,根据实际研究问题,需要考虑是否将不同表型的细胞分别进行微池。

  • Github
  1. install

python3.9 -m pip install git+https://github.com/yoseflab/Compass.git --upgrade

在下载时出现了如下问题:

error: RPC failed; result=35, HTTP code = 0

解决方法:git config --global http.postBuffer 5242880000

成功下载之后会发现错误ModuleNotFoundError: No module named 'cplex'需要安装cplex

官网教程上cplex的安装较为复杂
第一次我直接pip3.9 install cplex,看起来安装成功了,但后续出错CplexSolverError: CPLEX Error 1016: Community Edition. Problem size limits exceeded. Purchase at http://ibm.biz/error1016. 看来pip直接下载的是社区版本,而Compass需要academic版本

Compass requires the full edition of CPLEX, which is free for academic use.

看了一下,不知道等IBM通过academic认证要多久,在某宝买了一个
因为我的Python为3.9,而cplex只有3.8对应的20.1版本,所以需要创建虚拟环境(需要再有java的基础上进行安装)

  1. Tutorial
    Broadly speaking, Compass takes in a gene expression matrix scaled for library depth (e.g., CPM), and outputs a penalty reaction matrix, whereby higher scores correspond to a reaction being less likely.

输入文件为Scale之后的表达矩阵
The input gene expression matrix can be either a tab-delimited text file (tsv) or a matrix market format (mtx) containing gene expression estimates (CPM, TPM, or similar scaled units) with one row per gene, one column per sample.
Tab-delimited files need row and column labels corresponding to genes and sample names. Market matrix formats need a separate tab delimited file of of gene names and optionally a tab delimited file of cell names.

由于像之前说的,Compass非常耗时,所以可以进行Micropooling或者metacell
GitHub - tanaylab/metacells: metacells - Single-cell RNA Sequencing Analysis,基于python版本

the metacell approach groups together profiles of the "same" biological state into groups of cells of the "same" biological state, with the minimal number of profiles needed for computing robust statistics (in particular, mean gene expression). Each such group is a single "metacell".
By summing profiles of cells of the "same" state together, each metacell greatly reduces the sampling variance, and provides a more robust estimation of the transcription state. Note a metacell is not a cell type (multiple metacells may belong to the same "type", or even have the "same" state, if the data sufficiently over-samples this state). Also, a metacell is not a parametric model of the cell state. It is merely a more robust description of some cell state.

metacells Vignette — metacells 0.8.0 documentation

看了一下metacell的教程,感觉更适合在大规模数据分析前使用

Compass示范教程
Compass Micropooled Analysis — Compass 2021 documentation (yoseflab.github.io)
Compass/Demo.ipynb at docs · YosefLab/Compass · GitHub

Depending on the research question, it could make sense to micropool discrete phenotypes separately. This will result in micrpools made of only WT or KO cells, for example, but may conceal some of the overlapping cellular programs between the two.

Debug大全

  • Micropooling时出错TypeError("cannot pickle 'SwigPyObject' object"),把num_process变少一点,解决,为多进程问题

  • Micropooling时出错

File "/home/user/test/miniconda3/envs/compass/lib/python3.8/site-packages/compass/compass/microclustering.py", line 181, in pool_matrix_cols return data.append(groups).T.groupby("compass_microcluster").mean().T.rename(mapper=lambda x: 'cluster_'+str(int(x)), axis=1) File "/home/user/test/miniconda3/envs/compass/lib/python3.8/site-packages/pandas/core/generic.py", line 5989, in __getattr__ return object.__getattribute__(self, name) AttributeError: 'Dataframe' object has no attribute 'append'

找到对应的文件
return data.append(groups).T.groupby("compass_microcluster").mean().T.rename(mapper=lambda x: 'cluster_'+str(int(x)), axis=1)改为return data._append(groups).T.groupby("compass_microcluster").mean().T.rename(mapper=lambda x: 'cluster_'+str(int(x)), axis=1)

  • 注意,sklearn的FutureWarning不是Error,不用管
发布人:843f****    IP:117.173.23.***     举报/删稿
展会推荐
  • 清欢
  • 2023-09-01浏览:5901
让朕来说2句
评论
收藏
点赞
转发