Question: How To Fetch A Gene By Exact Hgnc Gene Symbol With Eutils?
gravatar for Reece
6.9 years ago by
United States
Reece270 wrote:

I'd like to fetch genes solely by official HGNC gene symbol.

Eutils appears to search aliases in addition to the official symbol. Does anyone know how to restrict this search solely to gene symbol?

For example:

curl -g '[Gene+Name])+AND+human[Organism]'

returns (edited):


9588 is PRDX6, which has PRX as an alias.

57716 is PRX, the gene I searched for.

I've also tried adding PRX[title] to the query, but that is not sufficient.

I'm currently fetching both and filtering on the xpath expression /Entrezgene-Set/Entrezgene/Entrezgene_gene/Gene-ref/Gene-ref_locus/text(), but that seems silly.

Is there a better way?



ncbi eutils • 2.5k views
ADD COMMENTlink modified 6.9 years ago by Neilfws48k • written 6.9 years ago by Reece270
gravatar for Neilfws
6.9 years ago by
Sydney, Australia
Neilfws48k wrote:

You can try the qualifier [PREF] which is "Preferred symbol of the gene."

Here's what I got using the BioRuby implementation of EUtils:

require 'bio'
Bio::NCBI.default_email = ""
ncbi   =
search = ncbi.esearch("PRX[GENE] AND Homo+sapiens[ORGN]", {"db" => "gene", "retmax" => 200})
=> ["9588", "57716"]
search = ncbi.esearch("PRX[PREF] AND Homo+sapiens[ORGN]", {"db" => "gene", "retmax" => 200})
=> ["57716"]


for a full list of qualifiers that can be supplied to query the Gene database.

ADD COMMENTlink written 6.9 years ago by Neilfws48k

Yep, that solves it. Thanks!

ADD REPLYlink written 6.9 years ago by Reece270
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1916 users visited in the last hour