cathpy.models

Provides access to classes that representing general entities such as amino acids, db identifiers, etc.

from cathpy.models import (
    AminoAcid, AminoAcids,
    CathID, FunfamID,
    ClusterFile, )

aa = AminoAcids.get_by_id('A')

aa.one                      # 'A'
aa.three                    # 'ala'
aa.word                     # 'alanine'

AminoAcids.is_valid_aa('Z') # False

cathid = CathID("1.10.8.10.1")

cathid.sfam_id              # '1.10.8.10'
cathid.depth                # 5
cathid.cath_id_to_depth(3)  # '1.10.8'

funfam_file = ClusterFile("/path/to/1.10.8.10-ff-1234.reduced.sto")

funfam_file.path            # '/path/to/'
funfam_file.sfam_id         # '1.10.8.10'
funfam_file.cluster_num     # 1234
funfam_file.cluster_type    # 'ff'
funfam_file.desc            # 'reduced'
funfam_file.suffix          # '.sto'

Collection of classes used to model CATH data

class cathpy.models.AminoAcid(one, three, word)

Class representing an Amino Acid.

class cathpy.models.AminoAcids

Provides access to recognised Amino Acids.

classmethod get_by_id(aa_letter)

Return the AminoAcid object by the given single character aa code.

classmethod is_valid_aa(aa_letter)

Check if aa is a valid single character aa code.

class cathpy.models.CathID(cath_id)

Represents a CATH ID.

cath_id

Returns the CATH ID as a string.

cath_id_to_depth(depth)

Returns the CATH ID as a string.

depth

Returns the depth of the CATH ID.

sfam_id

Returns the superfamily id of the CATH ID.

class cathpy.models.ClusterFile(path, *, dir=None, sfam_id=None, cluster_type=None, cluster_num=None, join_char=None, desc=None, suffix=None)

Object that represents a file relating to a CATH Cluster.

eg.

/path/to/1.10.8.10-ff-1234.sto
classmethod split_path(path)

Returns information about a cluster based on the path (filename).

to_string(join_char=None)

Represents the ClusterFile as a string (file path).

class cathpy.models.ClusterID(sfam_id, cluster_type, cluster_num)

Represents a Cluster Identifier (FunFam, SC, etc)

classmethod new_from_file(file)

Parse a new ClusterID from a filename.

class cathpy.models.FunfamID(sfam_id, cluster_num)

Object that represents a Funfam ID.

class cathpy.models.Residue(aa, seq_num=None, pdb_label=None, *, pdb_aa=None)

Class to represent a protein residue.

class cathpy.models.Scan(*, results, **kwargs)

Object to store a sequence scan.

class cathpy.models.ScanHit(*, match_name, match_cath_id, match_description, match_length, hsps, significance, data, **kwargs)

Object to store a hit from a sequence scan.

class cathpy.models.ScanHsp(*, evalue, hit_start, hit_end, hit_string=None, homology_string=None, length, query_start, query_end, query_string=None, rank, score, **kwargs)

Object to store the High Scoring Pair (HSP) from a sequence scan.

class cathpy.models.ScanResult(*, query_name, hits, **kwargs)

Object to store a result from a sequence scan.

class cathpy.models.Segment(start: int, stop: int)

Class to represent a protein segment.