<p>You never want to include the hgsid parameter in your url because that is the link to your current browsing session and all its specific contents. So if you send that link to someone else and then they start browsing around that link may not work correctly again in the future if you or the person you sent the link to modify your browsing session.</p>

<p>As to how to create links to hgc pages, the usually follow a somewhat general format:
<a href="http://genome-euro.ucsc.edu/cgi-bin/hgc?db=hg19&amp;c=chr2&amp;o=242498135&amp;t=242513546&amp;g=gtexGene&amp;i=BOK" rel="nofollow noreferrer">http://genome-euro.ucsc.edu/cgi-bin/hgc?db=hg19&amp;c=chr2&amp;o=242498135&amp;t=242513546&amp;g=gtexGene&amp;i=BOK</a></p>

<p>You need the db and g parameters to specify the assembly build and track, and then you need to provide the position in the form of the c,o and t parameters. The last thing you want is the i paramter to specify the item name. The reason the i parameter alone is not enough is because we do not require uniqueness on item names (there may be many copies of an item across the genome for instance).</p>

<p>You can obtain the c, o, t and i parameters by selecting the chrom, chromStart, chromEnd and name fields from the gtexGene table:</p>

<pre><code>$ mysql --user=genome --host=genome-mysql.soe.ucsc.edu -A -P 3306 -e "select chrom, chromStart, chromEnd, name from gtexGene limit 1" hg38
+-------+------------+----------+---------+
| chrom | chromStart | chromEnd | name    |
+-------+------------+----------+---------+
| chr1  |      11868 |    13052 | DDX11L1 |
+-------+------------+----------+---------+
</code></pre>

