> library(CellChat)
载入需要的程辑包:dplyr
载入程辑包:‘dplyr’
The following objects are masked from ‘package:stats’:
filter, lag
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
载入需要的程辑包:igraph
载入程辑包:‘igraph’
The following objects are masked from ‘package:dplyr’:
as_data_frame, groups, union
The following objects are masked from ‘package:stats’:
decompose, spectrum
The following object is masked from ‘package:base’:
union
载入需要的程辑包:ggplot2
> library(patchwork)
> options(stringsAsFactors = FALSE)
> # Here we load a scRNA-seq data matrix and its associated cell meta data
> load(url("https://ndownloader.figshare.com/files/25950872")) # This is a combined data from two biological conditions: normal and diseases
> data.input = data_humanSkin$data # normalized data matrix
> meta = data_humanSkin$meta # a dataframe with rownames containing cell mata data
> cell.use = rownames(meta)[meta$condition == "LS"] # extract the cell names from disease data
> # Prepare input data for CelChat analysis
> data.input = data.input[, cell.use]
> meta = meta[cell.use, ]
> # meta = data.frame(labels = meta$labels[cell.use], row.names = colnames(data.input)) # manually create a dataframe consisting of the cell labels
> unique(meta$labels) # check the cell labels
[1] Inflam. FIB FBN1+ FIB APOE+ FIB COL11A1+ FIB cDC2
[6] LC Inflam. DC cDC1 CD40LG+ TC Inflam. TC
[11] TC NKT
12 Levels: APOE+ FIB FBN1+ FIB COL11A1+ FIB Inflam. FIB cDC1 ... NKT
> cellchat <- createCellChat(object = data.input, meta = meta, group.by = "labels")
Create a CellChat object from a data matrix
Set cell identities for the new CellChat object
The cell groups used for CellChat analysis are APOE+ FIB FBN1+ FIB COL11A1+ FIB Inflam. FIB cDC1 cDC2 LC Inflam. DC TC Inflam. TC CD40LG+ TC NKT
> cellchat <- addMeta(cellchat, meta = meta)
> cellchat <- setIdent(cellchat, ident.use = "labels") # set "labels" as default cell identity
> levels(cellchat@idents) # show factor levels of the cell labels
[1] "APOE+ FIB" "FBN1+ FIB" "COL11A1+ FIB" "Inflam. FIB"
[5] "cDC1" "cDC2" "LC" "Inflam. DC"
[9] "TC" "Inflam. TC" "CD40LG+ TC" "NKT"
> groupSize <- as.numeric(table(cellchat@idents)) # number of cells in each cell group
> CellChatDB <- CellChatDB.human # use CellChatDB.mouse if running on mouse data
> showDatabaseCategory(CellChatDB)
> # Show the structure of the database
> dplyr::glimpse(CellChatDB$interaction)
Rows: 1,939
Columns: 11
$ interaction_name <chr> "TGFB1_TGFBR1_TGFBR2", "TGFB2_TGFBR1_T...
$ pathway_name <chr> "TGFb", "TGFb", "TGFb", "TGFb", "TGFb"...
$ ligand <chr> "TGFB1", "TGFB2", "TGFB3", "TGFB1", "T...
$ receptor <chr> "TGFbR1_R2", "TGFbR1_R2", "TGFbR1_R2",...
$ agonist <chr> "TGFb agonist", "TGFb agonist", "TGFb ...
$ antagonist <chr> "TGFb antagonist", "TGFb antagonist", ...
$ co_A_receptor <chr> "", "", "", "", "", "", "", "", "", ""...
$ co_I_receptor <chr> "TGFb inhibition receptor", "TGFb inhi...
$ evidence <chr> "KEGG: hsa04350", "KEGG: hsa04350", "K...
$ annotation <chr> "Secreted Signaling", "Secreted Signal...
$ interaction_name_2 <chr> "TGFB1 - (TGFBR1+TGFBR2)", "TGFB2 - (T...
> # use a subset of CellChatDB for cell-cell communication analysis
> CellChatDB.use <- subsetDB(CellChatDB, search = "Secreted Signaling") # use Secreted Signaling
> # set the used database in the object
> cellchat@DB <- CellChatDB.use
> cellchat <- subsetData(cellchat) # subset the expression data of signaling genes for saving computation cost
> future::plan("multiprocess", workers = 4) # do parallel
> #> Warning: [ONE-TIME WARNING] Forked processing ('multicore') is disabled
> #> in future (>= 1.13.0) when running R from RStudio, because it is
> #> considered unstable. Because of this, plan("multicore") will fall
> #> back to plan("sequential"), and plan("multiprocess") will fall back to
> #> plan("multisession") - not plan("multicore") as in the past. For more details,
> #> how to control forked processing or not, and how to silence this warning in
> #> future R sessions, see ?future::supportsMulticore
> cellchat <- identifyOverExpressedGenes(cellchat)
> cellchat <- identifyOverExpressedInteractions(cellchat)
> cellchat <- projectData(cellchat, PPI.human)
> cellchat <- computeCommunProb(cellchat, raw.use = TRUE)
> # Filter out the cell-cell communication if there are only few number of cells in certain cell groups
> cellchat <- filterCommunication(cellchat, min.cells = 10)
> cellchat <- computeCommunProbPathway(cellchat)
> cellchat <- aggregateNet(cellchat)
> groupSize <- as.numeric(table(cellchat@idents))
> par(mfrow = c(1,2), xpd=TRUE)
> netVisual_circle(cellchat@net$count, vertex.weight = groupSize, weight.scale = T, label.edge= F, title.name = "Number of interactions")
> netVisual_circle(cellchat@net$weight, vertex.weight = groupSize, weight.scale = T, label.edge= F, title.name = "Interaction weights/strength")
> mat <- cellchat@net$weight
> par(mfrow = c(3,4), xpd=TRUE)
> for (i in 1:nrow(mat)) {
+ mat2 <- matrix(0, nrow = nrow(mat), ncol = ncol(mat), dimnames = dimnames(mat))
+ mat2[i, ] <- mat[i, ]
+ netVisual_circle(mat2, vertex.weight = groupSize, weight.scale = T, edge.weight.max = max(mat), title.name = rownames(mat)[i])
+ }
> pathways.show <- c("CXCL")
> # Hierarchy plot
> # Here we define `vertex.receive` so that the left portion of the hierarchy plot shows signaling to fibroblast and the right portion shows signaling to immune cells
> vertex.receiver = seq(1,4) # a numeric vector.
> netVisual_aggregate(cellchat, signaling = pathways.show, vertex.receiver = vertex.receiver)
> # Circle plot
> par(mfrow=c(1,1))
> netVisual_aggregate(cellchat, signaling = pathways.show, layout = "circle")
> # Chord diagram
> par(mfrow=c(1,1))
> netVisual_aggregate(cellchat, signaling = pathways.show, layout = "chord")
Note: The first link end is drawn out of sector 'Inflam. FIB'.
> #> Note: The first link end is drawn out of sector 'Inflam. FIB'.
> # Heatmap
> par(mfrow=c(1,1))
> netVisual_heatmap(cellchat, signaling = pathways.show, color.heatmap = "Reds")
Do heatmap based on a single object
> # Chord diagram
> group.cellType <- c(rep("FIB", 4), rep("DC", 4), rep("TC", 4)) # grouping cell clusters into fibroblast, DC and TC cells
> names(group.cellType) <- levels(cellchat@idents)
> netVisual_chord_cell(cellchat, signaling = pathways.show, group = group.cellType, title.name = paste0(pathways.show, " signaling network"))
Plot the aggregated cell-cell communication network at the signaling pathway level
Note: The first link end is drawn out of sector 'Inflam. FIB'.
> netAnalysis_contribution(cellchat, signaling = pathways.show)
> pairLR.CXCL <- extractEnrichedLR(cellchat, signaling = pathways.show, geneLR.return = FALSE)
> LR.show <- pairLR.CXCL[1,] # show one ligand-receptor pair
> # Hierarchy plot
> vertex.receiver = seq(1,4) # a numeric vector
> netVisual_individual(cellchat, signaling = pathways.show, pairLR.use = LR.show, vertex.receiver = vertex.receiver)
> # Circle plot
> netVisual_individual(cellchat, signaling = pathways.show, pairLR.use = LR.show, layout = "circle")
[[1]]
> #> [[1]]
> # Chord diagram
> netVisual_individual(cellchat, signaling = pathways.show, pairLR.use = LR.show, layout = "chord")
Note: The first link end is drawn out of sector 'Inflam. FIB'.
[[1]]
> # Access all the signaling pathways showing significant communications
> pathways.show.all <- cellchat@netP$pathways
> # check the order of cell identity to set suitable vertex.receiver
> levels(cellchat@idents)
[1] "APOE+ FIB" "FBN1+ FIB" "COL11A1+ FIB" "Inflam. FIB"
[5] "cDC1" "cDC2" "LC" "Inflam. DC"
[9] "TC" "Inflam. TC" "CD40LG+ TC" "NKT"
> vertex.receiver = seq(1,4)
> for (i in 1:length(pathways.show.all)) {
+ # Visualize communication network associated with both signaling pathway and individual L-R pairs
+ netVisual(cellchat, signaling = pathways.show.all[i], vertex.receiver = vertex.receiver, layout = "hierarchy")
+ # Compute and visualize the contribution of each ligand-receptor pair to the overall signaling pathway
+ gg <- netAnalysis_contribution(cellchat, signaling = pathways.show.all[i])
+ ggsave(filename=paste0(pathways.show.all[i], "_L-R_contribution.pdf"), plot=gg, width = 3, height = 2, units = 'in', dpi = 300)
+ }
> # show all the significant interactions (L-R pairs) from some cell groups (defined by 'sources.use') to other cell groups (defined by 'targets.use')
> netVisual_bubble(cellchat, sources.use = 4, targets.use = c(5:11), remove.isolate = FALSE)
Comparing communications on a single object
> # show all the significant interactions (L-R pairs) associated with certain signaling pathways
> netVisual_bubble(cellchat, sources.use = 4, targets.use = c(5:11), signaling = c("CCL","CXCL"), remove.isolate = FALSE)
Comparing communications on a single object
> # show all the significant interactions (L-R pairs) based on user's input (defined by `pairLR.use`)
> pairLR.use <- extractEnrichedLR(cellchat, signaling = c("CCL","CXCL","FGF"))
> netVisual_bubble(cellchat, sources.use = c(3,4), targets.use = c(5:8), pairLR.use = pairLR.use, remove.isolate = TRUE)
Comparing communications on a single object
> # show all the significant interactions (L-R pairs) from some cell groups (defined by 'sources.use') to other cell groups (defined by 'targets.use')
> # show all the interactions sending from Inflam.FIB
> netVisual_chord_gene(cellchat, sources.use = 4, targets.use = c(5:11), lab.cex = 0.5,legend.pos.y = 30)
Note: The first link end is drawn out of sector 'MIF'.
> # show all the interactions received by Inflam.DC
> netVisual_chord_gene(cellchat, sources.use = c(1,2,3,4), targets.use = 8, legend.pos.x = 15)
> # show all the significant interactions (L-R pairs) associated with certain signaling pathways
> netVisual_chord_gene(cellchat, sources.use = c(1,2,3,4), targets.use = c(5:11), signaling = c("CCL","CXCL"),legend.pos.x = 8)
Note: The second link end is drawn out of sector 'CXCR4 '.
Note: The first link end is drawn out of sector 'CXCL12 '.
> # show all the significant signaling pathways from some cell groups (defined by 'sources.use') to other cell groups (defined by 'targets.use')
> netVisual_chord_gene(cellchat, sources.use = c(1,2,3,4), targets.use = c(5:11), slot.name = "netP", legend.pos.x = 10)
Note: The second link end is drawn out of sector ' '.
Note: The first link end is drawn out of sector 'MIF'.
Note: The second link end is drawn out of sector ' '.
Note: The first link end is drawn out of sector 'CXCL '.
> plotGeneExpression(cellchat, signaling = "CXCL")
Registered S3 method overwritten by 'spatstat':
method from
print.boxx cli
Scale for 'y' is already present. Adding another scale for 'y',
which will replace the existing scale.
Scale for 'y' is already present. Adding another scale for 'y',
which will replace the existing scale.
Scale for 'y' is already present. Adding another scale for 'y',
which will replace the existing scale.
> plotGeneExpression(cellchat, signaling = "CXCL", enriched.only = FALSE)
Scale for 'y' is already present. Adding another scale for 'y',
which will replace the existing scale.
Scale for 'y' is already present. Adding another scale for 'y',
which will replace the existing scale.
Scale for 'y' is already present. Adding another scale for 'y',
which will replace the existing scale.
Scale for 'y' is already present. Adding another scale for 'y',
which will replace the existing scale.
Scale for 'y' is already present. Adding another scale for 'y',
which will replace the existing scale.
Scale for 'y' is already present. Adding another scale for 'y',
which will replace the existing scale.
Scale for 'y' is already present. Adding another scale for 'y',
which will replace the existing scale.
Scale for 'y' is already present. Adding another scale for 'y',
which will replace the existing scale.
Scale for 'y' is already present. Adding another scale for 'y',
which will replace the existing scale.
Scale for 'y' is already present. Adding another scale for 'y',
which will replace the existing scale.
Scale for 'y' is already present. Adding another scale for 'y',
which will replace the existing scale.
Scale for 'y' is already present. Adding another scale for 'y',
which will replace the existing scale.
Scale for 'y' is already present. Adding another scale for 'y',
which will replace the existing scale.
Scale for 'y' is already present. Adding another scale for 'y',
which will replace the existing scale.
Scale for 'y' is already present. Adding another scale for 'y',
which will replace the existing scale.
Scale for 'y' is already present. Adding another scale for 'y',
which will replace the existing scale.
Scale for 'y' is already present. Adding another scale for 'y',
which will replace the existing scale.
Scale for 'y' is already present. Adding another scale for 'y',
which will replace the existing scale.
> # Compute the network centrality scores
> cellchat <- netAnalysis_computeCentrality(cellchat, slot.name = "netP") # the slot 'netP' means the inferred intercellular communication network of signaling pathways
> # Visualize the computed centrality scores using heatmap, allowing ready identification of major signaling roles of cell groups
> netAnalysis_signalingRole_network(cellchat, signaling = pathways.show, width = 8, height = 2.5, font.size = 10)
> # Signaling role analysis on the aggregated cell-cell communication network from all signaling pathways
> gg1 <- netAnalysis_signalingRole_scatter(cellchat)
Signaling role analysis on the aggregated cell-cell communication network from all signaling pathways
> #> Signaling role analysis on the aggregated cell-cell communication network from all signaling pathways
> # Signaling role analysis on the cell-cell communication networks of interest
> gg2 <- netAnalysis_signalingRole_scatter(cellchat, signaling = c("CXCL", "CCL"))
Signaling role analysis on the cell-cell communication network from user's input
> #> Signaling role analysis on the cell-cell communication network from user's input
> gg1 + gg2
> # Signaling role analysis on the aggregated cell-cell communication network from all signaling pathways
> ht1 <- netAnalysis_signalingRole_heatmap(cellchat, pattern = "outgoing")
> ht2 <- netAnalysis_signalingRole_heatmap(cellchat, pattern = "incoming")
> ht1 + ht2
> # Signaling role analysis on the cell-cell communication networks of interest
> ht <- netAnalysis_signalingRole_heatmap(cellchat, signaling = c("CXCL", "CCL"))
> library(NMF)
载入需要的程辑包:pkgmaker
载入需要的程辑包:registry
载入需要的程辑包:rngtools
载入需要的程辑包:cluster
NMF - BioConductor layer [OK] | Shared memory capabilities [NO: windows] | Cores 3/4
载入程辑包:‘NMF’
The following objects are masked from ‘package:igraph’:
algorithm, compare
> #> Loading required package: cluster
> #> NMF - BioConductor layer [OK] | Shared memory capabilities [NO: bigmemory] | Cores 15/16
> #> To enable shared memory capabilities, try: install.extras('
> #> NMF
> #> ')
> #>
> #> Attaching package: 'NMF'
> #> The following objects are masked from 'package:igraph':
> #>
> #> algorithm, compare
> library(ggalluvial)
> selectK(cellchat, pattern = "outgoing")#慢
> nPatterns = 3
> cellchat <- identifyCommunicationPatterns(cellchat, pattern = "outgoing", k = nPatterns)
> # river plot
> netAnalysis_river(cellchat, pattern = "outgoing")
Please make sure you have load `library(ggalluvial)` when running this function
> #> Please make sure you have load `library(ggalluvial)` when running this function
> # dot plot
> netAnalysis_dot(cellchat, pattern = "outgoing")
> dev.off()
null device
1
> selectK(cellchat, pattern = "incoming")
> nPatterns = 4
> cellchat <- identifyCommunicationPatterns(cellchat, pattern = "incoming", k = nPatterns)
> # river plot
> netAnalysis_river(cellchat, pattern = "incoming")
Please make sure you have load `library(ggalluvial)` when running this function
> #> Please make sure you have load `library(ggalluvial)` when running this function
> # dot plot
> netAnalysis_dot(cellchat, pattern = "incoming")
> # BAOCUO
> library(Seurat)
Seurat v4 will be going to CRAN in the near future;
for more details, please visit https://satijalab.org/seurat/v4_changes
> cellchat <- computeNetSimilarity(cellchat, type = "functional")
> cellchat <- netEmbedding(cellchat, type = "functional")
Manifold learning of the signaling networks for a single dataset
No non-system installation of Python could be found.
Would you like to download and install Miniconda?
Miniconda is an open source environment management system for Python.
See https://docs.conda.io/en/latest/miniconda.html for more details.
Would you like to install Miniconda? [Y/n]: Y
* Downloading "https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe" ...
试开URL’https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe'
Content type 'application/octet-stream' length 59801432 bytes (57.0 MB)
downloaded 57.0 MB
* Installing Miniconda -- please wait a moment ...
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done
## Package Plan ##
environment location: C:\Users\zzu\AppData\Local\R-MINI~1
added / updated specs:
- conda
The following packages will be downloaded:
package | build
---------------------------|-----------------
ca-certificates-2021.1.19 | haa95532_1 119 KB
certifi-2020.12.5 | py38haa95532_0 141 KB
cffi-1.14.5 | py38hcd4344a_0 224 KB
chardet-4.0.0 |py38haa95532_1003 211 KB
conda-4.10.0 | py38haa95532_0 2.9 MB
conda-package-handling-1.7.3| py38h8cc25b3_1 721 KB
cryptography-3.4.7 | py38h71e12ea_0 643 KB
idna-2.10 | pyhd3eb1b0_0 52 KB
openssl-1.1.1k | h2bbff1b_0 4.8 MB
pip-21.0.1 | py38haa95532_0 1.8 MB
pyopenssl-20.0.1 | pyhd3eb1b0_1 49 KB
requests-2.25.1 | pyhd3eb1b0_0 52 KB
ruamel_yaml-0.15.100 | py38h2bbff1b_0 273 KB
setuptools-52.0.0 | py38haa95532_0 726 KB
sqlite-3.35.4 | h2bbff1b_0 761 KB
tqdm-4.59.0 | pyhd3eb1b0_1 93 KB
urllib3-1.26.4 | pyhd3eb1b0_0 105 KB
vc-14.2 | h21ff451_1 8 KB
vs2015_runtime-14.27.29016 | h5e58377_2 1007 KB
wheel-0.36.2 | pyhd3eb1b0_0 33 KB
------------------------------------------------------------
Total: 14.6 MB
The following packages will be REMOVED:
zlib-1.2.11-h62dcd97_4
The following packages will be UPDATED:
ca-certificates 2020.10.14-0 --> 2021.1.19-haa95532_1
certifi pkgs/main/noarch::certifi-2020.6.20-p~ --> pkgs/main/win-64::certifi-2020.12.5-py38haa95532_0
cffi 1.14.3-py38hcd4344a_2 --> 1.14.5-py38hcd4344a_0
chardet 3.0.4-py38haa95532_1003 --> 4.0.0-py38haa95532_1003
conda 4.9.2-py38haa95532_0 --> 4.10.0-py38haa95532_0
conda-package-han~ 1.7.2-py38h76e460a_0 --> 1.7.3-py38h8cc25b3_1
cryptography 3.2.1-py38hcd4344a_1 --> 3.4.7-py38h71e12ea_0
openssl 1.1.1h-he774522_0 --> 1.1.1k-h2bbff1b_0
pip 20.2.4-py38haa95532_0 --> 21.0.1-py38haa95532_0
pyopenssl 19.1.0-pyhd3eb1b0_1 --> 20.0.1-pyhd3eb1b0_1
requests 2.24.0-py_0 --> 2.25.1-pyhd3eb1b0_0
ruamel_yaml 0.15.87-py38he774522_1 --> 0.15.100-py38h2bbff1b_0
setuptools 50.3.1-py38haa95532_1 --> 52.0.0-py38haa95532_0
sqlite 3.33.0-h2a8f88b_0 --> 3.35.4-h2bbff1b_0
tqdm 4.51.0-pyhd3eb1b0_0 --> 4.59.0-pyhd3eb1b0_1
urllib3 1.25.11-py_0 --> 1.26.4-pyhd3eb1b0_0
vc 14.1-h0510ff6_4 --> 14.2-h21ff451_1
vs2015_runtime 14.16.27012-hf0eaf9b_3 --> 14.27.29016-h5e58377_2
wheel 0.35.1-pyhd3eb1b0_0 --> 0.36.2-pyhd3eb1b0_0
The following packages will be DOWNGRADED:
idna 2.10-py_0 --> 2.10-pyhd3eb1b0_0
Downloading and Extracting Packages
urllib3-1.26.4 | 105 KB | ########## | 100%
conda-package-handli | 721 KB | ########## | 100%
cryptography-3.4.7 | 643 KB | ########## | 100%
pyopenssl-20.0.1 | 49 KB | ########## | 100%
openssl-1.1.1k | 4.8 MB | ########## | 100%
ruamel_yaml-0.15.100 | 273 KB | ########## | 100%
pip-21.0.1 | 1.8 MB | ########## | 100%
idna-2.10 | 52 KB | ########## | 100%
certifi-2020.12.5 | 141 KB | ########## | 100%
chardet-4.0.0 | 211 KB | ########## | 100%
ca-certificates-2021 | 119 KB | ########## | 100%
sqlite-3.35.4 | 761 KB | ########## | 100%
setuptools-52.0.0 | 726 KB | ########## | 100%
tqdm-4.59.0 | 93 KB | ########## | 100%
wheel-0.36.2 | 33 KB | ########## | 100%
conda-4.10.0 | 2.9 MB | ########## | 100%
vc-14.2 | 8 KB | ########## | 100%
vs2015_runtime-14.27 | 1007 KB | ########## | 100%
cffi-1.14.5 | 224 KB | ########## | 100%
requests-2.25.1 | 52 KB | ########## | 100%
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done
## Package Plan ##
environment location: C:\Users\zzu\AppData\Local\R-MINI~1\envs\r-reticulate
added / updated specs:
- numpy
- python=3.6
The following packages will be downloaded:
package | build
---------------------------|-----------------
certifi-2020.12.5 | py36ha15d459_1 144 KB conda-forge
intel-openmp-2021.2.0 | h57928b3_616 2.6 MB conda-forge
libblas-3.9.0 | 8_mkl 3.9 MB conda-forge
libcblas-3.9.0 | 8_mkl 3.9 MB conda-forge
liblapack-3.9.0 | 8_mkl 3.9 MB conda-forge
mkl-2020.4 | hb70f87d_311 172.4 MB conda-forge
numpy-1.19.5 | py36hd1b969e_1 4.9 MB conda-forge
pip-21.0.1 | pyhd8ed1ab_0 1.1 MB conda-forge
python-3.6.13 |h39d44d4_0_cpython 19.0 MB conda-forge
python_abi-3.6 | 1_cp36m 4 KB conda-forge
setuptools-49.6.0 | py36ha15d459_3 921 KB conda-forge
vc-14.2 | hb210afc_4 13 KB conda-forge
vs2015_runtime-14.28.29325 | h5e1d092_4 2.3 MB conda-forge
wheel-0.36.2 | pyhd3deb0d_0 31 KB conda-forge
wincertstore-0.2 |py36ha15d459_1006 15 KB conda-forge
------------------------------------------------------------
Total: 215.0 MB
The following NEW packages will be INSTALLED:
certifi conda-forge/win-64::certifi-2020.12.5-py36ha15d459_1
intel-openmp conda-forge/win-64::intel-openmp-2021.2.0-h57928b3_616
libblas conda-forge/win-64::libblas-3.9.0-8_mkl
libcblas conda-forge/win-64::libcblas-3.9.0-8_mkl
liblapack conda-forge/win-64::liblapack-3.9.0-8_mkl
mkl conda-forge/win-64::mkl-2020.4-hb70f87d_311
numpy conda-forge/win-64::numpy-1.19.5-py36hd1b969e_1
pip conda-forge/noarch::pip-21.0.1-pyhd8ed1ab_0
python conda-forge/win-64::python-3.6.13-h39d44d4_0_cpython
python_abi conda-forge/win-64::python_abi-3.6-1_cp36m
setuptools conda-forge/win-64::setuptools-49.6.0-py36ha15d459_3
vc conda-forge/win-64::vc-14.2-hb210afc_4
vs2015_runtime conda-forge/win-64::vs2015_runtime-14.28.29325-h5e1d092_4
wheel conda-forge/noarch::wheel-0.36.2-pyhd3deb0d_0
wincertstore conda-forge/win-64::wincertstore-0.2-py36ha15d459_1006
Downloading and Extracting Packages
intel-openmp-2021.2. | 2.6 MB | ########## | 100%
mkl-2020.4 | 172.4 MB | ########## | 100%
pip-21.0.1 | 1.1 MB | ########## | 100%
certifi-2020.12.5 | 144 KB | ########## | 100%
libblas-3.9.0 | 3.9 MB | ########## | 100%
numpy-1.19.5 | 4.9 MB | ########## | 100%
vs2015_runtime-14.28 | 2.3 MB | ########## | 100%
python-3.6.13 | 19.0 MB | ########## | 100%
vc-14.2 | 13 KB | ########## | 100%
python_abi-3.6 | 4 KB | ########## | 100%
liblapack-3.9.0 | 3.9 MB | ########## | 100%
wincertstore-0.2 | 15 KB | ########## | 100%
libcblas-3.9.0 | 3.9 MB | ########## | 100%
wheel-0.36.2 | 31 KB | ########## | 100%
setuptools-49.6.0 | 921 KB | ########## | 100%
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
#
# To activate this environment, use
#
# $ conda activate r-reticulate
#
# To deactivate an active environment, use
#
# $ conda deactivate
* Miniconda has been successfully installed at "C:/Users/zzu/AppData/Local/r-miniconda".
Error in runUMAP(Similarity, min.dist = 0.3, n.neighbors = k) :
Cannot find UMAP, please install through pip (e.g. pip install umap-learn or reticulate::py_install(packages = 'umap-learn')).
>

