topolow
is an R package that implements a novel algorithm for antigenic cartography mapping and analysis. The package uses a physics-inspired approach combining spring forces and repulsive interactions to find optimal point configurations in high-dimensional spaces.
You can install the development version of topolow directly from GitHub:
# Install devtools if needed
if (!require("devtools")) install.packages("devtools")
# Install topolow
devtools::install_github("omid-arhami/topolow")
Alternatively, you can install using the single source file:
- Download the latest release
- For Windows binary: Install the .zip file
- For source package: Install the .tar.gz file
# For Windows binary
install.packages("path/to/topolow_0.1.1.zip", repos = NULL)
# For source package
install.packages("path/to/topolow_0.1.1.tar.gz", repos = NULL, type = "source")
Here's a basic example:
library(topolow)
# Create a simple distance matrix
dist_mat <- matrix(c(0, 2, 3, 2, 0, NA, 3, NA, 0), nrow=3)
rownames(dist_mat) <- colnames(dist_mat) <- c("V/1", "V/2", "S/1")
# Run TopoLow in 2D
result <- topolow_full(dist_mat, ndim=2, max_iter=100,
k0=1.0, cooling_rate=0.01, c_repulsion=0.01)
# Visualize results
plot(result)
For detailed documentation:
# View package documentation
?topolow
# List available vignettes
vignette(package = "topolow")
# Read specific vignette
vignette("parameter-fitting", package = "topolow")
Additional vignettes with detailed computational studies are available in the reproduction_examples/
directory:
parameter-fitting-h3n2.Rmd
assay_data_analysis_HIV_Subtype.Rmd
methods-comparison-h3n2-hiv.Rmd
synthetic-parameter-fitting.Rmd
synthetic_data_algorithm_comparison.Rmd
To run these studies:
# Clone the repository
git clone https://github.com/omid-arhami/topolow.git
# Run specific reproduction study
rmarkdown::render("reproduction_examples/synthetic_data_algorithm_comparison.Rmd")
Note: These studies may take several hours to complete and require significant computational resources.
- Optimized point configuration in high-dimensional spaces
- Handling of missing and thresholded measurements
- Processing of antigenic assay data
- Interactive visualization of antigenic maps
- Cross-validation and error analysis
- Network structure analysis
- Support for parallel processing and high-performance computing environments
The algorithm can handle input data in various formats - if the raw input consists of one or multiple long tables with references on columns (rows) and challenges on rows (columns), they are converted to the standard matrix form.
The package accepts distance matrices with the following characteristics:
- Square symmetric matrices
- Can contain NA values for missing measurements
- Can contain threshold indicators (< or >) for bounded measurements
- Row and column names should identify antigens (V/) and antisera (S/)
Key parameters for the TopoLow algorithm:
- ndim: Number of dimensions (typically 2-20)
- k0: Initial spring constant (typical range: 0.1-30)
- cooling_rate: Spring decay rate (typical range: 0.0001-0.1)
- c_repulsion: Repulsion constant (typical range: 0.00001-0.1)
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
This project is protected by a pre-publication license.
- Researchers can use the software for academic purposes.
- Redistribution, modification, and commercial use are prohibited before publication.
The license will transition upon publication - see the LICENSE file for details.
If you use this package, please cite:
Arhami and Rohani, 2025 [doi:to be added]
- Maintainer: Omid Arhami
- Email: [email protected]
- GitHub: @omid-arhami