pubmed-pairs: Search PubMed for each pair of terms from two lists

·292 words·2 mins

Searching PubMed is my favorite way to find biomedical research about any topic. But sometimes I want to explore complicated queries. For example, how many papers have been published about a combination of multiple topics? This post explains one way to do that.

Background
#

I’m very interested in viruses and bacteria.

I’m also interested in specific genes like HLA-DQB1 and IL6.

So, I’m curious to know how many papers have been published about:

  • virus AND HLA-DQB1
  • bacteria AND HLA-DQB1
  • virus AND IL6
  • bactetria IL6

Seeing the number of publications can be informative. If there are a lot of papers that match virus AND IL6, but fewer papers that match virus AND HLA-DQB1, then that tells me something about the landscape of current research.

If we have two lists:

  • ["virus"]
  • ["GENE1", "GENE2", "GENE3", "GENE4"]

And if we have an app that can automatically search all pairwise combinations of the two lists, then we can quickly get some sense of how much is known about each gene in the context of viruses.

Using Javascript to make a simple app
#

I know PubMed has an excellent API, as do all of the NCBI tools.

So, I wrote a minimal client-side app that uses about 200 lines of Javascript to query the PubMed API.

The app takes two lists of search terms, generates all of the pairwise combinations of terms to make a list of queries, and automatically searches PubMed for each query.

Here is an animation that shows how the app works:

Try searching on pubmed-pairs
#

You can try the app yourself at pubmed-pairs

The source code is available if you want to play around with it:

Reply by Email
Kamil Slowikowski
Author
Kamil Slowikowski
Computational biologist at Mass General Brigham.