安装 python2r环境 并激活
conda create -n python2r -y
conda activate python2rconda install pip -y
conda install mamba -c conda-forge -c bioconda -y
conda install python -y
conda install ipykernel -y
python -m ipykernel install --user --name python2r --display-name "python2r"
相关包的安装 How to program with Python and R in Jupyter Notebook - Ander Fernández (anderfernandez.com)Getting started with Python and the IPython notebook — Computational Statistics in Python 0.1 documentation (duke.edu)
conda install -c r r-essentials -y
pip install rpy2[all]
pip install rpy2 -i https://pypi.douban.com/simple/ #rpy2/rpy2: Interface to use R from Python (github.com)
或者使用conda 安装rpy2
conda install -c "conda-forge/label/cf202003" rpy2 -y
##############正式使用
Clustering Genes by Pseudotemporal Expression Pattern Getting started with Monocle - Dave Tang's blog
Monocle provides functionality for clustering genes according to their pseudotime value. The clustering analysis and plotting are done in one step using the plot_pseudotime_heatmap() function; to save the clustering results, use return_heatmap = TRUE.
1 2 3 4 5 6 7 8 9 |
|
my_branched_heatmap <- plot_genes_branched_heatmap(my_cds_subset[row.names(subset(BEAM_res, qval < 1e-4)),],
branch_point = 1,
num_clusters = 4,
cores = 8,
use_gene_short_name = TRUE,
show_rownames = TRUE,
return_heatmap = TRUE)