CATH Access Functions

This module defines functions for query CATH database.

class prody.database.cath.CATHDB(source='http://download.cathdb.info')[source]

This class is for handing the data in the CATH database. It facilitates tree navigation and ID-based searching.

find(identifier='root')[source]

Find an xml.etree.Element object given identifier.

findall(path, namespaces=None)

Find all matching subelements by tag name or path.

Same as getroot().findall(path), which is Element.findall().

path is a string having either an element tag or an XPath, namespaces is an optional mapping from namespace prefix to full name.

Return list containing all matching elements in document order.

findtext(path, default=None, namespaces=None)

Find first matching element by tag name or path.

Same as getroot().findtext(path), which is Element.findtext()

path is a string having either an element tag or an XPath, namespaces is an optional mapping from namespace prefix to full name.

Return the first matching element, or None if no element was found.

getroot()

Return root element of this tree.

iter(tag=None)

Create and return tree iterator for the root element.

The iterator loops over all elements in this tree, in document order.

tag is a string with the tag name to iterate over (default is to return all elements).

iterfind(path, namespaces=None)

Find all matching subelements by tag name or path.

Same as getroot().iterfind(path), which is element.iterfind()

path is a string having either an element tag or an XPath, namespaces is an optional mapping from namespace prefix to full name.

Return an iterable yielding all matching elements in document order.

parse(source, parser=None)

Load external XML document into element tree.

source is a file name or file object, parser is an optional parser instance that defaults to XMLParser.

ParseError is raised if the parser fails to parse the document.

Returns the root element of the given source document.

save(filename='cath.xml')[source]

Write local CATH database to an XML file. filename can either be a file name or a handle.

search(identifier)[source]

Search the identifier against the local CATH database and return a list of ElementTree instances. identifier can be a 4-digit PDB ID plus an 1-digit chain ID (optional), 7-digit domain ID, or CATH ID.

update(source=None)[source]

Update data and files from CATH.

write(file_or_filename, encoding=None, xml_declaration=None, default_namespace=None, method=None, *, short_empty_elements=True)

Write element tree to a file as XML.

Arguments:

file_or_filename – file name or a file object opened for writing

encoding – the output encoding (default: US-ASCII)

xml_declaration – bool indicating if an XML declaration should be

added to the output. If None, an XML declaration is added if encoding IS NOT either of: US-ASCII, UTF-8, or Unicode

default_namespace – sets the default XML namespace (for “xmlns”)

method – either “xml” (default), “html, “text”, or “c14n”

short_empty_elements – controls the formatting of elements

that contain no content. If True (default) they are emitted as a single self-closed tag, otherwise they are emitted as a pair of start/end tags

class prody.database.cath.CATHElement(tag, attrib={}, parent=None, **extra)[source]

This class handles individual elements from the cath tree including tree navigation and the getting of associated CATH domains, PDB IDs and selection strings.

attrib

Dictionary of the element’s attributes.

parsePDBs(**kwargs)[source]

Load PDB into memory as AtomGroup instances using parsePDB() and perform selection based on residue ranges given by CATH.

tag

The element’s name.

tail

Text after this element’s end tag, but before the next sibling element’s start tag. This is either a string or the value None. Note that if there was no text, this attribute may be either None or an empty string, depending on the parser.

text

Text before first subelement. This is either a string or the value None. Note that if there is no text, this attribute may be either None or the empty string, depending on the parser.