NCBI.py
Provides code to access NCBI over the WWW.
The main Entrez web page is available at:
http://www.ncbi.nlm.nih.gov/Entrez/
A list of the Entrez utilities is available at:
http://www.ncbi.nlm.nih.gov/entrez/utils/utils_index.html
The main Blast web page is available at:
http://www.ncbi.nlm.nih.gov/BLAST/
Functions:
query Query Entrez.
pmfetch Retrieve results using a unique identifier.
pmqty Search PubMed.
pmneighbor Return a list of related articles for a PubMed entry.
_open
Imported modules
|
|
from Bio import File
import string
import urllib
|
Functions
|
|
_open
pmfetch
pmneighbor
pmqty
query
|
|
_open
|
_open (
cgi,
params={},
get=1,
)
_open(cgi, params={}, get=1) -> UndoHandle
Open a handle to Entrez. cgi is the URL for the cgi script to access.
params is a dictionary with the options to pass to it. get is a boolean
that describes whether a GET should be used. Does some
simple error checking, and will raise an IOError if it encounters one.
Exceptions
|
|
IOError, "500 Proxy Error (NCBI busy?)"
IOError, "502 Proxy Error (NCBI busy?)"
IOError, "ERROR, possibly because id not available?"
IOError, "WWW Error 500 Diagnostic (NCBI busy?)"
|
|
|
pmfetch
|
pmfetch (
db,
id,
report=None,
mode=None,
cgi="http://www.ncbi.nlm.nih.gov/entrez/utils/pmfetch.fcgi",
)
pmfetch(db, id, report=None, mode=None,
cgi="http://www.ncbi.nlm.nih.gov/entrez/utils/pmfetch.fcgi") Query PmFetch and return a handle to the results. See the
online documentation for an explanation of the parameters:
http://www.ncbi.nlm.nih.gov/entrez/utils/pmfetch_help.html
Raises an IOError exception if there's a network error.
|
|
pmneighbor
|
pmneighbor (
pmid,
display,
cgi='http://www.ncbi.nlm.nih.gov/entrez/utils/pmneighbor.fcgi',
)
pmneighbor(pmid, display,
cgi=http://www.ncbi.nlm.nih.gov/entrez/utils/pmneighbor.fcgi ) -> handle Query PMNeighbor and return a handle to the results. See the
online documentation for an explanation of the parameters:
http://www.ncbi.nlm.nih.gov/entrez/utils/pmneighbor_help.html
Raises an IOError exception if there's a network error.
|
|
pmqty
|
pmqty (
db,
term,
dopt=None,
cgi='http://www.ncbi.nlm.nih.gov/entrez/utils/pmqty.fcgi',
**keywds,
)
pmqty(db, term, dopt=None,
cgi=http://www.ncbi.nlm.nih.gov/entrez/utils/pmqty.fcgi ) -> handle Query PmQty and return a handle to the results. See the
online documentation for an explanation of the parameters:
http://www.ncbi.nlm.nih.gov/entrez/utils/pmqty_help.html
Raises an IOError exception if there's a network error.
|
|
query
|
query (
cmd,
db,
cgi='http://www.ncbi.nlm.nih.gov/entrez/query.fcgi',
**keywds,
)
query(cmd, db, cgi=http://www.ncbi.nlm.nih.gov/entrez/query.fcgi ,
**keywds) -> handle Query Entrez and return a handle to the results. See the online
documentation for an explanation of the parameters:
http://www.ncbi.nlm.nih.gov/entrez/query/static/linking.html
Raises an IOError exception if there's a network error.
|
|