Domain Annotator#

class chamois.domains.DomainAnnotator#

An abstract class for annotating genes with protein domains.

abstractmethod annotate_domains(proteins, progress=None)#

Run annotation on proteins of genes and update their domains.

Parameters:

genes (Iterable of Protein) – An iterable that yields proteins to annotate.

property total#

The total number of features to annotate.

Type:

int or None

class chamois.domains.PfamAnnotator(path=None, cpus=None, whitelist=None)#

A domain annotator that uses pyhmmer to find Pfam domains in proteins.

__init__(path=None, cpus=None, whitelist=None)#

Prepare a new HMMER annotation handler with the given hmms.

Parameters:
  • file (pathlib.Path) – The path to the file containing the Pfam HMMs.

  • cpus (int, optional) – The number of CPUs to allocate for the hmmsearch command. Give None to use the default.

  • whitelist (Container of str) – If given, a container containing the accessions of the individual HMMs to annotate with. If None is given, annotate with the entire file.

annotate_domains(proteins, progress=None)#

Run annotation on proteins of genes and update their domains.

Parameters:

genes (Iterable of Protein) – An iterable that yields proteins to annotate.

disentangle_domains(domains)#

Pick the best domain from overlapping domains in each protein.

property total#

The total number of features to annotate.

Type:

int or None