This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Fetch MeSH terms list (or any other topic-specific "tags", if MeSH is unavailable) for PubMed paper

SOLVED

Is it possible to fetch a MeSH terms list for any submitted PubMed ID?

What I want to do is an analysis on all of the object-specific search tags (e.g., MeSH terms) which are assigned to any PubMed paper. The problem is - I couldn't find any method to retrieve tag lists themselves - using direct Etools requests, BioPython or BioPerl (though tags in question are perfectly visible on any actual PubMed paper annotation webpage). Unfortunately, these tags are not included in "full article data", which is perfectly fetchable using Etools.

So, for example, I need to:

1) get all papers which were assigned MeSH term "Protozoan";

2) fetch all MeSH (or other object-related) terms which were assigned to every paper from step 1.

Thank you!

mesh entrez etools pubmed

1 answer

It's a matter of constructing the right E-utilities query URL e.g.
https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=Protozoan%20*[MESH]
Note that there's no term 'Protozoan' alone. You could get a paper using its PMID like this:
https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&id=12407413&&rettype=abstract&retmode=xml
then parse the XML to recover the MeSH fields.
Have a look at examples on how to automate queries using perl here. Make sure you don't hammer the NCBI server with your requests otherwise you (and possibly also your institution) will be banned.

Wow thank you very much! That's exactly what I need; problem solved.

Funny thing that your url request has slightly different structure than mine, and fetches more data. Is that because of rettype/retmode, or newer eutils url (I did put "eutils" after ncbi url, as per their starter manuals, and didn't specify rettype)?

It's possible that type/mode does something because I think the default is to limit to 10 or 20 records.

Log in to answer this question.