Skip to content

Instantly share code, notes, and snippets.

@tgirke
Last active April 11, 2021 23:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tgirke/df6fe20c2e42e71a7ade04941d4a05e9 to your computer and use it in GitHub Desktop.
Save tgirke/df6fe20c2e42e71a7ade04941d4a05e9 to your computer and use it in GitHub Desktop.
Motif enrichment for ChIP-Seq
###############################
## PWM matching in sequences ##
###############################
## Date: May 22, 2020
## Starter code for ChIP-Seq1 project
library(MotifDb)
as.list(query(MotifDb, 'athaliana'))
as.list(query(MotifDb, 'hsapiens'))
chr <- DNAStringSet(c(seq1="AAAGCTAAAGGTAAAGCAAAACGCCGCCG", seq2="CGCCGCCG"))
pwm <- as.list(query(MotifDb, 'athaliana'))[[1]]
sapply(chr, function(x) matchPWM(pwm, x, min.score="90%"))
##########################
## Matches among motifs ##
##########################
library(MotIV)
?motifMatch
egr1.motif <- MotifDb[egr1.mouse.jaspar.rows]
ts <- motifMatch(as.list (pwm), as.list (pwm), top=11)
#####################################
## Motif enrichment with PWMEnrich ##
#####################################
## see here: http://bioconductor.org/packages/release/bioc/vignettes/PWMEnrich/inst/doc/PWMEnrich.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment