创建或修改目录:/www/wwwroot/104.219.215.234/data 失败!
白虎 Cellphonedb_v5单细胞互作分析(视频教程) - 国内试镜

白虎 Cellphonedb_v5单细胞互作分析(视频教程)

发布日期:2024-08-24 09:07    点击次数:70

白虎 Cellphonedb_v5单细胞互作分析(视频教程)

1、《KS科研共享与职业》公众号有QQ换取群白虎,可是参加门槛是20元,请洽商澄莹。群里有推文的宝贵代码和示例数据,付费实质半价,还不错与环球换取。

2、需进群玩忽打包代码的小伙伴请添加作家微信了解,请备注想法,除此以外请勿添加,谢谢!

3、付费著作邻接有打包价哦(公众号悉数付费实质)!购买打包代码的小伙伴可加入微信VIP群,福利更多,微信群帖子提前发布,可获取更多实质!

点击:→ 加入微信vip群:《KS科研共享与职业》付费实质打包邻接

笃定请联系作家:

Cellphonedb是常用的细胞通信分析器具:咱们之前先容过《CellPhoneDB单细胞互作分析(2):数据分析|东谈主鼠基因同源飘零|ERROR惩办|详备宝贵版代码》。这如故一年前的实质,那时候是cellphonedb v3,那时我记起困扰环球的问题齐是一些环境竖立,软件装配之类的。可是近半年仍是莫得东谈主再问雷同的问题了,我思应该大多半东谈主应该在这方面仍是很娴熟了,不会再有问题了!

可是如故有小伙伴问谈一些问题,“我网上的表率收效装配了cellphonedb,可是怎样结尾找不到command得嘞”?最初你莫得错,你软件也装配收效了,其次,cellphonedbv4之后,代码开动不再像v3相通结尾的形势,而是仅复旧python的开动形势。技艺过得亦然很快,上个月小伙伴说cellphonedb齐到V5了,最近沸沸扬扬的多样更新,原来咱们就有更新cellphonedb教程的有趣了,那么此次刚好,就跳过cellphonedb4,径直看V5。不外在使用操作上远离倒是不大。

最初咱们望望cellphonedb V5有哪些新的实质。以下实质贴自cellphonedb官网,可自行检察。此外,官网也提供了详备的示例教程。

Novel features in v5白虎

https://github.com/ventolab/CellphoneDB

调教学生妹

New python package that can be easily executed in Jupyter Notebook and Collabs.

A scoring methodology to rank interaction based on the expression specificity of the interacting partners.

A CellSign module to leverage interactions based on the activity of the transcription factor downstream the receptor. This module is accompanied by a collection of 211 well described receptor-transcription factor direct relationships.

A new method of querying of CellphoneDB results search_utils.search_analysis_results.

Improved computational efficiency of method 2 cpdb_statistical_analysis_method.

A new database (cellphonedb-data v5.0) with more manually curated interactions, making up to a total of ~3,000 interactions. This release of CellphoneDB database has three main changes:

Integrates new manually reviewed interactions with evidenced roles in cell-cell communication.

Includes non-protein molecules acting as ligands.

For interactions with a demonstrated signalling directionality, partners have been ordered according (ligand is partner A, receptor partner B).

Interactions have been classified within signaling pathways.

CellphoneDB no longer imports interactions from external resources. This is to avoid the inclusion of low-confidence interactions.

