This paper is an analysis by Alice B. Popejoy and Stephanie M. Fullerton studying genome-wide association studies (GWAS). They found the majority of these studies mainly covered those of only European descent from a study in 2009. In this current study, the analysis was based on data collected through sample descriptions included in the GWAS Catalog from 2009. The process was repeated in order to update the 2009 analysis to determine the proportion of ethnicity that did not fall into the European ancestry that were included in GWAS, with their results proving further that there is a lack of diversity studied for those of non-European descent.
Create vectors to contain the data and labels to make the pie graphs at the top of figures.
Each vector has 3 elements: European ancestry, Asian ancestry, and other non-European ancestry.
DO NOT name your vector for the labels “labels”, since this is the name of an existing R function.
Include new line characters in the text as needed to improve spacing.
data2009 <- c(96,3,1)
labelsOfData <- c("European\n","\n\nAsian","\nNon-Europeanan")
data2016 <- c(81,14,5)
Pro Tip: adding a new line character in front of the text or behind it in your labels and help you adjust spacing. E.g. “European” or “” (note - if you don’t delete this instruction the preceding text will have some weird features.)
# 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(data2009, labels = labelsOfData, main = "2009", init.angle = -82, radius = 1, col = c(2,3,4))
# pie graph 2
# add main, init.angle, radius, and col
pie(data2016, labels = labelsOfData, main = "2016", init.angle = -57, radius = 1, col = c(2,3,4))
If you want, you can examine this code below to see how stracked bar graphs are made
# data
# 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)