twomodeclusteringGA is an R package for performing two-mode clustering (biclustering) using a Genetic Algorithm (GA). The package provides a flexible and efficient framework to detect row and column clusters simultaneously in numeric data matrices.
Key features:
You can install the development version directly from GitHub:
# install.packages("devtools")
# devtools::install_github("joshageman/twomodeclusteringGA")
install.packages("twomodeclusteringGA", repos = c('https://joshageman.r-universe.dev', 'https://cloud.r-project.org'))
A toy dataset is included to demonstrate the functionality:
data("twomodeToy")
myMatrix_s <- scale(twomodeToy)
# Run the GA-based two-mode clustering
result <- twomodeClusteringGA(
myMatrix = myMatrix_s,
nRowClusters = 2,
nColClusters = 3,
seeds = 1,
maxiter = 200,
popSize = 30,
validate = TRUE,
verbose = TRUE
)
# Inspect the result
print(result)
summary(result)
myTwomodeResult <- as.data.frame(result)
head(myTwomodeResult)
# Plot the clustered heatmap
plotTwomodeClustering(
myMatrix = myMatrix_s,
result = result,
title = "Two-mode clustering Toy example",
fixAspect = FALSE
)
This package builds on the literature on biclustering and genetic algorithms. Key references:
Contributions, suggestions, and bug reports are welcome. Please open an issue or submit a pull request.
Maintainer: Jos Hageman (jos.hageman@wur.nl) Wageningen University & Research