xrefresolver (version 1.1)
index
/home/pjk/websrc/xrefresolver.py

Basic URL creation for cross-references to external web resources.
The implemented web resources are mostly in bioinformatics,
but the design is applicable in general.
 
Synthesize URLs for access and/or download from the search string
('xkey') of the specified external database ('xdb').
 
Note: UniProt 'beta.uniprot.org' address is used; change when not beta anymore.
 
Example usage:
 
    import xrefresolver
    a = xrefresolver.a_href('PDB', '1CRQ')
    print a
    a = xrefresolver.Ensembl('ENSG00000174775').a_href()
    print a
    url = xrefresolver.UniProt('P01112').url()
    print url
    xmldata = xrefresolver.UniProt('P01112').get_xml()
    print len(xmldata)
    print xmldata[:80] + '...'
 
This is the output:
 
<a href="http://www.rcsb.org/pdb/explore.do?structureId=1CRQ">PDB:1CRQ</a>
<a href="http://www.ensembl.org/Homo_sapiens/geneview?gene=ENSG00000174775">Ensembl:ENSG00000174775</a>
http://beta.uniprot.org/uniprot/P01112
48252
<?xml version='1.0' encoding='UTF-8'?>
<uniprot xmlns="http://uniprot.org/unipro...
 
------------------------------------------------------------
Version 1.1
 
2005-10-16
2007-09-20  checked templates, use urllib2, error handling for get_xml
 
Copyright (C) 2005-2007 Per Kraulis
 
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

 
Modules
       
urllib2

 
Classes
       
__builtin__.object
XrefResolver
XkeyTemplate
BRENDA
DOI
EC
Ensembl
EntrezGene
FlyBase
GenBank
HGNC
HGNC
KeggGene
KeggPathway
NCBITaxonomy
OMIM
PDB
PubChem
PubMed
PubMedBook
PubMedSearch
Reactome
SignalingGateway
UniProt
Wikipedia
WormBase
url

 
class BRENDA(XkeyTemplate)
    BRENDA enzyme database lookup service.
 
 
Method resolution order:
BRENDA
XkeyTemplate
XrefResolver
__builtin__.object

Data and other attributes defined here:
template = 'http://www.brenda-enzymes.org/php/result_flat.php4?ecno=%s'

Methods inherited from XkeyTemplate:
__init__(self, xkey, title=None)
get(self, format=None)
Get the data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
get_xml(self)
Get the XML data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
url(self, format=None)
Return the resolved URL for the xref.
If the format is given, then the resource must be able to
provide it, or a ValueError is raised.
By default, a HTML resource is assumed.

Data and other attributes inherited from XkeyTemplate:
format_templates = {}

Methods inherited from XrefResolver:
__str__(self)
Same as method 'a_href'.
a_href(self, full=True)
Return the XHTML 'a' href element (HTML 'A') for this xref.
urn(self)
Return the URN for the xref.

Data and other attributes inherited from XrefResolver:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'XrefResolver' objects>
list of weak references to the object (if defined)

 
class DOI(XkeyTemplate)
    Digital Object Identifier lookup and forwarding service.
 
 
Method resolution order:
DOI
XkeyTemplate
XrefResolver
__builtin__.object

Data and other attributes defined here:
template = 'http://dx.doi.org/%s'

Methods inherited from XkeyTemplate:
__init__(self, xkey, title=None)
get(self, format=None)
Get the data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
get_xml(self)
Get the XML data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
url(self, format=None)
Return the resolved URL for the xref.
If the format is given, then the resource must be able to
provide it, or a ValueError is raised.
By default, a HTML resource is assumed.

Data and other attributes inherited from XkeyTemplate:
format_templates = {}

Methods inherited from XrefResolver:
__str__(self)
Same as method 'a_href'.
a_href(self, full=True)
Return the XHTML 'a' href element (HTML 'A') for this xref.
urn(self)
Return the URN for the xref.

