Skip to content

drserajames/Rlispmds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rlispmds

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.

Installation

# Install from CRAN (once available)
install.packages("Rlispmds")

# Or install the development version from GitHub
# install.packages("remotes")
remotes::install_github("drserajames/Rlispmds")

Usage

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")

Key functions

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()

Reference

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

License

GPL-3

About

R/C++ reimplementation of the LispMDS antigenic cartography algorithm

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors