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.
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.
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.
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
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.