Data and other attributes inherited from XrefResolver:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'XrefResolver' objects>
list of weak references to the object (if defined)

 
class EC(XkeyTemplate)
    The Enzyme Commission classification system for enzymes.
The address for the Enzyme Commission site is derived from
the EC number in an absolutely brain-dead way...
 
 
Method resolution order:
EC
XkeyTemplate
XrefResolver
__builtin__.object

Methods defined here:
url(self, format=None)
Return the resolved URL for the xref.
The format argument is currently ignored.

Data and other attributes defined here:
template = 'http://www.chem.qmul.ac.uk/iubmb/enzyme/EC%s'

Methods inherited from XkeyTemplate:
__init__(self, xkey, title=None)
get(self, format=None)
Get the data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
get_xml(self)
Get the XML data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.

Data and other attributes inherited from XkeyTemplate:
format_templates = {}

Methods inherited from XrefResolver:
__str__(self)
Same as method 'a_href'.
a_href(self, full=True)
Return the XHTML 'a' href element (HTML 'A') for this xref.
urn(self)
Return the URN for the xref.

Data and other attributes inherited from XrefResolver:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'XrefResolver' objects>
list of weak references to the object (if defined)

 
class Ensembl(XkeyTemplate)
    EMBL & Sanger eukaryotic genome database lookup service.
Determine the Ensembl address template by looking at the xkey prefix.
This implementation cannot handle XML format (if there were any...).
 
 
Method resolution order:
Ensembl
XkeyTemplate
XrefResolver
__builtin__.object

Methods defined here:
url(self, format=None)
Return the resolved URL for the xref.
The format argument is currently ignored.

Data and other attributes defined here:
tags = {'ENSG': ('Homo_sapiens', 'geneview?gene=%s'), 'ENSMUSG': ('Mus_musculus', 'geneview?gene=%s'), 'ENSMUSP': ('Mus_musculus', 'protview?peptide=%s'), 'ENSMUST': ('Mus_musculus', 'transview?transcript=%s'), 'ENSP': ('Homo_sapiens', 'protview?peptide=%s'), 'ENSRNOG': ('Rattus_norvegicus', 'geneview?gene=%s'), 'ENSRNOP': ('Rattus_norvegicus', 'protview?peptide=%s'), 'ENSRNOT': ('Rattus_norvegicus', 'transview?transcript=%s'), 'ENST': ('Homo_sapiens', 'transview?transcript=%s')}
template = 'http://www.ensembl.org/%s/%s'

Methods inherited from XkeyTemplate:
__init__(self, xkey, title=None)
get(self, format=None)
Get the data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
get_xml(self)
Get the XML data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.

Data and other attributes inherited from XkeyTemplate:
format_templates = {}

Methods inherited from XrefResolver:
__str__(self)
Same as method 'a_href'.
a_href(self, full=True)
Return the XHTML 'a' href element (HTML 'A') for this xref.
urn(self)
Return the URN for the xref.

Data and other attributes inherited from XrefResolver:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'XrefResolver' objects>
list of weak references to the object (if defined)

 
class EntrezGene(XkeyTemplate)
    NCBI Entrez Gene database of genes, lookup service.
 
 
Method resolution order:
EntrezGene
XkeyTemplate
XrefResolver
__builtin__.object

Data and other attributes defined here:
template = 'http://www.ncbi.nlm.nih.gov/sites/entrez?Db=gene&Cmd=ShowDetailView&TermToSearch=%s'

Methods inherited from XkeyTemplate:
__init__(self, xkey, title=None)
get(self, format=None)
Get the data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
get_xml(self)
Get the XML data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
url(self, format=None)
Return the resolved URL for the xref.
If the format is given, then the resource must be able to
provide it, or a ValueError is raised.
By default, a HTML resource is assumed.

Data and other attributes inherited from XkeyTemplate:
format_templates = {}

Methods inherited from XrefResolver:
__str__(self)
Same as method 'a_href'.
a_href(self, full=True)
Return the XHTML 'a' href element (HTML 'A') for this xref.
urn(self)
Return the URN for the xref.

Data and other attributes inherited from XrefResolver:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'XrefResolver' objects>
list of weak references to the object (if defined)

 
class FlyBase(XkeyTemplate)
    Drosophila genetics database lookup service.
 
 
Method resolution order:
FlyBase
XkeyTemplate
XrefResolver
__builtin__.object

Data and other attributes defined here:
template = 'http://www.flybase.net/reports/%s.html'

Methods inherited from XkeyTemplate:
__init__(self, xkey, title=None)
get(self, format=None)
Get the data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
get_xml(self)
Get the XML data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
url(self, format=None)
Return the resolved URL for the xref.
If the format is given, then the resource must be able to
provide it, or a ValueError is raised.
By default, a HTML resource is assumed.

Data and other attributes inherited from XkeyTemplate:
format_templates = {}

Methods inherited from XrefResolver:
__str__(self)
Same as method 'a_href'.
a_href(self, full=True)
Return the XHTML 'a' href element (HTML 'A') for this xref.
urn(self)
Return the URN for the xref.

Data and other attributes inherited from XrefResolver:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'XrefResolver' objects>
list of weak references to the object (if defined)

 
class GenBank(XkeyTemplate)
    NCBI nucleotide sequence database lookup service.
 
 
Method resolution order:
GenBank
XkeyTemplate
XrefResolver
__builtin__.object

Data and other attributes defined here:
template = 'http://www.ncbi.nlm.nih.gov/entrez/viewer.fcgi?db=nucleotide&id=%s'

Methods inherited from XkeyTemplate:
__init__(self, xkey, title=None)
get(self, format=None)
Get the data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
get_xml(self)
Get the XML data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
url(self, format=None)
Return the resolved URL for the xref.
If the format is given, then the resource must be able to
provide it, or a ValueError is raised.
By default, a HTML resource is assumed.

Data and other attributes inherited from XkeyTemplate:
format_templates = {}

Methods inherited from XrefResolver:
__str__(self)
Same as method 'a_href'.
a_href(self, full=True)
Return the XHTML 'a' href element (HTML 'A') for this xref.
urn(self)
Return the URN for the xref.

Data and other attributes inherited from XrefResolver:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'XrefResolver' objects>
list of weak references to the object (if defined)

 
class HGNC(XkeyTemplate)
    HUGO Gene Nomenclature Committee, gene name lookup service.
The ID is the xkey. It is unclear how to use the approved symbol.
 
 
Method resolution order:
HGNC
XkeyTemplate
XrefResolver
__builtin__.object

Data and other attributes defined here:
template = 'http://www.genenames.org/data/hgnc_data.php?hgnc_id=%s'

Methods inherited from XkeyTemplate:
__init__(self, xkey, title=None)
get(self, format=None)
Get the data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
get_xml(self)
Get the XML data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
url(self, format=None)
Return the resolved URL for the xref.
If the format is given, then the resource must be able to
provide it, or a ValueError is raised.
By default, a HTML resource is assumed.

Data and other attributes inherited from XkeyTemplate:
format_templates = {}

Methods inherited from XrefResolver:
__str__(self)
Same as method 'a_href'.
a_href(self, full=True)
Return the XHTML 'a' href element (HTML 'A') for this xref.
urn(self)
Return the URN for the xref.

Data and other attributes inherited from XrefResolver:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'XrefResolver' objects>
list of weak references to the object (if defined)

 
class KeggGene(XkeyTemplate)
    Kyoto Encyclopedia of Genes and Genomes, gene ookup service.
The xkey is in the form 'hsa:3265'.
 
 
Method resolution order:
KeggGene
XkeyTemplate
XrefResolver
__builtin__.object

Data and other attributes defined here:
template = 'http://www.genome.ad.jp/dbget-bin/www_bget?%s'

