This is a test version of Biostars. For the public version, visit https://www.biostars.org.
retrieving only one result using entrez direct

Hi all, I'm retrieving proteins using entrez direct esearch. My search words retrieve many proteins, and I only need the first few results. I could do this with bash, but it takes time to retrieve all the results and I would like to know if there is a way to do it with esearch.

 esearch -db protein -query rubisco | efetch -format fasta
edirect ncbi

2 answers

Add -stop 5 to your efetch to limit to 5 hits.

https://www.ncbi.nlm.nih.gov/books/NBK179288/

-retmax 1

This:

esearch -db protein -query rubisco | efetch -retmax 5 -format fasta

doesn't work. I get the efetch error message saying that retmax is an unknown option. Thanks!

Thanks, but I get a similar error message saying that this is not a valid parameter for esearch.

Log in to answer this question.