gravatar for Alex Reynolds

38 minutes ago by

Seattle, WA USA

A good, generic way to do this is to get the fetchChromSizes tool from the UCSC Kent utilities kit:

$ fetchChromSizes hg19 | awk -v FS="t" -v OFS="t" '{ print $1, "0", $2; }' | sort-bed - > hg19.bed

You can use this for hg19, hg38, mm10, etc. Just swap out the assembly name.

Using BEDOPS sort-bed will give you a sorted, 0-indexed BED file ready for set operations.



Source link