Antigenic cartography via metric multidimensional scaling (MDS), implementing
the LispMDS algorithm of Smith et al. (2004). Given a table of
haemagglutination inhibition (HI) titers between virus strains (antigens) and
post-infection ferret sera, Rlispmds produces a 2D (or higher-dimensional)
antigenic map in which distances between antigens reflect their antigenic
similarity.
# Install from CRAN (once available)
install.packages("Rlispmds")
# Or install the development version from GitHub
# install.packages("remotes")
remotes::install_github("drserajames/Rlispmds")library(Rlispmds)
# Read an HI titer table
file <- system.file("extdata", "example_h3n2.tsv", package = "Rlispmds")
map <- read_titer_table(file)
# Optimise (100 random starts, 2 dimensions)
map <- optimize_map(map, num_optimizations = 100)
# Inspect
map
map_stress(map)
ag_coords(map)
# Plot
plot(map)
# Save / reload
save_map(map, "h3n2_map.json")
map2 <- load_map("h3n2_map.json")| Category | Functions |
|---|---|
| I/O | read_titer_table(), save_map(), load_map(), write_titer_table() |
| Optimisation | optimize_map(), move_trapped_points(), stress() |
| Coordinates | ag_coords(), sr_coords(), all_coords(), set_coords() |
| Map info | map_stress(), ag_names(), sr_names(), num_antigens(), num_sera() |
| Manipulation | scale_map(), translate_map(), rotate_map() |
| Analysis | dimension_test(), titer_summary(), map_distances() |
| Procrustes | procrustes_map(), procrustes_rmsd() |
| Bootstrap | bootstrap_map(), plot_bootstrap() |
| Titers | titer_to_log(), titers_to_log(), compute_col_bases() |
Smith DJ, Lapedes AS, de Jong JC, et al. (2004). Mapping the antigenic and genetic evolution of influenza virus. Science, 305(5682), 371–376. https://doi.org/10.1126/science.1097211
GPL-3