How to get coordinates from UCSC Genome Browser
2
0
Entering edit mode
9.0 years ago
fk566938 ▴ 10

Hello, I am trying to get coordinates for a gene on the ucsc genome browser. I have zoomed in but once you zoom in by holding shift and click it can only zoom in so much.

coordinates ucsc genome browser • 4.2k views
ADD COMMENT
3
Entering edit mode
9.0 years ago

You can do a mysql query of the UCSC Genome Browser for a specific gene and build, e.g., human "CTCF":

$ gene="ctcf"
$ mysql --user=genome --host=genome-mysql.cse.ucsc.edu -A -N -e "SELECT k.chrom, kg.txStart, kg.txEnd, x.geneSymbol FROM knownCanonical k, knownGene kg, kgXref x WHERE k.transcript = x.kgID AND k.transcript = kg.name AND x.geneSymbol LIKE '${gene}';" hg19
+-------+----------+----------+------+
| chr16 | 67596309 | 67673088 | CTCF |
+-------+----------+----------+------+

Just replace the value of gene with your gene-of-interest, and modify the build (hg19) if you're interested in a different reference genome or organism.

Some genes have more than one transcript. You can add LIMIT 1 to the SQL query to just grab the first hit:

$ mysql --user=genome --host=genome-mysql.cse.ucsc.edu -A -N -e "SELECT k.chrom, kg.txStart, kg.txEnd, x.geneSymbol FROM knownCanonical k, knownGene kg, kgXref x WHERE k.transcript = x.kgID AND k.transcript = kg.name AND x.geneSymbol LIKE '${gene}' LIMIT 1;" hg19

Or you could post-process the query output with awk or similar to get the first result's start and last result's end coordinates, to get the overall interval of the gene.

ADD COMMENT
1
Entering edit mode
9.0 years ago
5utr ▴ 370

When you enter the gene name genome browser offers you with a list of genes and transcripts that match your query, each one has the coordinates for the assembly that you selected.

Alternatively you can go to Table browser and download a flat table that you can customize: https://genome.ucsc.edu/cgi-bin/hgTables?hgsid=454971717_SwAPqe5Nq2wP5DA8laA6PO1XcxiE

ADD COMMENT

Login before adding your answer.

Traffic: 1750 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6