wow!! this is working perfectly. Thank you so much!
I'd like to download bed file (annotation) like IGV tools have,
If I choose Human hg19 reference from IGV. It is automatically set all annotation tracks.
I downloaded one from below location, http://genome.ucsc.edu/cgi-bin/hgTables?command=start
However, Name is not exactly what I wanted.
For example, I am searching MHC region HLA-A genes. If I search IGV annotation it shows exactly HLA-A.
However, my downloaded bed file show "NM_001242758" instead of HLA-A.
Could someone knows how I can download that HLA-A name?
Please refer to below image.
Thank you so much
1 answer
This information is in the name2 field of the refGene table for hg19. Here is a command to swap the name column with the name2 column and get a bed file with the "right" name for IGV:
$ mysql -h genome-mysql.soe.ucsc.edu -ugenomep -ppassword -Ne "select * from refGene where name2='HLA-A'" hg19 | cut -f2- | awk '{t=$1; $1=$12; $12=t; print}' | genePredToBed stdin stdout
chr6 29910246 29913661 HLA-A 0 + 29910330 29913232 0 8 157,270,276,276,117,33,48,434, 0,287,798,1652,2030,2589,2764,2981,
...
When the Table Browser outputs a BED file, the information in the name2 field is lost as it isn't a standard BED field, which is why your output looks incorrect when loaded in IGV.
If you have further questions about the UCSC Genome Browser or our utilites or data, feel free to send an email to one of mailing lists below:
- genome@soe.ucsc.edu for general questions (public list)
- genome-www@soe.ucsc.edu for question concerning private data (private list)
- genome-mirror@soe.ucsc.edu for questions concerning the setup and running of your own UCSC Genome Browser installation
ChrisL from the UCSC Genome Browser
Just for other people information, They need to download "genePredToBed" in http://hgdownload.cse.ucsc.edu/admin/exe/linux.x86_64 location.
Log in to answer this question.
and which parameters did you use ?
Thank you for your reply! Please check below parameter, genome : Human, assembly: hg19, group : Genes and Gene Predictions, track : RefSeq Genes, table : refGene, output format : bed file, region : genome.
You are probably looking for a GTF file, not a BED file. It will give you more info (for example, both name and ID).
Thank you! I will look into it.