Bio.SCOP package
Submodules
Module contents
SCOP: Structural Classification of Proteins.
The SCOP database aims to provide a manually constructed classification of all know protein structures into a hierarchy, the main levels of which are family, superfamily and fold.
“Introduction”:http://scop.mrc-lmb.cam.ac.uk/legacy/intro.html
“SCOP parsable files”:http://scop.mrc-lmb.cam.ac.uk/legacy/parse/
The Scop object in this module represents the entire SCOP classification. It can be built from the three SCOP parsable files, modified is so desired, and converted back to the same file formats. A single SCOP domain (represented by the Domain class) can be obtained from Scop using the domain’s SCOP identifier (sid).
- nodeCodeDict – A mapping between known 2 letter node codes and a longer
description. The known node types are ‘cl’ (class), ‘cf’ (fold), ‘sf’ (superfamily), ‘fa’ (family), ‘dm’ (domain), ‘sp’ (species), ‘px’ (domain). Additional node types may be added in the future.
This module also provides code to access SCOP over the WWW.
- Functions:
search – Access the main CGI script (DEPRECATED, no longer available)..
_open – Internally used function.
- 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.
- Bio.SCOP.parse_domain(term)
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}
- class Bio.SCOP.Scop(cla_handle=None, des_handle=None, hie_handle=None, dir_path=None, db_handle=None, version=None)
Bases:
object
The entire SCOP hierarchy.
root – The root node of the hierarchy
- __init__(cla_handle=None, des_handle=None, hie_handle=None, dir_path=None, db_handle=None, version=None)
Build the SCOP hierarchy from the SCOP parsable files, or a sql backend.
If no file handles are given, then a Scop object with a single empty root node is returned.
If a directory and version are given (with dir_path=.., version=…) or file handles for each file, the whole scop tree will be built in memory.
If a MySQLdb database handle is given, the tree will be built as needed, minimising construction times. To build the SQL database to the methods write_xxx_sql to create the tables.
- getRoot()
Get root node.
- getDomainBySid(sid)
Return a domain from its sid.
- getNodeBySunid(sunid)
Return a node from its sunid.
- getDomains()
Return an ordered tuple of all SCOP Domains.
- write_hie(handle)
Build an HIE SCOP parsable file from this object.
- write_des(handle)
Build a DES SCOP parsable file from this object.
- write_cla(handle)
Build a CLA SCOP parsable file from this object.
- getDomainFromSQL(sunid=None, sid=None)
Load a node from the SQL backend using sunid or sid.
- getAscendentFromSQL(node, type)
Get ascendents using SQL backend.
- getDescendentsFromSQL(node, type)
Get descendents of a node using the database backend.
This avoids repeated iteration of SQL calls and is therefore much quicker than repeatedly calling node.getChildren().
- write_hie_sql(handle)
Write HIE data to SQL database.
- write_cla_sql(handle)
Write CLA data to SQL database.
- write_des_sql(handle)
Write DES data to SQL database.
- class Bio.SCOP.Node(scop=None)
Bases:
object
A node in the Scop hierarchy.
- Attributes:
sunid – SCOP unique identifiers. e.g. ‘14986’
parent – The parent node
children – A list of child nodes
sccs – SCOP concise classification string. e.g. ‘a.1.1.2’
type – A 2 letter node type code. e.g. ‘px’ for domains
description – Description text.
- __init__(scop=None)
Initialize a Node in the scop hierarchy.
If a Scop instance is provided to the constructor, this will be used to lookup related references using the SQL methods. If no instance is provided, it is assumed the whole tree exists and is connected.
- __str__()
Represent the node as a string.
- toHieRecord()
Return an Hie.Record.
- toDesRecord()
Return a Des.Record.
- getChildren()
Return a list of children of this Node.
- getParent()
Return the parent of this Node.
- getDescendents(node_type)
Return a list of all descendant nodes of the given type.
Node type can be a two letter code or longer description, e.g. ‘fa’ or ‘family’.
- getAscendent(node_type)
Return the ancenstor node of the given type, or None.
Node type can be a two letter code or longer description, e.g. ‘fa’ or ‘family’.
- class Bio.SCOP.Domain(scop=None)
Bases:
Node
A SCOP domain. A leaf node in the Scop hierarchy.
- Attributes:
sid - The SCOP domain identifier. e.g.
"d5hbib_"
residues - A Residue object. It defines the collection of PDB atoms that make up this domain.
- __init__(scop=None)
Initialize a SCOP Domain object.
- __str__()
Represent the SCOP Domain as a string.
- toDesRecord()
Return a Des.Record.
- toClaRecord()
Return a Cla.Record.
- class Bio.SCOP.Astral(dir_path=None, version=None, scop=None, astral_file=None, db_handle=None)
Bases:
object
Representation of the ASTRAL database.
Abstraction of the ASTRAL database, which has sequences for all the SCOP domains, as well as clusterings by percent id or evalue.
- __init__(dir_path=None, version=None, scop=None, astral_file=None, db_handle=None)
Initialize the astral database.
- You must provide either a directory of SCOP files:
- dir_path - string, the path to location of the scopseq-x.xx directory
(not the directory itself), and
version -a version number.
- or, a FASTA file:
astral_file - string, a path to a fasta file (which will be loaded in memory)
- or, a MYSQL database:
db_handle - a database handle for a MYSQL database containing a table ‘astral’ with the astral data in it. This can be created using writeToSQL.
- domainsClusteredByEv(id)
Get domains clustered by evalue.
- domainsClusteredById(id)
Get domains clustered by percentage identity.
- getAstralDomainsFromFile(filename=None, file_handle=None)
Get the scop domains from a file containing a list of sids.
- getAstralDomainsFromSQL(column)
Load ASTRAL domains from the MySQL database.
Load a set of astral domains from a column in the astral table of a MYSQL database (which can be created with writeToSQL(…).
- getSeqBySid(domain)
Get the seq record of a given domain from its sid.
- getSeq(domain)
Return seq associated with domain.
- hashedDomainsById(id)
Get domains clustered by sequence identity in a dict.
- hashedDomainsByEv(id)
Get domains clustered by evalue in a dict.
- isDomainInId(dom, id)
Return true if the domain is in the astral clusters for percent ID.
- isDomainInEv(dom, id)
Return true if the domain is in the ASTRAL clusters for evalues.
- writeToSQL(db_handle)
Write the ASTRAL database to a MYSQL database.
- Bio.SCOP.search(pdb=None, key=None, sid=None, disp=None, dir=None, loc=None, cgi='http://scop.mrc-lmb.cam.ac.uk/legacy/search.cgi', **keywds)
Access SCOP search and return a handle to the results (DEPRECATED).
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/legacy/help.html
Raises an IOError if there’s a network error.
This function is now DEPRECATED and will be removed in a future release of Biopython because this search.cgi API is no longer available with SCOP now hosted the the EBI.