R/browse_lambert_gwaslinks.R

Defines functions browse_lambert_gwaslinks

Documented in browse_lambert_gwaslinks

#' browse several hundred disease-TF associations with hyperlinked PMIDs
#' @examples
#' if (interactive()) browse_lambert_gwaslinks()
#' @note Based on supplemental table S4 of PMID 29425488
#' @export
browse_lambert_gwaslinks = function() {
 dis = read.csv(system.file("lambert/S4_DiseaseTFMuts.csv", package=
   "TFutils"), 
   stringsAsFactors=FALSE, check.names=FALSE)
 dis[192,][,3] = gsub(", ", ",", dis[192,3])
 fabricate_anchor = function(x)
    sprintf("<a href=http://pubmed.gov/%s>%s</a>", x, x)
 pms = dis[,3]
 spms = strsplit(pms, ",")
 p0 = function(x) paste0(x, collapse=", ")
 dis$PMID = sapply(spms, function(z)p0(unname(sapply(z, function(x)fabricate_anchor(x)))))
 DT::datatable(dis, escape=FALSE)
}

Try the TFutils package in your browser

Any scripts or data that you put into this service are public.

TFutils documentation built on Nov. 8, 2020, 8:28 p.m.