The Entrez Programming Utilities are a interface to Entrez query and database system at the National Center for Biotechnology Information (NCBI). With E-Utilities, we can write programs to query NCBI databases. Since the interface is a fixed URL syntax, we can query NCBI databases in any programming language. Here we demo a Perl script to query PubMed and filter the result with regular expression.
The program is placed on Github. If you are interested in the script, you may follow the script on Github. The program is inspared by the post by cfrenz. You may also check the original script there.
Basically, there are two steps:
Query PubMed with esearch to get essential parameters like query key, webdev and maximal result count.
Query PubMed in batch mode with efetch.
Here we use Mojo::UserAgent to do the HTTP GET action. The first step is like this:
After getting the parameters, do next step like this:
I tried Mojo::DOM but the speed was not acceptable due to the volume of data. Therefore, I shifted to regular expression. Although regular expression is not a real parsing tool, its speed is satisfactory. I tried BioPerl but it failed to work. Therefore I re-writed the query by myself. You may try E-Utilities and work out your own scripts.