UPDATE: Genecards recently introduced an explicit policy asking to do not use automated scraping tool. While the provided solution will (probably) still work for a single entry, multiple queries may be blocked and represents a policy violation.
Hi guys, GeneCards is one of the most comprehensive repository for gene info. While doing RNA-seq analysis, the common task to convert Ensembl geneID to Entrez ID with tools like BiomaRt may leave lots of genes without a corresponding Entrez number.
Although much of the losses are from pseudogenes or very poor characterized genes, someone may be interested to evaluate this loss, expecially if some of the lost genes populate the DEG list.
I've written this quick script in Python to query GeneCards to retain info about these uncharacterized genes. Please keep in mind that this must not be intended as a replacement for BiomaRt or other tools: GeneCards implements a protection against automatic queries and so would be impossible to assign correspondant ID to every gene in your analysis. I've made some tests with list of 150-200 genes and it seems to be ok. If you keep displaying the same error, consider to run a smaller gene list.
It can be run in a gene list mode, --list
, where a file composed by 1 Ensembl geneID per line will be submitted, or in a single gene mode, --gene
, passing a single ensembl geneID.
I'm working to bypass the website protection while minimizing the impact on users. Any suggestion are welcome.
Code -->
Requires BeautifulSoup
Genecards added a footer saying that
While this is just a crappy script and surely LLM competitors already scraped the whole database, consider using other sources.
Do you have any recommendations of such sources or how to search for them? I'm a newbie and I need to convert GRCh38 Ensembl IDs to Entrez IDs. I thought that such list should already exist somewhere (it's a human genome after all) but I can't find any to my surprise.
I already tried g:Profiler, BioMart and gget, but they only give me partial results
In this location there is an "entrez" file which maps ensembl IDs to Entrez. It's probably as definitive as you're going to find:
https://ftp.ensembl.org/pub/release-111/tsv/homo_sapiens/
It is possible that not every Ensembl ID is going to convert to Entrez ID.
Have you tried:
Ensembl ID to ENTREZ best converter
Tried it just recently with almost the same results. 456 out of 496 IDs for protein-coding genes returned as "NA" even though I can see NCBI IDs for these genes on GeneCards T_T
I think I'll try to convert Ensembl IDs to HGNC IDs and then will try to use HGNC API to convert them further.
Please edit your original post and add this at the top so everyone reads that first. GeneCards politely asks people not to scrape - not respecting that will get them to use more extreme measures so most users will suffer.