圆善版实质已发布至微信VIP群,请自行查收!视频教程后续发布!咱们这里的演示是在jupyter中进行的,要是你用的是职业器,如何使用jupyter不错检察官网手册(有Rstudio、有jupyter、具有root权限的职业器,你值得领有 (注册领取200优惠券)!)。最初装配cellphonedb V5。
#装配cellphonedb v5pip install cellphonedb -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
接下来即是整理cellphonedbV5分析需要的文献了,雷同于之前的V3。咱们的教程里演示了从seurat玩忽h5ad赢得input文献。主要有三个必须文献,matrix、metadata以及cellphonedb v5 database。cellphonedb v5 database不错自界说,按照官网条目即可。
from IPython.display import HTML, displayfrom cellphonedb.utils import db_releases_utilsdisplay(HTML(db_releases_utils.get_remote_database_versions_html()['db_releases_html_table']))#咱们这里用最新的,界说cpdb的版块为5.0. 并下载database。cpdb_version = 'v5.0.0'cpdb_target_dir = os.path.join('./', cpdb_version)from cellphonedb.utils import db_utilsdb_utils.download_database(cpdb_target_dir, cpdb_version)
接下来分析即可:一般表率咱们用statistical_analysis_method。
#一股脑的把能加载的齐加载了,虽然了,也齐是有效的import numpy as npimport pandas as pdimport seaborn as snsimport scanpy as scfrom glob import iglobimport anndataimport os#import sklearnfrom sklearn.linear_model import LogisticRegressionimport matplotlib as mplimport scipyimport matplotlib.pyplot as pltimport pickle
sc.settings.verbosity = 3  # verbosity: errors (0), warnings (1), info (2), hints (3)sc.logging.print_versions()sc.settings.set_figure_params(dpi=100)  # low dpi (dots per inch) yields small inline figures
cpdb_file_path = './v5.0.0/cellphonedb.zip'meta_file_path = './cellphonedb_meta.txt'counts_file_path = './Normalized_counts.txt'out_path = './test1'
#一般表率咱们用statistical_analysis_method。(遍及的互作分析,并诡计互作分析显赫性)from cellphonedb.src.core.methods import cpdb_statistical_analysis_methodcpdb_results = cpdb_statistical_analysis_method.call(    cpdb_file_path = cpdb_file_path,                     meta_file_path = meta_file_path,                    counts_file_path = counts_file_path,                counts_data = 'hgnc_symbol',                        #active_tfs_file_path = active_tf_path,           #microenvs_file_path = microenvs_file_path,         score_interactions = True,                         iterations = 1000,                               threshold = 0.1,                                   threads = 5,                                    debug_seed = 42,                                    result_precision = 3,                               pvalue = 0.05,                                      separator = '|',                                   debug = False,                                     output_path = out_path                  )
cellphonedb V5的开动速率是大大升迁,不错看一下开动日记。一个字:快!
Reading user files...The following user files were loaded successfully:./Normalized_counts.txt./cellphonedb_meta.txt[][CORE][21/12/23-16:58:42][INFO] [Cluster Statistical Analysis] Threshold:0.1 Iterations:1000 Debug-seed:42 Threads:5 Precision:3[][CORE][21/12/23-16:58:42][WARNING] Debug random seed enabled. Set to 42[][CORE][21/12/23-16:58:43][INFO] Running Real Analysis[][CORE][21/12/23-16:58:43][INFO] Running Statistical Analysis100%|██████████| 1000/1000 [03:23<00:00,  4.91it/s][ ][CORE][21/12/23-17:02:08][INFO] Building Pvalues result[ ][CORE][21/12/23-17:02:09][INFO] Building results[ ][CORE][21/12/23-17:02:09][INFO] Scoring interactions: Filtering genes per cell type..100%|██████████| 12/12 [00:00<00:00, 42.54it/s][ ][CORE][21/12/23-17:02:09][INFO] Scoring interactions: Calculating mean expression of each gene per group/cell type..100%|██████████| 12/12 [00:00<00:00, 173.78it/s][ ][CORE][21/12/23-17:02:10][INFO] Scoring interactions: Calculating scores for all interactions and cell types..100%|██████████| 144/144 [00:33<00:00,  4.27it/s]Saved deconvoluted to ./test1/statistical_analysis_deconvoluted_12_21_2023_170246.txtSaved deconvoluted_percents to ./test1/statistical_analysis_deconvoluted_percents_12_21_2023_170246.txtSaved means to ./test1/statistical_analysis_means_12_21_2023_170246.txtSaved pvalues to ./test1/statistical_analysis_pvalues_12_21_2023_170246.txtSaved significant_means to ./test1/statistical_analysis_significant_means_12_21_2023_170246.txtSaved interaction_scores to ./test1/statistical_analysis_interaction_scores_12_21_2023_170246.txt
临了咱们得到的文献如下:和V3相通,那么当然,可视化就不错招引咱们之前的!
list(cpdb_results.keys())#['deconvoluted',# 'deconvoluted_percents',# 'means',# 'pvalues',# 'significant_means',# 'CellSign_active_interactions',# 'CellSign_active_interactions_deconvoluted',# 'interaction_scores']

虽然了,ktplotspy包,也即是ktplot的python版,也出了迥殊针对V5的可视化。要是不在python中进行可视化,得到的文献在R中进行可视化亦然不错的。一些基本可视化如下:

图片白虎

图片

但愿共享对你有启发,其他的可自行检察官网,亦然有详备的教程!认为共享有效的,点个赞再走呗! 本站仅提供存储职业,悉数实质均由用户发布,如发现存害或侵权实质,请点击举报。

创建或修改目录:/www/wwwroot/104.219.215.234/data 失败!
JzEngine Create File False