CC BY-SA 3.0
2018-02-21T17:13:24.683Z
Great, thank you. Is the link matching on the positions from `c,o,t` parameters or by the name `i=BOK`? In other words can that `c,o,t` region be wider than the gene size, meaning look in this wider region for gene named BOK?
zx8754
CC BY-SA 3.0
2018-02-21T17:14:48.293Z
By the way, what does `c, o, t` stand for, c=chromosome?
zx8754
CC BY-SA 3.0
2018-02-21T17:18:25.400Z
OK, just tested, `c,o,t` must match with gene positions. :(
zx8754
CC BY-SA 3.0
2018-02-21T17:08:45.087Z
2018-02-21T17:08:45.087Z
Christopher Lee
<p>I have this link that comes up when I am in the browser window and click on the gene name, which leads me to description page about the gene (in this example it is BOK gene).</p>

<p>How can I generate that link? Below are some of my failed attempts. There is a <a href="https://genome.ucsc.edu/FAQ/FAQlink.html" rel="nofollow noreferrer">UCSC FAQ page about the links</a>, didn't help much, maybe I am reading it wrong.</p>

<p>Link that works, generated when clicked on gene on the website:</p>

<p><a href="http://genome-euro.ucsc.edu/cgi-bin/hgc?hgsid=226968178_C6XmUjsjtt3Mm9fOmePo6VqRN6TV&amp;c=chr2&amp;l=241667282&amp;r=242920780&amp;o=242498135&amp;t=242513546&amp;g=gtexGene&amp;i=BOK" rel="nofollow noreferrer">http://genome-euro.ucsc.edu/cgi-bin/hgc?hgsid=226968178_C6XmUjsjtt3Mm9fOmePo6VqRN6TV&amp;c=chr2&amp;l=241667282&amp;r=242920780&amp;o=242498135&amp;t=242513546&amp;g=gtexGene&amp;i=BOK</a></p>

<p>Which gives me this page:
<a href="https://i.sstatic.net/OfI7M.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/OfI7M.png" alt="enter image description here"></a></p>

<p>My failed attempts to generated custom link:</p>

<p><a href="http://genome-euro.ucsc.edu/cgi-bin/hgTracks?db=hg19&amp;position=chr2%3A241667283-242920780&amp;gtexGene&amp;i=BOK" rel="nofollow noreferrer">http://genome-euro.ucsc.edu/cgi-bin/hgTracks?db=hg19&amp;position=chr2%3A241667283-242920780&amp;gtexGene&amp;i=BOK</a></p>

<p><a href="http://genome.ucsc.edu/cgi-bin/org=human&amp;db=hg19&amp;gtexGene&amp;i=BOK" rel="nofollow noreferrer">http://genome.ucsc.edu/cgi-bin/org=human&amp;db=hg19&amp;gtexGene&amp;i=BOK</a></p>

<p><a href="http://genome.ucsc.edu/cgi-bin/gtexGene?org=human&amp;db=hg19&amp;i=BOK" rel="nofollow noreferrer">http://genome.ucsc.edu/cgi-bin/gtexGene?org=human&amp;db=hg19&amp;i=BOK</a></p>

<p><a href="http://genome.ucsc.edu/cgi-bin/gtexGene?org=human&amp;db=hg19&amp;hgg_gene=BOK" rel="nofollow noreferrer">http://genome.ucsc.edu/cgi-bin/gtexGene?org=human&amp;db=hg19&amp;hgg_gene=BOK</a></p>

<p><a href="http://genome.ucsc.edu/cgi-bin/gtexGene?org=human&amp;db=hg19&amp;i=BOK" rel="nofollow noreferrer">http://genome.ucsc.edu/cgi-bin/gtexGene?org=human&amp;db=hg19&amp;i=BOK</a></p>

<p><a href="http://genome.ucsc.edu/cgi-bin/gtexGene?org=human&amp;db=hg19&amp;g=gtexGene&amp;i=BOK" rel="nofollow noreferrer">http://genome.ucsc.edu/cgi-bin/gtexGene?org=human&amp;db=hg19&amp;g=gtexGene&amp;i=BOK</a></p>

<p><a href="http://genome.ucsc.edu/cgi-bin/org=human&amp;db=hg19&amp;g=gtexGene&amp;i=BOK" rel="nofollow noreferrer">http://genome.ucsc.edu/cgi-bin/org=human&amp;db=hg19&amp;g=gtexGene&amp;i=BOK</a></p>

<p><a href="http://genome.ucsc.edu/cgi-bin/hgTracks?org=human&amp;db=hg19&amp;g=gtexGene&amp;i=BOK" rel="nofollow noreferrer">http://genome.ucsc.edu/cgi-bin/hgTracks?org=human&amp;db=hg19&amp;g=gtexGene&amp;i=BOK</a></p>

CC BY-SA 3.0
2018-02-21T13:49:39.323Z
The first one of your failed attempts work for me, but the returned page is different to the reference link. Could you clarify what is the expected result?
llrs
CC BY-SA 3.0
2018-02-21T13:52:50.927Z
@Llopis see screenshot, I just again tested all the links, no they don't work for me :(
zx8754
CC BY-SA 3.0
2018-02-21T14:16:03.810Z
I can't reproduce with the first and the last link (those with hgTracks). But the page is not like the screenshot. Maybe you (or your IP) hit an API limit ?
llrs
CC BY-SA 3.0
2018-02-21T14:18:22.527Z
@Llopis the first long link that was generated from website works for you?
zx8754
CC BY-SA 3.0
2018-02-21T14:19:39.227Z
Yes, the link with "hgsid=226968..." works for me too.
llrs
CC BY-SA 3.0
2018-02-21T14:20:52.203Z
Great, that is the page I want to be able to access by pasting together some bits, programmatically.
zx8754
CC BY-SA 3.0
2018-02-21T14:21:04.877Z
Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/73477/discussion-between-llopis-and-zx8754).
llrs
<gene><ucsc>
Link to UCSC gtexGene track description page for selected gene symbol
# Link to UCSC gtexGene track description page for selected gene symbol

(Asked by: username_0 on 2018-02-21)

I have this link that comes up when I am in the browser window and click on the gene name, which leads me to description page about the gene (in this example it is BOK gene).

