R implementation of the PhenoGraph algorithm — a clustering method designed for high-dimensional single-cell data analysis. It works by creating a graph representing phenotypic similarities between cells by calculating the Jaccard coefficient between nearest-neighbor sets, and then identifying communities using the Louvain method.
This is a maintained fork of JinmiaoChenLab/Rphenograph with fixes for modern R (>= 4.1) and igraph (>= 2.0).
# Install from GitHub (recommended)
pak::pkg_install("i-cyto/Rphenograph")
# Or with remotes
remotes::install_github("i-cyto/Rphenograph")The package compiles cleanly on ARM64 Macs. If you hit issues:
-
Install/update Xcode Command Line Tools:
xcode-select --install
-
Check
~/.R/Makevarsfor stale x86 flags. If the file contains-mtune=core2or-march=core2, remove or comment out those lines. These are Intel-only flags that break ARM64 compilation. -
Ensure R itself is ARM64-native. In R, run
R.version$arch— it should sayaarch64, notx86_64. If it saysx86_64, download the native ARM64 build from https://cran.r-project.org/bin/macosx/.
install.packages(
"https://github.com/i-cyto/Rphenograph/releases/download/Rphenograph_0.99.1.9004/Rphenograph_0.99.1.9004.zip",
repos = NULL, type = "win.binary"
)library(Rphenograph)
library(igraph)
iris_unique <- unique(iris)
data <- as.matrix(iris_unique[, 1:4])
out <- Rphenograph(data, k = 45)
# Cluster memberships
membership(out[[2]])
# Modularity
modularity(out[[2]])Levine JH, Simonds EF, Bendall SC, Davis KL, Amir ED, Tadmor MD, et al. Data-Driven Phenotypic Dissection of AML Reveals Progenitor-like Cells that Correlate with Prognosis. Cell, 2015. https://doi.org/10.1016/j.cell.2015.05.047