Skip to content

Instantly share code, notes, and snippets.

@nkrumm
Created March 10, 2015 23:08
Show Gist options
  • Select an option

  • Save nkrumm/c6b15a7295037ccb0e67 to your computer and use it in GitHub Desktop.

Select an option

Save nkrumm/c6b15a7295037ccb0e67 to your computer and use it in GitHub Desktop.
Convert RefFlat genes to exon list
curl -s "http://hgdownload.cse.ucsc.edu/goldenPath/hg19/database/refFlat.txt.gz" \
| gunzip -c \
| awk '{n=int($9); split($10,S,/,/);split($11,E,/,/); for(i=1;i<=n;++i) {printf("%s\t%s\t%s\t%s\n",$3,S[i],E[i],$1);} }' \
> refFlat.exons.hg19.bed
bedtools sort -i refFlat.exons.hg19.bed > refFlat.exons.hg19.sorted.bed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment