Biopython Entrez Esearch FILTER
1
0
Entering edit mode
5.4 years ago
maxininfa • 0

Hi,

I want to make a seach using Biopython's Entrez API, i have the following code:

handle = Entrez.esearch(db='pubmed', 
                                sort='relevance', 
                                retmax='20',
                                retmode='xml',
                                term=name+" AND "+nombre)

That works fine, but if I try to add a filter, such as "has abstract"[FILT] like this:

term=name+" AND "+nombre+" AND has abstract"[FILT])

I get an error.

The syntax seems "fine" both pubmed's and python's. But maybe I'm awfully wrong, can you help? Thanks!!

Just in case (running python):

Python 2.7.15 |Anaconda, Inc.| (default, May  1 2018, 23:32:55) 
[GCC 7.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from Bio import Entrez
>>> Entrez.email = 'myemail@bla.com'
>>> handle = Entrez.einfo(db="pubmed")
>>> record = Entrez.read(handle)
>>> record["DbInfo"].keys()
[u'Count', u'LastUpdate', u'MenuName', u'Description', u'LinkList', u'DbBuild', u'FieldList', u'DbName']
>>> for field in record["DbInfo"]["FieldList"]:
...     print("%(Name)s, %(FullName)s, %(Description)s" % field)
... 
ALL, All Fields, All terms from all searchable fields
UID, UID, Unique number assigned to publication
FILT, Filter, Limits the records
.
.
.

so FILT looks like the appropriate Key, right?

biopython esearch • 3.0k views
ADD COMMENT
3
Entering edit mode
5.4 years ago

I get an error.

You should always show the errors you get. I guess you get an syntax error, because the quotation marks here are to early:

" AND has abstract"[FILT]

Try " AND has abstract[FILT]" instead.

fin swimmer

ADD COMMENT
0
Entering edit mode

Seems you are right! Thx!!!

ADD REPLY

Login before adding your answer.

Traffic: 2118 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6