Closed AdeFouchier closed 1 year ago
A little break and a different approach in searching a solution to my problem allowed to find what I needed.
You should add a "sort = relevance" argument to the entez_search.
rentrez::entrez_search(db = "pccompound",
term = "linalool",
sort = "relevance",
retmax = 99999)$ids
# Best match (cid : 6549) appearing last
I'm trying to look for compounds in pccompound.
When I'm searching via the webinterface, it seems that results are sorted by "plausibility", at least the best match appear as the first.
Using entrez_search , the ids appears to sorted in a different way, probably by decreasing numerical value.
Is there any way to obtain the ids sorted with the best match being the fist id in the ids vector ?
Reproducible example :
https://www.ncbi.nlm.nih.gov/pccompound/?term=linalool Best match (cid : 6549) appearing first