Get gene exons from UCSC browser by HGNC name I have a set of gene names in HGNC standard and I want to get all their exons (in BED format) from the UCSC browser but it seems like the browser doesn't index genes by their HGNC name. How can I do that?
You could grab exons via Gencode v27 (hg38) GFF annotations and convert them to BED via BEDOPS convert2bed/gff2bed:

$ wget -qO- ftp://ftp.sanger.ac.uk/pub/gencode/Gencode_human/release_27/gencode.v27.annotation.gff3.gz \
    | gunzip --stdout - \
    | awk '$3 == "exon"' \
    | convert2bed -i gff - \
    &gt; exons.bed


Then use grep to filter exons against your list of gene names:

$ grep -w -f hgnc.txt exons.bed &gt; exons.filtered.bed