# Basic example: 5 variants with single measurements
kinetic_data <- data.frame(
id = c("WT", "Mut1", "Mut2", "Mut3", "Mut4"),
ka = c(1.2e5, 2.5e5, 2e5, 8.0e4, 1.8e5),
kd = c(1.5e-3, 2.0e-3, 1.5e-3, 1.2e-3, 1.8e-3)
)
gg_kdmap(data = kinetic_data, show_anno = TRUE)
# With replicates: lines connect points with same ID
kinetic_rep <- data.frame(
id = c("WT", "WT", "WT", "Mut1", "Mut1", "Mut2", "Mut3", "Mut4"),
ka = c(1.2e5, 1.5e5, 1.1e5, 2.5e5, 2.4e5, 2e5, 8.0e4, 1.8e5),
kd = c(1.5e-3, 1.6e-3, 1.4e-3, 2.0e-3, 1.9e-3, 1.5e-3, 1.2e-3, 1.8e-3)
)
gg_kdmap(data = kinetic_rep, show_anno = TRUE, fill = "id")
# Add labels and highlight reference
gg_kdmap(
data = kinetic_rep,
labels = "id",
ref_id = "WT",
ref_fill = "white",
ref_color = "red",
fill = "id"
)
# Customize iso-KD lines
gg_kdmap(
data = kinetic_rep,
iso_n = 12,
iso_color = "#7192ad",
iso_type = "solid"
)
# Turn off replicate lines
gg_kdmap(data = kinetic_rep, rep_lines = FALSE)
# Custom column names
custom_data <- data.frame(
sample = c("WT", "Mut1", "Mut2"),
kon = c(1.2e5, 2.5e5, 5.0e4),
koff = c(1.5e-3, 2.0e-3, 5.0e-4)
)
gg_kdmap(data = custom_data, id = "sample", ka = "kon", kd = "koff")
Run the code above in your browser using DataLab