library(ggplot2)
head(mtcars)
citation("Biobase")
source('~/.active-rstudio-document', echo=TRUE)
txs.gr
source('~/.active-rstudio-document', echo=TRUE)
promoter.seq
source('~/.active-rstudio-document', echo=TRUE)
zld.motif <- "CAGGTAG"
counts.positive <- vcountPattern(zld.motif, promoter.seq, max.mismatch=1)
counts.negative <- vcountPattern(zld.motif, reverseComplement(promoter.seq), max.mismatch=1)
mcols(txs.gr)$zld_motif_count <- counts.positive + counts.negative
txs.df <- as.data.frame(txs.gr)
txs.df <- txs.df[order(txs.df$gene_id, txs.df$zld_motif_count, decreasing=TRUE), ]
genes.df <- txs.df[!duplicated(txs.df$gene_id), ]
head(genes.df)
nrow(genes.df)
length(unique(genes.df$gene_id))
