text: user39: I am interested in determining if any transcription factor binding site motifs are enriched in some BED files from a DNA methylation experiment.
  I am looking for a database that has BED Files containing regions enriched for specific transcription factor binding motifs in homo sapiens.
  I know that JASPAR contains TFBS motifs, but I can't find a download for regions of hg19 that are enriched with those motifs.
  EDIT:  I suppose I could determine TF motif enriched regions using HOMER if there are no curated databases with this information, but I would rather not.  Your help is appreciated!
  
  user776: You could make your own such file with FIMO, the JASPAR MEME files available via the MEME download site, and your genome build of interest (per-chromosome FASTA files from UCSC goldenpath, say), e.g., for assembly hg19 and UCSC chromosome naming scheme:
  $ for chr in `seq 1 22` X Y; do echo ${chr}; wget -qO- http://hgdownload.cse.ucsc.edu/goldenpath/hg19/chromosomes/chr${chr}.fa.gz | gunzip -c - > hg19.chr${chr}.fa; done
  
  For each chromosome (omitting the for loop code for brevity), you can use the fasta-get-markov in the MEME suite to generate a 5th-order Markov model of kmer frequencies:
  $ fasta-get-markov -m 5 hg19.chr${chr}.fa > hg19.chr${chr}.5th_order_background_model.txt
  
  Here is one way to download a non-redundant, vertebrate JASPAR database (MEME-formatted):
  $ wget http://jaspar.genereg.net/download/CORE/JASPAR2020_CORE_vertebrates_non-redundant_pfms_meme.txt
  
  To run a FIMO query with the 5th-order background model and JASPAR database, using a p-value threshold of 1e-4:
  $ fimo --verbosity 1 --bgfile hg19.chr${chr}.5th_order_background_model.txt --thresh 1e-4 --text JASPAR2018_CORE_vertebrates_non-redundant_pfms_meme.txt hg19.chr${chr}.fa \
    | tail -n+2 \
    | awk -vOFS="\t" -vFS="\t" '{ print $3, $4, $5, $1":"$2">"$10, $8, $6 }' \
    | sort-bed - \
    | starch --omit-signature - \
    > hg19.chr${chr}.bed.starch
  
  The output of a FIMO search is a text file which can be modified into a sorted BED file via sort-bed, an example of which is shown above.
  To get a faster answer, each per-chromosome query can be put onto its own node on a computational cluster.
  Using a p-value threshold of 1e-4 will result in very large files (when uncompressed). Using tools to compress BED files is useful here. Use of BEDOPS starch to compress BED files (as shown above, for instance) will give better compression performance than bgzip with per-chromosome random access and integration with BEDOPS bedops and bedmap CLI tools. The bgzip option offers integration with tabix and offers finer-grained random access, but it will use more disk space and doesn't integrate with BEDOPS tools.
  
original_text: 39: <p>I am interested in determining if any transcription factor binding site motifs are enriched in some BED files from a DNA methylation experiment.</p>
  
  <p>I am looking for a database that has BED Files containing regions enriched for specific transcription factor binding motifs in homo sapiens.</p>
  
  <p>I know that JASPAR contains TFBS motifs, but I can't find a download for regions of hg19 that are enriched with those motifs.</p>
  
  <p>EDIT:  I suppose I could determine TF motif enriched regions using HOMER if there are no curated databases with this information, but I would rather not.  Your help is appreciated!</p>
   776: <p>You could make your own such file with <a href="http://meme-suite.org/doc/fimo.html" rel="nofollow noreferrer">FIMO</a>, the <a href="http://meme-suite.org/db/motifs" rel="nofollow noreferrer">JASPAR</a> MEME files available via the <a href="http://meme-suite.org/doc/download.html?man_type=web" rel="nofollow noreferrer">MEME download site</a>, and your genome build of interest (per-chromosome FASTA files from UCSC goldenpath, say), e.g., for assembly <code>hg19</code> and UCSC chromosome naming scheme:</p>
  <pre><code><span class="math-container">$ for chr in `seq 1 22` X Y; do echo $</span>{chr}; wget -qO- http://hgdownload.cse.ucsc.edu/goldenpath/hg19/chromosomes/chr<span class="math-container">${chr}.fa.gz | gunzip -c - &gt; hg19.chr$</span>{chr}.fa; done
  </code></pre>
  <p>For each chromosome (omitting the <code>for</code> loop code for brevity), you can use the <code>fasta-get-markov</code> in the MEME suite to generate a 5th-order Markov model of kmer frequencies:</p>
  <pre><code><span class="math-container">$ fasta-get-markov -m 5 hg19.chr$</span>{chr}.fa &gt; hg19.chr${chr}.5th_order_background_model.txt
  </code></pre>
  <p>Here is one way to download a <a href="http://jaspar.genereg.net/downloads/" rel="nofollow noreferrer">non-redundant, vertebrate JASPAR database</a> (MEME-formatted):</p>
  <pre><code>$ wget http://jaspar.genereg.net/download/CORE/JASPAR2020_CORE_vertebrates_non-redundant_pfms_meme.txt
  </code></pre>
  <p>To run a FIMO query with the 5th-order background model and JASPAR database, using a p-value threshold of 1e-4:</p>
  <pre><code><span class="math-container">$ fimo --verbosity 1 --bgfile hg19.chr$</span>{chr}.5th_order_background_model.txt --thresh 1e-4 --text JASPAR2018_CORE_vertebrates_non-redundant_pfms_meme.txt hg19.chr<span class="math-container">${chr}.fa \
    | tail -n+2 \
    | awk -vOFS="\t" -vFS="\t" '{ print $3, $4, $5, $1":"$2"&gt;"$10, $8, $6 }' \
    | sort-bed - \
    | starch --omit-signature - \
    &gt; hg19.chr$</span>{chr}.bed.starch
  </code></pre>
  <p>The output of a FIMO search is a text file which can be modified into a sorted BED file via <a href="https://bedops.readthedocs.io/en/latest/content/reference/file-management/sorting/sort-bed.html" rel="nofollow noreferrer">sort-bed</a>, an example of which is shown above.</p>
  <p>To get a faster answer, each per-chromosome query can be put onto its own node on a computational cluster.</p>
  <p>Using a p-value threshold of 1e-4 will result in very large files (when uncompressed). Using tools to compress BED files is useful here. Use of <a href="https://bedops.readthedocs.io/en/latest/content/reference/file-management/compression/starch.html" rel="nofollow noreferrer">BEDOPS <code>starch</code></a> to compress BED files (as shown above, for instance) will give better compression performance than <code>bgzip</code> with per-chromosome random access and integration with BEDOPS <code>bedops</code> and <code>bedmap</code> CLI tools. The <code>bgzip</code> option offers integration with <code>tabix</code> and offers finer-grained random access, but it will use more disk space and doesn't integrate with BEDOPS tools.</p>
  