Methods inherited from XkeyTemplate:
__init__(self, xkey, title=None)
get(self, format=None)
Get the data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
get_xml(self)
Get the XML data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
url(self, format=None)
Return the resolved URL for the xref.
If the format is given, then the resource must be able to
provide it, or a ValueError is raised.
By default, a HTML resource is assumed.

Data and other attributes inherited from XkeyTemplate:
format_templates = {}

Methods inherited from XrefResolver:
__str__(self)
Same as method 'a_href'.
a_href(self, full=True)
Return the XHTML 'a' href element (HTML 'A') for this xref.
urn(self)
Return the URN for the xref.

Data and other attributes inherited from XrefResolver:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'XrefResolver' objects>
list of weak references to the object (if defined)

 
class KeggPathway(XkeyTemplate)
    Kyoto Encyclopedia of Genes and Genomes, pathway lookup service.
The xkey is in the form 'hsa04010'.
 
 
Method resolution order:
KeggPathway
XkeyTemplate
XrefResolver
__builtin__.object

Data and other attributes defined here:
template = 'http://www.genome.ad.jp/dbget-bin/show_pathway?%s'

Methods inherited from XkeyTemplate:
__init__(self, xkey, title=None)
get(self, format=None)
Get the data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
get_xml(self)
Get the XML data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
url(self, format=None)
Return the resolved URL for the xref.
If the format is given, then the resource must be able to
provide it, or a ValueError is raised.
By default, a HTML resource is assumed.

Data and other attributes inherited from XkeyTemplate:
format_templates = {}

Methods inherited from XrefResolver:
__str__(self)
Same as method 'a_href'.
a_href(self, full=True)
Return the XHTML 'a' href element (HTML 'A') for this xref.
urn(self)
Return the URN for the xref.

Data and other attributes inherited from XrefResolver:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'XrefResolver' objects>
list of weak references to the object (if defined)

 
class NCBITaxonomy(XkeyTemplate)
    NCBI Taxonomy lookup service.
 
 
Method resolution order:
NCBITaxonomy
XkeyTemplate
XrefResolver
__builtin__.object

Data and other attributes defined here:
template = 'http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi?id=%s&mode=Info'

Methods inherited from XkeyTemplate:
__init__(self, xkey, title=None)
get(self, format=None)
Get the data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
get_xml(self)
Get the XML data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
url(self, format=None)
Return the resolved URL for the xref.
If the format is given, then the resource must be able to
provide it, or a ValueError is raised.
By default, a HTML resource is assumed.

Data and other attributes inherited from XkeyTemplate:
format_templates = {}

Methods inherited from XrefResolver:
__str__(self)
Same as method 'a_href'.
a_href(self, full=True)
Return the XHTML 'a' href element (HTML 'A') for this xref.
urn(self)
Return the URN for the xref.

Data and other attributes inherited from XrefResolver:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'XrefResolver' objects>
list of weak references to the object (if defined)

 
class OMIM(XkeyTemplate)
    Online Mendelian Inheritance in Man, genetic disorders lookup service.
 
 
Method resolution order:
OMIM
XkeyTemplate
XrefResolver
__builtin__.object

Data and other attributes defined here:
template = 'http://www.ncbi.nlm.nih.gov/entrez/dispomim.cgi?id=%s'

Methods inherited from XkeyTemplate:
__init__(self, xkey, title=None)
get(self, format=None)
Get the data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
get_xml(self)
Get the XML data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
url(self, format=None)
Return the resolved URL for the xref.
If the format is given, then the resource must be able to
provide it, or a ValueError is raised.
By default, a HTML resource is assumed.

Data and other attributes inherited from XkeyTemplate:
format_templates = {}

Methods inherited from XrefResolver:
__str__(self)
Same as method 'a_href'.
a_href(self, full=True)
Return the XHTML 'a' href element (HTML 'A') for this xref.
urn(self)
Return the URN for the xref.

