oldpar <- par(no.readonly = TRUE) # Store user's options before plotting
# Running example (runs across compute_posterior, plot_data and plot_simplex)
# based on real data from chloroquine-treated participant 52 of the Vivax
# History Trial (Chu et al. 2018a, https://doi.org/10.1093/cid/ciy319)
ys <- ys_VHX_BPD["VHX_52"] # ys is a list of length one (one participant)
plot_data(ys, fs = fs_VHX_BPD, marker.annotate = FALSE)
# Full data set:
mar <- c(2, 3.5, 1.5, 1) # extra vertical margin for vertical person labels
plot_data(ys = ys_VHX_BPD, person.vert = TRUE, mar = mar, legend.lab = NA)
plot_data(ys = ys_VHX_BPD, person.vert = TRUE, mar = mar, legend.lab = NA,
fs = fs_VHX_BPD)
plot_data(ys = ys_VHX_BPD, person.vert = TRUE, mar = mar, legend.lab = NA,
fs = fs_VHX_BPD, marker.annotate = FALSE)
# Demonstrating the adaptive nature of the colour scheme:
y <- ys_VHX_BPD["VHX_52"] # A single person
# Compared to first example, colours now involve only the alleles detected in VHX_52
plot_data(y)
par(oldpar) # Restore user's options
Run the code above in your browser using DataLab