Hints and pseudo code for Exercise 6.6.1 (Lord of the Fruit Flies)
Identify how many papers in the PubMed database have the words Drosophila virilis in their title or abstract. Use the
usehistoryargument so you can refer to this search in the next step.
Hints: you can use the functuion
Entrezmodule of the
usehistory = yallows you to refer to the query in the next step.
from Bio import Entrez import re Entrez.email = "your email here" # create a handle handle = Entrez.esearch(your code here) # now retrieve the records record = Entrez.read(handle)
Retrieve the PubMed entries.
Hints: you can use the function
Entrez.efetchto retrieve the records. Write the results to the file
Count the number of contributions per author.
Hints: use regular expressions to extract the author names, and count them.
Identify the five authors with the most contributions.
Hints: you can try using the function
sortedfor this task.