Data and other attributes inherited from XrefResolver:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'XrefResolver' objects>
list of weak references to the object (if defined)

 
class PDB(XkeyTemplate)
    PDB at RSCB, biomolecular 3D structure data lookup service.
 
 
Method resolution order:
PDB
XkeyTemplate
XrefResolver
__builtin__.object

Methods defined here:
get_xml(self)

Data and other attributes defined here:
format_templates = {'XML': 'http://www.rcsb.org/pdb/download/downloadFile.do?fileFormat=xml&compression=NO&structureId=%s'}
template = 'http://www.rcsb.org/pdb/explore.do?structureId=%s'

Methods inherited from XkeyTemplate:
__init__(self, xkey, title=None)
get(self, format=None)
Get the data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
url(self, format=None)
Return the resolved URL for the xref.
If the format is given, then the resource must be able to
provide it, or a ValueError is raised.
By default, a HTML resource is assumed.

Methods inherited from XrefResolver:
__str__(self)
Same as method 'a_href'.
a_href(self, full=True)
Return the XHTML 'a' href element (HTML 'A') for this xref.
urn(self)
Return the URN for the xref.

Data and other attributes inherited from XrefResolver:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'XrefResolver' objects>
list of weak references to the object (if defined)

 
class PubChem(XkeyTemplate)
    PubMed chemical compound lookup service.
 
 
Method resolution order:
PubChem
XkeyTemplate
XrefResolver
__builtin__.object

Data and other attributes defined here:
template = 'http://pubchem.ncbi.nlm.nih.gov/summary/summary.cgi?cid=%s'

Methods inherited from XkeyTemplate:
__init__(self, xkey, title=None)
get(self, format=None)
Get the data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
get_xml(self)
Get the XML data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
url(self, format=None)
Return the resolved URL for the xref.
If the format is given, then the resource must be able to
provide it, or a ValueError is raised.
By default, a HTML resource is assumed.

Data and other attributes inherited from XkeyTemplate:
format_templates = {}

Methods inherited from XrefResolver:
__str__(self)
Same as method 'a_href'.
a_href(self, full=True)
Return the XHTML 'a' href element (HTML 'A') for this xref.
urn(self)
Return the URN for the xref.

Data and other attributes inherited from XrefResolver:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'XrefResolver' objects>
list of weak references to the object (if defined)

 
class PubMed(XkeyTemplate)
    PubMed life sciences literature lookup service.
 
 
Method resolution order:
PubMed
XkeyTemplate
XrefResolver
__builtin__.object

Methods defined here:
get_xml(self)

Data and other attributes defined here:
format_templates = {'XML': 'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?retmode=xml&db=PubMed&id=%s'}
template = 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Abstract&list_uids=%s'

Methods inherited from XkeyTemplate:
__init__(self, xkey, title=None)
get(self, format=None)
Get the data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
url(self, format=None)
Return the resolved URL for the xref.
If the format is given, then the resource must be able to
provide it, or a ValueError is raised.
By default, a HTML resource is assumed.

Methods inherited from XrefResolver:
__str__(self)
Same as method 'a_href'.
a_href(self, full=True)
Return the XHTML 'a' href element (HTML 'A') for this xref.
urn(self)
Return the URN for the xref.

Data and other attributes inherited from XrefResolver:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'XrefResolver' objects>
list of weak references to the object (if defined)

 
class PubMedBook(XkeyTemplate)
    PubMed life sciences literature on-line textbook service.
 
 
Method resolution order:
PubMedBook
XkeyTemplate
XrefResolver
__builtin__.object

Data and other attributes defined here:
template = 'http://www.ncbi.nlm.nih.gov/books/bv.fcgi?rid=%s'

Methods inherited from XkeyTemplate:
__init__(self, xkey, title=None)
get(self, format=None)
Get the data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
get_xml(self)
Get the XML data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
url(self, format=None)
Return the resolved URL for the xref.
If the format is given, then the resource must be able to
provide it, or a ValueError is raised.
By default, a HTML resource is assumed.

