Back to index

python-biopython  1.60
Namespaces | Classes | Functions | Variables
Bio.SCOP Namespace Reference

Namespaces

namespace  Cla
namespace  Des
namespace  Dom
namespace  Hie
namespace  Raf
namespace  Residues
namespace  three_to_one_dict

Classes

class  Scop
class  Node
class  Domain
class  Astral

Functions

def _cmp
def cmp_sccs
def parse_domain
def _open_scop_file
def search
def _open

Variables

dictionary nodeCodeDict
dictionary _nodetype_to_code
list nodeCodeOrder = [ 'ro', 'cl', 'cf', 'sf', 'fa', 'dm', 'sp', 'px' ]
list astralBibIds = [10,20,25,30,35,40,50,70,90,95,100]
list astralEvs
dictionary astralEv_to_file
dictionary astralEv_to_sql
 _cmp = cmp
tuple _domain_re = re.compile(r">?([\w_\.]*)\s+([\w\.]*)\s+\(([^)]*)\) (.*)")

Function Documentation

def Bio.SCOP._cmp (   a,
  b 
) [private]
Implementation of cmp(x,y) for Python 3 (PRIVATE).

Based on Python 3 docs which say if you really need the cmp()
functionality, you could use the expression (a > b) -  (a < b)
as the equivalent for cmp(a, b)

Definition at line 89 of file __init__.py.

00089 
00090     def _cmp(a,b):
00091         """Implementation of cmp(x,y) for Python 3 (PRIVATE).
00092 
00093         Based on Python 3 docs which say if you really need the cmp()
00094         functionality, you could use the expression (a > b) -  (a < b)
00095         as the equivalent for cmp(a, b)
00096         """
00097         return (a > b) -  (a < b)

def Bio.SCOP._open (   cgi,
  params = {},
  get = 1 
) [private]
_open(cgi, params={}, get=1) -> UndoHandle

Open a handle to SCOP.  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.

Definition at line 897 of file __init__.py.

00897 
00898 def _open(cgi, params={}, get=1):
00899     """_open(cgi, params={}, get=1) -> UndoHandle
00900 
00901     Open a handle to SCOP.  cgi is the URL for the cgi script to access.
00902     params is a dictionary with the options to pass to it.  get is a boolean
00903     that describes whether a GET should be used.  Does some
00904     simple error checking, and will raise an IOError if it encounters one.
00905 
00906     """
00907     import urllib, urllib2
00908     # Open a handle to SCOP.
00909     options = urllib.urlencode(params)
00910     try:
00911         if get:  # do a GET
00912             if options:
00913                 cgi += "?" + options
00914             handle = urllib2.urlopen(cgi)
00915         else:    # do a POST
00916             handle = urllib2.urlopen(cgi, data=options)
00917     except urllib2.HTTPError, exception:
00918         raise exception
00919     return handle

Here is the caller graph for this function:

def Bio.SCOP._open_scop_file (   scop_dir_path,
  version,
  filetype 
) [private]

Definition at line 149 of file __init__.py.

00149 
00150 def _open_scop_file(scop_dir_path, version, filetype):
00151     filename = "dir.%s.scop.txt_%s" % (filetype,version)
00152     handle = open(os.path.join( scop_dir_path, filename))
00153     return handle
00154 

Here is the call graph for this function:

def Bio.SCOP.cmp_sccs (   sccs1,
  sccs2 
)
Order SCOP concise classification strings (sccs).

a.4.5.1 < a.4.5.11 < b.1.1.1

A sccs (e.g. a.4.5.11) compactly represents a domain's classification.
The letter represents the class, and the numbers are the fold,
superfamily, and family, respectively.

Definition at line 98 of file __init__.py.

00098 
00099 def cmp_sccs(sccs1, sccs2):
00100     """Order SCOP concise classification strings (sccs).
00101 
00102     a.4.5.1 < a.4.5.11 < b.1.1.1
00103     
00104     A sccs (e.g. a.4.5.11) compactly represents a domain's classification.
00105     The letter represents the class, and the numbers are the fold,
00106     superfamily, and family, respectively.
00107 
00108     """
00109 
00110     s1 = sccs1.split(".")
00111     s2 = sccs2.split(".")
00112 
00113     if s1[0] != s2[0]: return _cmp(s1[0], s2[0])
00114 
00115     s1 = list(map(int, s1[1:]))
00116     s2 = list(map(int, s2[1:]))
00117 
00118     return _cmp(s1,s2)
00119 

Here is the caller graph for this function:

def Bio.SCOP.parse_domain (   str)
Convert an ASTRAL header string into a Scop domain.

