#' add_gwas
#'
#' This function will add GWAS info
#' @param x dataframe of eqtl result
#' @param file_gwas file to gwas information
#' @return Will add two columns - gwasTrait and gwasP
#' @importFrom plyr mapvalues
#' @examples
#' load("data/res.Rdata")
#' res <- add_siglabel_class(res)
#' @export
#'
add_gwas <- function(x, file_gwas)
{
gwas <- read.table(file_gwas, header = F, sep = "\t", stringsAsFactors = F, quote = "")
x$gwasTrait <- NA
x[which(x$snp %in% gwas$V4), 'gwasTrait'] <- plyr::mapvalues(x[which(x$snp %in% gwas$V4), 'snp'], gwas$V4, gwas$V18)
x$gwasP <- NA
x[which(x$snp %in% gwas$V4), 'gwasP'] <- plyr::mapvalues(x[which(x$snp %in% gwas$V4), 'snp'], gwas$V4, gwas$V19)
return(x)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.