Data and other attributes inherited from XkeyTemplate:
format_templates = {}

Methods inherited from XrefResolver:
__str__(self)
Same as method 'a_href'.
a_href(self, full=True)
Return the XHTML 'a' href element (HTML 'A') for this xref.
urn(self)
Return the URN for the xref.

Data and other attributes inherited from XrefResolver:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'XrefResolver' objects>
list of weak references to the object (if defined)

 
class PubMedSearch(XkeyTemplate)
    PubMed life sciences literature search service.
 
 
Method resolution order:
PubMedSearch
XkeyTemplate
XrefResolver
__builtin__.object

Data and other attributes defined here:
template = 'http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Search&db=PubMed&term=%s'

Methods inherited from XkeyTemplate:
__init__(self, xkey, title=None)
get(self, format=None)
Get the data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
get_xml(self)
Get the XML data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
url(self, format=None)
Return the resolved URL for the xref.
If the format is given, then the resource must be able to
provide it, or a ValueError is raised.
By default, a HTML resource is assumed.

Data and other attributes inherited from XkeyTemplate:
format_templates = {}

Methods inherited from XrefResolver:
__str__(self)
Same as method 'a_href'.
a_href(self, full=True)
Return the XHTML 'a' href element (HTML 'A') for this xref.
urn(self)
Return the URN for the xref.

Data and other attributes inherited from XrefResolver:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'XrefResolver' objects>
list of weak references to the object (if defined)

 
class Reactome(XkeyTemplate)
    Reactome molecular events and pathways database lookup service.
 
 
Method resolution order:
Reactome
XkeyTemplate
XrefResolver
__builtin__.object

Data and other attributes defined here:
template = 'http://www.reactome.org/cgi-bin/link?SOURCE=Reactome&ID=%s'

Methods inherited from XkeyTemplate:
__init__(self, xkey, title=None)
get(self, format=None)
Get the data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
get_xml(self)
Get the XML data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
url(self, format=None)
Return the resolved URL for the xref.
If the format is given, then the resource must be able to
provide it, or a ValueError is raised.
By default, a HTML resource is assumed.

Data and other attributes inherited from XkeyTemplate:
format_templates = {}

Methods inherited from XrefResolver:
__str__(self)
Same as method 'a_href'.
a_href(self, full=True)
Return the XHTML 'a' href element (HTML 'A') for this xref.
urn(self)
Return the URN for the xref.

Data and other attributes inherited from XrefResolver:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'XrefResolver' objects>
list of weak references to the object (if defined)

 
class SignalingGateway(XkeyTemplate)
    Signaling Gateway, molecular signal transduction database lookup service.
 
 
Method resolution order:
SignalingGateway
XkeyTemplate
XrefResolver
__builtin__.object

Data and other attributes defined here:
template = 'http://www.signaling-gateway.org/molecule/query?afcsid=%s'

Methods inherited from XkeyTemplate:
__init__(self, xkey, title=None)
get(self, format=None)
Get the data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
get_xml(self)
Get the XML data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
url(self, format=None)
Return the resolved URL for the xref.
If the format is given, then the resource must be able to
provide it, or a ValueError is raised.
By default, a HTML resource is assumed.

Data and other attributes inherited from XkeyTemplate:
format_templates = {}

Methods inherited from XrefResolver:
__str__(self)
Same as method 'a_href'.
a_href(self, full=True)
Return the XHTML 'a' href element (HTML 'A') for this xref.
urn(self)
Return the URN for the xref.

Data and other attributes inherited from XrefResolver:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'XrefResolver' objects>
list of weak references to the object (if defined)

 
class UniProt(XkeyTemplate)
    UniProt, protein sequence database lookup service.
 
 
Method resolution order:
UniProt
XkeyTemplate
XrefResolver
__builtin__.object

Data and other attributes defined here:
format_templates = {'XML': 'http://beta.uniprot.org/uniprot/%s.xml'}
template = 'http://beta.uniprot.org/uniprot/%s'

