Sequence-based TF affinity scoring can be conducted with the FIMO suite, see @Sonawane2017. We have serialized an object with references to FIMO outputs for 16 TFs.
suppressPackageStartupMessages({ library(TFutils) library(GenomicRanges) }) fimo16
While the token bed
is used in the filenames, the files are
not actually bed format!
scanTabix
We can use reduceByRange
to import selected scans.
si = TFutils::seqinfo_hg19_chr17 myg = GRanges("chr17", IRanges(38.07e6,38.09e6), seqinfo=si) colnames(fimo16) = fimo16$HGNC lk2 = reduceByRange(fimo16[, c("POU2F1", "VDR")], MAP=function(r,f) scanTabix(f, param=r)) str(lk2)
This result can be massaged into a GRanges or other desirable structure.
fimo_granges
takes care of this.
#fimo_ranges = function(gf, query) { # prototypical code # rowRanges(gf) = query # ans = reduceByRange(gf, MAP=function(r,f) scanTabix(f, param=r)) # ans = unlist(ans, recursive=FALSE) # drop top list structure # tabs = lapply(ans, lapply, function(x) { # con = textConnection(x) # on.exit(close(con)) # dtf = read.delim(con, h=FALSE, stringsAsFactors=FALSE, sep="\t") # colnames(dtf) = c("chr", "start", "end", "rname", "score", "dir", "pval") # ans = with(dtf, GRanges(seqnames=chr, IRanges(start, end), # rname=rname, score=score, dir=dir, pval=pval)) # ans # }) # GRangesList(unlist(tabs, recursive=FALSE)) #} rr = fimo_granges(fimo16[, c("POU2F1", "VDR")], myg) rr
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.