Question: Biopython Entrez Esearch FILTER
0
gravatar for maxininfa
4 months ago by
maxininfa0
maxininfa0 wrote:

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 • 244 views
ADD COMMENTlink modified 4 months ago by finswimmer11k • written 4 months ago by maxininfa0
3
gravatar for finswimmer
4 months ago by
finswimmer11k
Germany
finswimmer11k wrote:

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 COMMENTlink written 4 months ago by finswimmer11k

Seems you are right! Thx!!!

ADD REPLYlink written 4 months ago by maxininfa0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1218 users visited in the last hour