Methods inherited from XkeyTemplate:
__init__(self, xkey, title=None)
get(self, format=None)
Get the data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
get_xml(self)
Get the XML data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
url(self, format=None)
Return the resolved URL for the xref.
If the format is given, then the resource must be able to
provide it, or a ValueError is raised.
By default, a HTML resource is assumed.

Methods inherited from XrefResolver:
__str__(self)
Same as method 'a_href'.
a_href(self, full=True)
Return the XHTML 'a' href element (HTML 'A') for this xref.
urn(self)
Return the URN for the xref.

Data and other attributes inherited from XrefResolver:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'XrefResolver' objects>
list of weak references to the object (if defined)

 
class Wikipedia(XkeyTemplate)
    The English Wikipedia resource.
 
 
Method resolution order:
Wikipedia
XkeyTemplate
XrefResolver
__builtin__.object

Data and other attributes defined here:
template = 'http://en.wikipedia.org/wiki/%s'

Methods inherited from XkeyTemplate:
__init__(self, xkey, title=None)
get(self, format=None)
Get the data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
get_xml(self)
Get the XML data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
url(self, format=None)
Return the resolved URL for the xref.
If the format is given, then the resource must be able to
provide it, or a ValueError is raised.
By default, a HTML resource is assumed.

Data and other attributes inherited from XkeyTemplate:
format_templates = {}

Methods inherited from XrefResolver:
__str__(self)
Same as method 'a_href'.
a_href(self, full=True)
Return the XHTML 'a' href element (HTML 'A') for this xref.
urn(self)
Return the URN for the xref.

Data and other attributes inherited from XrefResolver:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'XrefResolver' objects>
list of weak references to the object (if defined)

 
class WormBase(XkeyTemplate)
    C. elegansDrosophila genetics database lookup service.
 
 
Method resolution order:
WormBase
XkeyTemplate
XrefResolver
__builtin__.object

Data and other attributes defined here:
format_templates = {'XML': 'http://www.wormbase.org/db/misc/xml?name=%s;class=Gene'}
template = 'http://www.wormbase.org/db/gene/gene?name=%s;class=Gene'

Methods inherited from XkeyTemplate:
__init__(self, xkey, title=None)
get(self, format=None)
Get the data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
get_xml(self)
Get the XML data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
url(self, format=None)
Return the resolved URL for the xref.
If the format is given, then the resource must be able to
provide it, or a ValueError is raised.
By default, a HTML resource is assumed.

Methods inherited from XrefResolver:
__str__(self)
Same as method 'a_href'.
a_href(self, full=True)
Return the XHTML 'a' href element (HTML 'A') for this xref.
urn(self)
Return the URN for the xref.

Data and other attributes inherited from XrefResolver:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'XrefResolver' objects>
list of weak references to the object (if defined)

 
class XkeyTemplate(XrefResolver)
    Base resolver class for the simple case where the
xkey can be inserted directly into the URL template.
The name of the class becomes the value of the 'xdb' member.
Different formats may be specified in the dictionary using
the format identifier as key and the corresponding template
as value.
 
 
Method resolution order:
XkeyTemplate
XrefResolver
__builtin__.object

Methods defined here:
__init__(self, xkey, title=None)
get(self, format=None)
Get the data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
get_xml(self)
Get the XML data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
url(self, format=None)
Return the resolved URL for the xref.
If the format is given, then the resource must be able to
provide it, or a ValueError is raised.
By default, a HTML resource is assumed.

Data and other attributes defined here:
format_templates = {}
template = None

Methods inherited from XrefResolver:
__str__(self)
Same as method 'a_href'.
a_href(self, full=True)
Return the XHTML 'a' href element (HTML 'A') for this xref.
urn(self)
Return the URN for the xref.