An ASTRAL (http://astral.stanford.edu/) header contains a concise
description of a SCOP domain. A very similar format is used when a
Domain object is converted into a string.  The Domain returned by this
method contains most of the SCOP information, but it will not be located
within the SCOP hierarchy (i.e. The parent node will be None). The
description is composed of the SCOP protein and species descriptions.

A typical ASTRAL header looks like --
>d1tpt_1 a.46.2.1 (1-70) Thymidine phosphorylase {Escherichia coli}

Definition at line 122 of file __init__.py.

00122 
00123 def parse_domain(str):
00124     """Convert an ASTRAL header string into a Scop domain.
00125 
00126     An ASTRAL (http://astral.stanford.edu/) header contains a concise
00127     description of a SCOP domain. A very similar format is used when a
00128     Domain object is converted into a string.  The Domain returned by this
00129     method contains most of the SCOP information, but it will not be located
00130     within the SCOP hierarchy (i.e. The parent node will be None). The
00131     description is composed of the SCOP protein and species descriptions.
00132 
00133     A typical ASTRAL header looks like --
00134     >d1tpt_1 a.46.2.1 (1-70) Thymidine phosphorylase {Escherichia coli}
00135     """
00136 
00137     m = _domain_re.match(str)
00138     if (not m) : raise ValueError("Domain: "+ str)
00139 
00140     dom = Domain()
00141     dom.sid = m.group(1)
00142     dom.sccs = m.group(2)
00143     dom.residues = Residues(m.group(3))
00144     if not dom.residues.pdbid:
00145         dom.residues.pdbid= dom.sid[1:5]
00146     dom.description = m.group(4).strip()
00147 
00148     return dom

Here is the caller graph for this function:

def Bio.SCOP.search (   pdb = None,
  key = None,
  sid = None,
  disp = None,
  dir = None,
  loc = None,
  cgi = 'http://scop.mrc-lmb.cam.ac.uk/scop/search.cgi',
  keywds 
)
search(pdb=None, key=None, sid=None, disp=None, dir=None, loc=None,
cgi='http://scop.mrc-lmb.cam.ac.uk/scop/search.cgi', **keywds)

Access search.cgi and return a handle to the results.  See the
online help file for an explanation of the parameters:
http://scop.mrc-lmb.cam.ac.uk/scop/help.html

Raises an IOError if there's a network error.

Definition at line 877 of file __init__.py.

00877 
00878            cgi='http://scop.mrc-lmb.cam.ac.uk/scop/search.cgi', **keywds):
00879     """search(pdb=None, key=None, sid=None, disp=None, dir=None, loc=None,
00880     cgi='http://scop.mrc-lmb.cam.ac.uk/scop/search.cgi', **keywds)
00881 
00882     Access search.cgi and return a handle to the results.  See the
00883     online help file for an explanation of the parameters:
00884     http://scop.mrc-lmb.cam.ac.uk/scop/help.html
00885 
00886     Raises an IOError if there's a network error.
00887 
00888     """
00889     params = {'pdb' : pdb, 'key' : key, 'sid' : sid, 'disp' : disp,
00890               'dir' : dir, 'loc' : loc}
00891     variables = {}
00892     for k, v in params.iteritems():
00893         if v is not None:
00894             variables[k] = v
00895     variables.update(keywds)
00896     return _open(cgi, variables)

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 87 of file __init__.py.

tuple Bio.SCOP._domain_re = re.compile(r">?([\w_\.]*)\s+([\w\.]*)\s+\(([^)]*)\) (.*)")

Definition at line 120 of file __init__.py.

Initial value:
00001 { 'class': 'cl', 'fold': 'cf', 'superfamily': 'sf',
00002                      'family': 'fa', 'protein': 'dm', 'species': 'sp', 'domain': 'px'}

Definition at line 65 of file __init__.py.

list Bio.SCOP.astralBibIds = [10,20,25,30,35,40,50,70,90,95,100]

Definition at line 70 of file __init__.py.

Initial value:
00001 { 10: 'e+1', 5: 'e+0,7', 1: 'e+0', 0.5: 'e-0,3', 0.1: 'e-1',
00002                      0.05: 'e-1,3', 0.01: 'e-2', 0.005: 'e-2,3', 0.001: 'e-3',
00003                      1e-4: 'e-4',  1e-5: 'e-5', 1e-10: 'e-10', 1e-15: 'e-15',
00004                      1e-20: 'e-20', 1e-25: 'e-25', 1e-50: 'e-50' }

Definition at line 75 of file __init__.py.

Initial value:
00001 { 10: 'e1', 5: 'e0_7', 1: 'e0', 0.5: 'e_0_3', 0.1: 'e_1',
00002                      0.05: 'e_1_3', 0.01: 'e_2', 0.005: 'e_2_3', 0.001: 'e_3',
00003                      1e-4: 'e_4',  1e-5: 'e_5', 1e-10: 'e_10', 1e-15: 'e_15',
00004                      1e-20: 'e_20', 1e-25: 'e_25', 1e-50: 'e_50' }

Definition at line 80 of file __init__.py.

Initial value:
00001 [10, 5, 1, 0.5, 0.1, 0.05, 0.01, 0.005, 0.001, 1e-4, 1e-5, 1e-10, 1e-15,
00002              1e-20, 1e-25, 1e-50]

Definition at line 72 of file __init__.py.

Initial value:
00001 { 'cl':'class', 'cf':'fold', 'sf':'superfamily',
00002                  'fa':'family', 'dm':'protein', 'sp':'species', 'px':'domain'}

Definition at line 61 of file __init__.py.

list Bio.SCOP.nodeCodeOrder = [ 'ro', 'cl', 'cf', 'sf', 'fa', 'dm', 'sp', 'px' ]

Definition at line 68 of file __init__.py.