sh
bedtools getfasta -fi Share/genome/ce11.fa -bed Share/modENCODE/xnd-1.bed -name > xnd-1.faxnd-1 ChIP-seqmeme website to identify which tool is best suited to identify a motif de novo in a set of peaks from a ChIP-seq experiment.xstreme on a set of peaks?meme inputExtract the genomic sequences for XND-1 peaks using bedtools getfasta.
sh
bedtools getfasta -fi Share/genome/ce11.fa -bed Share/modENCODE/xnd-1.bed -name > xnd-1.fameme
Identify motifs enriched in xnd-1 peaks with xstreme using the following options:
meme
meme
meme
streme motifssh
xstreme \
--p xnd-1.fa \
--oc meme_out/ \
-minw 12 \
-maxw 16 \
--meme-nmotifs 3 \
--meme-p 12 \
--meme-mod zoops \
--streme-nmotifs 0ce11 regulatory elements for de novo motifsce11 tissue-specific regulatory element annotations, as done in the previous lab.r
library(rtracklayer)
library(GenomicRanges)
REs <- readxl::read_xlsx('Share/Celegans/WBcel235_REs.xlsx', skip = 2, col_names = TRUE)
REs <- makeGRangesFromDataFrame(
REs, seqnames.field = 'chrom_ce11',
start.field = 'start_ce11', end.field = 'end_ce11',
keep.extra.columns = TRUE
)xnd-1 motif found by XSTREME in R using universalmotif package.r
library(universalmotif)
xnd1_motifs <- read_meme('Share/Celegans/meme_out/xstreme.txt')
names(xnd1_motifs) <- c('motif1', 'motif2', 'motif3')motifmatchr::matchMotifs() documentation.xnd1- motifs to PFMatrixList class.xnd-1 motifs to regulatory elements.r
library(motifmatchr)
library(BiocParallel)
library(TFBSTools)
register(MulticoreParam(workers = 2, progressbar = TRUE))
xnd1_motifs_pfm <- map(xnd1_motifs, convert_motifs, "TFBSTools-PFMatrix") |> do.call(PFMatrixList, args = _)
motif_mappings <- matchMotifs(xnd1_motifs_pfm, REs, genome = BSgenome.Celegans.UCSC.ce11::BSgenome.Celegans.UCSC.ce11)
class(motif_mappings)
dim(motif_mappings)xnd-1 first motif over Intestine-specific regulatory elements.xnd-1 motif enriched in Intestine-specific regulatory elements?r
has_xnd1 <- motifMatches(motif_mappings)[, 'motif1']
is_intestine <- REs$Annotation == 'Intest.'
tab <- table(is_intestine, has_xnd1)
fisher_test <- fisher.test(tab)
fisher_testxnd-1 motif enriched in Germline-specific regulatory elements?r
has_xnd1 <- motifMatches(motif_mappings)[, 'motif1']
is_germline <- REs$Annotation == 'Germline'
tab <- table(is_germline, has_xnd1)
fisher_test <- fisher.test(tab)
fisher_testr
library(purrr)
library(broom)
groups <- c("Hypod.", "Muscle", "Intest.", "Neurons", "Germline", "Soma", "Ubiq.")
pvals <- map_dfr(names(xnd1_motifs_pfm), function(motif) {
map_dfr(groups, function(group) {
tab <- table(REs$Annotation == group, motifMatches(motif_mappings)[, motif])
ftest <- fisher.test(tab) |>
tidy() |>
mutate(motif = motif, group = group) |>
dplyr::select(group, motif, estimate, p.value)
})
})
filter(pvals, p.value < 0.01, estimate > 2) |> print(n = 40)