This is the start of a simplified eQTL analysis. The goal is to highlight different packages which can make this easier and a general overview of what it is.

First things first, lets load the packages we will primarily use.

library(biomaRt)
mart <- useDataset("hsapiens_gene_ensembl", useMart("ensembl"))

library(data.table)
library(magrittr) # This is to be able to use the pipe. 

Now lets read in all the data we need, specifically the snp data and expression data.

So, what are eQTLs? Expression quantitative trait loci (eQTLs) are genomic loci that contribute to variation in expression levels of mRNAs. So for each gene, the expression level and mutations are checked to see if there is an association. This indicates whether certain mutation(s) contribute to changes in expression. (plagarized from wiki :D)

#mapStuff <- function(genes) {
#  geneList <- getBM(filters= "ensembl_gene_id", attributes= c("ensembl_gene_id", "hgnc_symbol", "description", "start_position", "end_position"),values=genes,mart=mart)
#  geneList <- geneList %>% dplyr::select(-c(ensembl_gene_id))
#  return(geneList)
#}
#rownames(exprData)[1:10] %>% mapStuff()