The data that is going to be plotted in this file was collected by Alice B. Popejoy and Stephanie M. Fullerton. It was collected using genome-wide association studies from the GWAS catalog, the same method that was used in 2009 for the comparative data. The process was repeated in 2016 because the previous study had lots of European bias, which brought on the problem of new genomic medicine being beneficial to only a privileged few. In order to have a more up to date genomic catalog in terms of the population now, the process had to have been repeated, and that is what happened.
This chunk essentially contains the data for the pie graphs, in the form of vectors. One vector contains the percentages for each group: European ancestry, Asian ancestry, and other non-European ancestry, witch one vector for each study. The other vector contains the labels for the pie graph.
euro_asian_other2009 <- c(96,3,1)
labels2009 <- c("European", "Asian", "Other")
euro_asian_other2016 <- c(81,14,5)
labels2016 <- c("European", "Asian", "Other")
# set up par()
par(mfrow = c(1,2), mar = c(2,3,1,5))
#pie graphs 1
# add main, init.angle, radius, and col
pie(x = euro_asian_other2009,
labels = labels2009,
main = "2009",
init.angle = -82,
radius = 1,
col = c(1,5,6))
# pie graph 2
# add main, init.angle, radius, and col
pie(x = euro_asian_other2016,
labels = labels2016,
main = "2016",
init.angle = -55,
radius = 1,
col = c(1,5,6))
# data
dat2016 <- c(14, 3,1,0.54,0.28,0.08,0.05)
dat2016_rev <- rev(dat2016)
barplotdata2016 <- matrix(c(dat2016_rev))
# labels
labels_x <- rev(c("Asian","African","Mixed", "Hispanic &\nLatin American",
"Pacific Islander","Arab & Middle East","Native peoples"))
par(mfrow = c(1,1))
barplot(barplotdata2016,
width = 0.01,
xlim = c(0,0.1),
axes = F,
col = c(1,2,3,4,5,6,7),
legend.text = labels_x)