This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Pulling all DNAse HS sites from ENCODE

I am trying to download a .bed file containing all sites from the ENCODE/UCSC table wgEncodeAwgDnaseMasterSites. However, for each DNAse hypersensitivity site, I also want the flanking 1000 basepairs. Is it possible to do this via the Table browser?

encode

Your question is not entirely clear to me, do you want a bed file with coordinates extended by 1000 basepairs or the sequences?

1 answer

Here's how to get the coordinates for one chromosome:

$ mysql -h genome-mysql.cse.ucsc.edu -u genome -D hg19 -N -A -e 'select chrom, chromStart, chromEnd from wgEncodeAwgDnaseMasterSites where chrom like "chrX"' > wgEncodeAwgDnaseMasterSites.chrX.bed

Once you have coordinates, you can pad them with basic set operations. For example:

$ bedops --range 1000 --everything wgEncodeAwgDnaseMasterSites.chrX.bed > wgEncodeAwgDnaseMasterSites.chrX.1k_pad.bed

You could use bash to write a loop to write out BED files for each chromosome and apply padding operations:

$ for chr in `seq 1 22` X Y; do echo $chr; ... ; done

Replace ... with relevant commands and variable placeholders.

Log in to answer this question.