image.png
> reticulate::py_install(packages = 'umap-learn')
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done
## Package Plan ##
environment location: C:\Users\zzu\AppData\Local\r-miniconda\envs\r-reticulate
added / updated specs:
- python
- umap-learn
The following packages will be downloaded:
package | build
---------------------------|-----------------
joblib-1.0.1 | pyhd8ed1ab_0 206 KB conda-forge
llvmlite-0.36.0 | py36haecd60e_0 15.1 MB conda-forge
m2w64-gcc-libgfortran-5.3.0| 6 342 KB conda-forge
m2w64-gcc-libs-5.3.0 | 7 520 KB conda-forge
m2w64-gcc-libs-core-5.3.0 | 7 214 KB conda-forge
m2w64-gmp-6.1.0 | 2 726 KB conda-forge
m2w64-libwinpthread-git-5.0.0.4634.697f757| 2 31 KB conda-forge
msys2-conda-epoch-20160418 | 1 3 KB conda-forge
numba-0.53.1 | py36h79ea69f_0 3.7 MB conda-forge
pynndescent-0.5.2 | pyh44b312d_0 43 KB conda-forge
scikit-learn-0.24.1 | py36h63cef00_0 6.4 MB conda-forge
scipy-1.5.3 | py36h7ff6e69_0 21.9 MB conda-forge
tbb-2020.2 | h2d74725_4 175 KB conda-forge
threadpoolctl-2.1.0 | pyh5ca1d4c_0 15 KB conda-forge
umap-learn-0.5.1 | py36ha15d459_0 123 KB conda-forge
zlib-1.2.11 | h62dcd97_1010 126 KB conda-forge
------------------------------------------------------------
Total: 49.6 MB
The following NEW packages will be INSTALLED:
joblib conda-forge/noarch::joblib-1.0.1-pyhd8ed1ab_0
llvmlite conda-forge/win-64::llvmlite-0.36.0-py36haecd60e_0
m2w64-gcc-libgfor~ conda-forge/win-64::m2w64-gcc-libgfortran-5.3.0-6
m2w64-gcc-libs conda-forge/win-64::m2w64-gcc-libs-5.3.0-7
m2w64-gcc-libs-co~ conda-forge/win-64::m2w64-gcc-libs-core-5.3.0-7
m2w64-gmp conda-forge/win-64::m2w64-gmp-6.1.0-2
m2w64-libwinpthre~ conda-forge/win-64::m2w64-libwinpthread-git-5.0.0.4634.697f757-2
msys2-conda-epoch conda-forge/win-64::msys2-conda-epoch-20160418-1
numba conda-forge/win-64::numba-0.53.1-py36h79ea69f_0
pynndescent conda-forge/noarch::pynndescent-0.5.2-pyh44b312d_0
scikit-learn conda-forge/win-64::scikit-learn-0.24.1-py36h63cef00_0
scipy conda-forge/win-64::scipy-1.5.3-py36h7ff6e69_0
tbb conda-forge/win-64::tbb-2020.2-h2d74725_4
threadpoolctl conda-forge/noarch::threadpoolctl-2.1.0-pyh5ca1d4c_0
umap-learn conda-forge/win-64::umap-learn-0.5.1-py36ha15d459_0
zlib conda-forge/win-64::zlib-1.2.11-h62dcd97_1010
Downloading and Extracting Packages
Downloading and Extracting Packages
m2w64-gcc-libs-5.3.0 | 520 KB | ########## | 100%
scipy-1.5.3 | 21.9 MB | ########## | 100%
zlib-1.2.11 | 126 KB | ########## | 100%
scikit-learn-0.24.1 | 6.4 MB | ########## | 100%
threadpoolctl-2.1.0 | 15 KB | ########## | 100%
numba-0.53.1 | 3.7 MB | ########## | 100%
m2w64-libwinpthread- | 31 KB | ########## | 100%
pynndescent-0.5.2 | 43 KB | ########## | 100%
msys2-conda-epoch-20 | 3 KB | ########## | 100%
tbb-2020.2 | 175 KB | ########## | 100%
joblib-1.0.1 | 206 KB | ########## | 100%
umap-learn-0.5.1 | 123 KB | ########## | 100%
llvmlite-0.36.0 | 15.1 MB | ########## | 100%
m2w64-gcc-libs-core- | 214 KB | ########## | 100%
m2w64-gcc-libgfortra | 342 KB | ########## | 100%
m2w64-gmp-6.1.0 | 726 KB | ########## | 100%
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
>

image.png

image.png
> cellchat <- netEmbedding(cellchat, type = "functional")
Manifold learning of the signaling networks for a single dataset
C:\Users\zzu\AppData\Local\R-MINI~1\envs\R-RETI~1\lib\site-packages\umap\umap_.py:133: UserWarning: A large number of your vertices were disconnected from the manifold.
Disconnection_distance = 1 has removed 142 edges.
It has fully disconnected 3 vertices.
You might consider using find_disconnected_points() to find and remove these points from your data.
Use umap.utils.disconnected_vertices() to identify them.
f"A large number of your vertices were disconnected from the manifold.\n"
> #> Manifold learning of the signaling networks for a single dataset
> cellchat <- netClustering(cellchat, type = "functional")
Classification learning of the signaling networks for a single dataset
Error in do_one(nmeth) : 外接函数调用时不能有NA/NaN/Inf(arg1)
> #> Classification learning of the signaling networks for a single dataset
> # Visualization in 2D-space
> netVisual_embedding(cellchat, type = "functional", label.size = 3.5)
Error in data.frame(x = Y[, 1], y = Y[, 2], Commun.Prob. = prob_sum/max(prob_sum), :
arguments imply differing number of rows: 13, 0