Data and other attributes inherited from XrefResolver:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'XrefResolver' objects>
list of weak references to the object (if defined)

 
class XrefResolver(__builtin__.object)
    Base resolver class. To be elaborated, rather than instantiated directly.
 
  Methods defined here:
__init__(self, xdb, xkey, title=None)
__str__(self)
Same as method 'a_href'.
a_href(self, full=True)
Return the XHTML 'a' href element (HTML 'A') for this xref.
url(self)
Return the resolved URL for the xref.
urn(self)
Return the URN for the xref.

Data and other attributes defined here:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'XrefResolver' objects>
list of weak references to the object (if defined)

 
resolver_class = class HGNC(XkeyTemplate)
    HUGO Gene Nomenclature Committee, gene name lookup service.
The ID is the xkey. It is unclear how to use the approved symbol.
 
 
Method resolution order:
HGNC
XkeyTemplate
XrefResolver
__builtin__.object

Data and other attributes defined here:
template = 'http://www.genenames.org/data/hgnc_data.php?hgnc_id=%s'

Methods inherited from XkeyTemplate:
__init__(self, xkey, title=None)
get(self, format=None)
Get the data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
get_xml(self)
Get the XML data for the resource. Raise IOError if not found.
This is a basic implementation that may have to be redefined
for s specific Xdb depending on how it behaves.
url(self, format=None)
Return the resolved URL for the xref.
If the format is given, then the resource must be able to
provide it, or a ValueError is raised.
By default, a HTML resource is assumed.

Data and other attributes inherited from XkeyTemplate:
format_templates = {}

Methods inherited from XrefResolver:
__str__(self)
Same as method 'a_href'.
a_href(self, full=True)
Return the XHTML 'a' href element (HTML 'A') for this xref.
urn(self)
Return the URN for the xref.

Data and other attributes inherited from XrefResolver:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'XrefResolver' objects>
list of weak references to the object (if defined)

 
class url(XrefResolver)
    An xref that is simply a common URL address.
 
 
Method resolution order:
url
XrefResolver
__builtin__.object

Methods defined here:
url(self)
Return the URL as is.

Methods inherited from XrefResolver:
__init__(self, xdb, xkey, title=None)
__str__(self)
Same as method 'a_href'.
a_href(self, full=True)
Return the XHTML 'a' href element (HTML 'A') for this xref.
urn(self)
Return the URN for the xref.

Data and other attributes inherited from XrefResolver:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'XrefResolver' objects>
list of weak references to the object (if defined)

 
Functions
       
a_href(xdb, xkey, title=None)
Return the XHTML for the xref given by xdb and xky.
Return an 'a' href element if possible, else a string.
add_resolver_class(resolver_class, name=None)
Add an xref resolver class to the lookup.
escape(s)
Helper function to replace special characters with their HTML entities.
test_get(xref)
test_usage()
test_xml()
xref_resolver(xdb)
Return the resolver class for the xdb.

 
Data
        __version__ = '1.1'
xdb_classes = {'brenda': <class 'xrefresolver.BRENDA'>, 'doi': <class 'xrefresolver.DOI'>, 'ec': <class 'xrefresolver.EC'>, 'ensembl': <class 'xrefresolver.Ensembl'>, 'entrezgene': <class 'xrefresolver.EntrezGene'>, 'flybase': <class 'xrefresolver.FlyBase'>, 'genbank': <class 'xrefresolver.GenBank'>, 'hgnc': <class 'xrefresolver.HGNC'>, 'kegggene': <class 'xrefresolver.KeggGene'>, 'keggpathway': <class 'xrefresolver.KeggPathway'>, ...}
xdbs = ['BRENDA', 'DOI', 'EC', 'Ensembl', 'EntrezGene', 'FlyBase', 'GenBank', 'HGNC', 'KeggGene', 'KeggPathway', 'NCBITaxonomy', 'OMIM', 'PDB', 'PubChem', 'PubMed', 'PubMedBook', 'PubMedSearch', 'Reactome', 'SignalingGateway', 'UniProt', ...]