How can I generate that link? Below are some of my failed attempts. There is a [UCSC FAQ page about the links](https://genome.ucsc.edu/FAQ/FAQlink.html), didn't help much, maybe I am reading it wrong.

Link that works, generated when clicked on gene on the website:

<http://genome-euro.ucsc.edu/cgi-bin/hgc?hgsid=226968178_C6XmUjsjtt3Mm9fOmePo6VqRN6TV&c=chr2&l=241667282&r=242920780&o=242498135&t=242513546&g=gtexGene&i=BOK>

Which gives me this page:
[![enter image description here](https://i.sstatic.net/OfI7M.png)](https://i.sstatic.net/OfI7M.png)

My failed attempts to generated custom link:

[http://genome-euro.ucsc.edu/cgi-bin/hgTracks?db=hg19&position=chr2%3A241667283-242920780&gtexGene&i=BOK](http://genome-euro.ucsc.edu/cgi-bin/hgTracks?db=hg19&position=chr2%3A241667283-242920780>exGene&i=BOK)

[http://genome.ucsc.edu/cgi-bin/org=human&db=hg19&gtexGene&i=BOK](http://genome.ucsc.edu/cgi-bin/org=human&db=hg19>exGene&i=BOK)

<http://genome.ucsc.edu/cgi-bin/gtexGene?org=human&db=hg19&i=BOK>

<http://genome.ucsc.edu/cgi-bin/gtexGene?org=human&db=hg19&hgg_gene=BOK>

<http://genome.ucsc.edu/cgi-bin/gtexGene?org=human&db=hg19&i=BOK>

<http://genome.ucsc.edu/cgi-bin/gtexGene?org=human&db=hg19&g=gtexGene&i=BOK>

<http://genome.ucsc.edu/cgi-bin/org=human&db=hg19&g=gtexGene&i=BOK>

<http://genome.ucsc.edu/cgi-bin/hgTracks?org=human&db=hg19&g=gtexGene&i=BOK>

**Tags:** gene, ucsc
> **Comments:**
> **username_1**: The first one of your failed attempts work for me, but the returned page is different to the reference link. Could you clarify what is the expected result?  
> **username_0**: @Llopis see screenshot, I just again tested all the links, no they don't work for me :(  
> **username_1**: I can't reproduce with the first and the last link (those with hgTracks). But the page is not like the screenshot. Maybe you (or your IP) hit an API limit ?  
> **username_0**: @Llopis the first long link that was generated from website works for you?  
> **username_1**: Yes, the link with "hgsid=226968..." works for me too.  
> **username_0**: Great, that is the page I want to be able to access by pasting together some bits, programmatically.  
> **username_1**: Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/73477/discussion-between-llopis-and-zx8754).  

---

## 1 answers

### Answer by username_2 on 2018-02-21. Score: 2 | Accepted answer

You never want to include the hgsid parameter in your url because that is the link to your current browsing session and all its specific contents. So if you send that link to someone else and then they start browsing around that link may not work correctly again in the future if you or the person you sent the link to modify your browsing session.
As to how to create links to hgc pages, the usually follow a somewhat general format:
http://genome-euro.ucsc.edu/cgi-bin/hgc?db=hg19&c=chr2&o=242498135&t=242513546&g=gtexGene&i=BOK
You need the db and g parameters to specify the assembly build and track, and then you need to provide the position in the form of the c,o and t parameters. The last thing you want is the i paramter to specify the item name. The reason the i parameter alone is not enough is because we do not require uniqueness on item names (there may be many copies of an item across the genome for instance).
You can obtain the c, o, t and i parameters by selecting the chrom, chromStart, chromEnd and name fields from the gtexGene table:
$ mysql --user=genome --host=genome-mysql.soe.ucsc.edu -A -P 3306 -e "select chrom, chromStart, chromEnd, name from gtexGene limit 1" hg38
+-------+------------+----------+---------+
| chrom | chromStart | chromEnd | name    |
+-------+------------+----------+---------+
| chr1  |      11868 |    13052 | DDX11L1 |
+-------+------------+----------+---------+

> **Comments:**
> **username_0**: Great, thank you. Is the link matching on the positions from `c,o,t` parameters or by the name `i=BOK`? In other words can that `c,o,t` region be wider than the gene size, meaning look in this wider region for gene named BOK?  
> **username_0**: By the way, what does `c, o, t` stand for, c=chromosome?  
> **username_0**: OK, just tested, `c,o,t` must match with gene positions. :(  

---

