Method Summary |
|
__init__ (self,
opener,
tool,
email,
baseurl)
opener = None, tool = TOOL, email = EMAIL, baseurl = ".../eutils/"
'opener' -- an object which implements the 'open' method like a
urllib2.OpenDirector. |
|
efetch_using_dbids (self,
dbids,
retmode,
rettype,
seq_start,
seq_stop,
strand,
complexity)
dbids, retmode = None, rettype = None, seq_start = None, seq_stop = None, strand = None, complexity = None
Fetch information for records specified by identifier
'dbids' -- a DBIds containing the database name and list
of record identifiers
'retmode' -- See the docstring for 'efetch_using_history'
'rettype' -- See the docstring for 'efetch_using_history'
These options work for sequence databases
'seq_start' -- return the sequence starting at this position. |
|
efetch_using_history (self,
db,
webenv,
query_key,
retstart,
retmax,
retmode,
rettype,
seq_start,
seq_stop,
strand,
complexity)
db, webenv, query_key, retstart=0, retmax=20, retmode=None, rettype=None, seq_start=None, seq_stop=None, strand=None, complexity=None
Fetch information for a collection of records in the history,
in a variety of formats. |
|
elink_using_dbids (self,
dbids,
db,
cmd,
retmode,
term,
field,
daterange)
dbids, db="pubmed", cmd="neighbor", retmode=None, term=None, daterange=None
Find records related (in various ways) to a set of records
specified by identifier. |
|
elink_using_history (self,
dbfrom,
webenv,
query_key,
db,
retstart,
retmax,
cmd,
retmode,
term,
field,
daterange)
dbfrom, webenv, query_key, db="pubmed", retstart=0, retmax=20, cmd="neighbor", retmode=None, term=None, field=None, daterange=None,
Find records related (in various ways) to a collection of
records in the history. |
|
epost (self,
dbids,
webenv)
dbids, webenv = None
Create a new collection in the history containing the given
list of identifiers for a database. |
|
esearch (self,
term,
db,
field,
daterange,
retstart,
retmax,
usehistory,
webenv)
term, db="pubmed", field=None, daterange=None, retstart=0, retmax=20, usehistory=0, webenv=none
Search the given database for records matching the query given
in the 'term'. |
|
esummary_using_dbids (self,
dbids,
retmode)
dbids, retmode = "xml"
Get the summary for records specified by identifier
'dbids' -- a DBIds containing the database name and list
of record identifiers
'retmode' -- can only be 'xml'
Returns an input stream from an HTTP request. |
|
esummary_using_history (self,
db,
webenv,
query_key,
retstart,
retmax,
retmode)
db, webenv, query_key, retstart = 0, retmax = 20, retmode =
"xml" |
efetch_using_history(self,
db,
webenv,
query_key,
retstart=0,
retmax=20,
retmode=None,
rettype=None,
seq_start=None,
seq_stop=None,
strand=None,
complexity=None)
db, webenv, query_key, retstart=0, retmax=20, retmode=None, rettype=None, seq_start=None, seq_stop=None, strand=None, complexity=None
Fetch information for a collection of records in the history,
in a variety of formats.
'db' -- the database containing the history/collection
'webenv' -- the WebEnv cookie for the history
'query_key' -- the collection in the history
'retstart' -- get the formatted data starting with this position
'retmax' -- get data for at most this many records
These options work for sequence databases
'seq_start' -- return the sequence starting at this position.
The first position is numbered 1
'seq_stop' -- return the sequence ending at this position
Includes the stop position, so seq_start = 1 and
seq_stop = 5 returns the first 5 bases/residues.
'strand' -- strand. Use EUtils.PLUS_STRAND (== 1) for plus
strand and EUtils.MINUS_STRAND (== 2) for negative
'complexity' -- regulates the level of display. Options are
0 - get the whole blob
1 - get the bioseq for gi of interest (default in Entrez)
2 - get the minimal bioseq-set containing the gi of interest
3 - get the minimal nuc-prot containing the gi of interest
4 - get the minimal pub-set containing the gi of interest
http://www.ncbi.nlm.nih.gov/entrez/query/static/efetchseq_help.html
The valid retmode and rettype values are
For publication databases (omim, pubmed, journals) the
retmodes are 'xml', 'asn.1', 'text', and 'html'.
If retmode == xml ---> XML (default)
if retmode == asn.1 ---> ASN.1
The following rettype values work for retmode == 'text'.
docsum ----> author / title / cite / PMID
brief ----> a one-liner up to about 66 chars
abstract ----> cite / title / author / dept /
full abstract / PMID
citation ----> cite / title / author / dept /
full abstract / MeSH terms /
substances / PMID
medline ----> full record in medline format
asn.1 ----> full record in one ASN.1 format
mlasn1 ----> full record in another ASN.1 format
uilist ----> list of uids, one per line
sgml ----> same as retmode="xml"
Sequence databases (genome, protein, nucleotide, popset)
also have retmode values of 'xml', 'asn.1', 'text', and
'html'.
If retmode == 'xml' ---> XML (default; only supports
rettype == 'native')
If retmode == 'asn.1' ---> ASN.1 text (only works for rettype
of 'native' and 'sequin')
The following work with a retmode of 'text' or 'html'
native ----> Default format for viewing sequences
fasta ----> FASTA view of a sequence
gb ----> GenBank view for sequences, constructed sequences
will be shown as contigs (by pointing to its parts).
Valid for nucleotides.
gbwithparts --> GenBank view for sequences, the sequence will
always be shown. Valid for nucleotides.
est ----> EST Report. Valid for sequences from
dbEST database.
gss ----> GSS Report. Valid for sequences from dbGSS
database.
gp ----> GenPept view. Valid for proteins.
seqid ----> To convert list of gis into list of seqids
acc ----> To convert list of gis into list of accessions
# XXX TRY THESE
fasta_xml
gb_xml
gi (same as uilist?)
A retmode of 'file' is the same as 'text' except the data is
sent with a Content-Type of application/octet-stream, which tells
the browser to save the data to a file.
A retmode of 'html' is the same as 'text' except a HTML header
and footer are added and special character are properly escaped.
Returns an input stream from an HTTP request. The stream
contents are in the requested format.
-
|
elink_using_history(self,
dbfrom,
webenv,
query_key,
db='pubmed',
retstart=0,
retmax=20,
cmd='neighbor',
retmode=None,
term=None,
field=None,
daterange=None)
dbfrom, webenv, query_key, db="pubmed", retstart=0, retmax=20, cmd="neighbor", retmode=None, term=None, field=None, daterange=None,
Find records related (in various ways) to a collection of
records in the history.
'dbfrom' -- this is the name of the database containing the
collection of record. NOTE! For the other methods
this is named 'db'. But I'm keeping NCBI's notation.
This is where the records come FROM.
'webenv' -- the WebEnv cookie for the history
'query_key' -- the collection in the history
'db' -- Where the records link TO. This is where you want to
find the new records. For example, if you want to
find PubMed records related to a protein then 'dbfrom'
is 'protein' and 'db' is 'pubmed'
'cmd'-- one of the following (unless specified, retmode is the
default value, which returns data in XML)
neighbor: Display neighbors and their scores by database and ID.
(This is the default 'cmd'.)
prlinks: List the hyperlink to the primary LinkOut provider
for multiple IDs and database.
When retmode == 'ref' this URL redirects the browser
to the primary LinkOut provider for a single ID
and database.
llinks: List LinkOut URLs and Attributes for multiple IDs
and database.
lcheck: Check for the existence (Y or N) of an external
link in for multiple IDs and database.
ncheck: Check for the existence of a neighbor link for
each ID, e.g., Related Articles in PubMed.
'retstart' -- get the formatted data starting with this position
'retmax' -- get data for at most this many records
'retmode' -- only used with 'prlinks'
'term' -- restrict results to records which also match this
Entrez search
'field' -- the field to use for unqualified words
'daterange' -- restrict results to records which also match this
date criteria; either WithinNDays or DateRange
NOTE: DateRange must have both mindate and maxdate
Some examples:
In PubMed, to get a list of "Related Articles"
dbfrom = pubmed
cmd = neighbor
To get MEDLINE index only related article
dbfrom = pubmed
db = pubmed
term = medline[sb]
cmd = neighbor
Given a PubMed record, find the related nucleotide records
dbfrom = pubmed
db = nucleotide (or "protein" for related protein records)
cmd = neighbor
To get "LinkOuts" (external links) for a PubMed record set
dbfrom = pubmed
cmd = llinks
Get the primary link information for a PubMed document; includes
various hyperlinks, image URL for the provider, etc.
dbfrom = pubmed
cmd = prlinks
(optional) retmode = "ref" (causes a redirect to the privder)
Returns an input stream from an HTTP request. The stream
contents are in XML unless 'retmode' is 'ref'.
-
|