posts:x.509-certificates: Use --outfile with --generate-privkey
[blog.git] / posts / entrez.mdwn
1 Since 2008 I've been using a script ([[entrez.py]]) to search
2 [PubMed][] from the command line.  Yesterday I decided it was time to
3 clean up the script and make it publicly available.  It turned out to
4 be reasonably complicated, so I just reimplemented the guts using the
5 Python [SOAP][] library [Suds][] working with the [Entrez SOAP
6 interface][eSOAP].  I haven't been able to find the original that I
7 started with, but it seems to be related to `Pyblio/Query.py` in early
8 versions of [pybliographer][].
9
10     $ ./entrez.py -L
11     # available databases:
12     pubmed
13     protein
14     nuccore
15     ...
16     $ ./entrez.py -X
17     database: pubmed
18     description: PubMed bibliographic record
19     available fields:
20      ALL    All Fields   All terms from all searchable fields
21      UID    UID          Unique number assigned to publication
22     FILT    Filter       Limits the records
23     TITL    Title        Words in title of publication
24     ...
25     $ ./entrez.py -X -F AUTH
26     field AUTH in pubmed:
27     Description     Author(s) of publication
28        FullName     Author
29       Hierarchy     N
30          IsDate     N
31        IsHidden     N
32     IsNumerical     N
33            Name     AUTH
34     SingleToken     Y
35       TermCount     11526565
36     $ ./entrez.py -v 'king[au]+yang[au]+2010[dp]+monte[tit]'
37     entrezpy: INFO   run eEsearch on pubmed
38     entrezpy: INFO   search returned 1 of 1 items
39     entrezpy: INFO   run eFetch on pubmed
40     entrezpy: INFO   convert medline XML to BibTeX
41     @Article{King2010,
42       author =       "William T. King and Meihong Su and Guoliang Yang",
43       title =        "Monte Carlo simulation of mechanical unfolding of
44                      proteins based on a simple two-state model.",
45       journal =      "International journal of biological macromolecules",
46       ...
47       doi =          "10.1016/j.ijbiomac.2009.12.001",
48       URL =          "http://www.ncbi.nlm.nih.gov/pubmed/20004685",
49       language =     "eng",
50     }
51
52 The [[BibTeX]] conversion uses [bibutils][] and [bibclean][] for the
53 medline-to-BibTeX conversion.
54
55 [PubMed]: http://www.ncbi.nlm.nih.gov/pubmed/
56 [SOAP]: http://en.wikipedia.org/wiki/SOAP
57 [Suds]: https://fedorahosted.org/suds/
58 [eSOAP]: http://eutils.ncbi.nlm.nih.gov/entrez/eutils/soap/v2.0/DOC/esoap_help.html
59 [pybliographer]: http://pybliographer.org/
60 [bibutils]: http://www.scripps.edu/~cdputnam/software/bibutils
61 [bibclean]: http://ftp.math.utah.edu/pub/bibclean/
62
63 [[!tag tags/programming]]
64 [[!tag tags/python]]