API Reference

cocoatree: Overall functions

Functions

perform_sca(sequences_id, sequences[, ...])

Perform statistical coupling analysis (SCA)

cocoatree.io: Functions to import and export files

Functions

io.load_MSA(file_path[, format, clean, verbose])

Read in a multiple sequence alignment (MSA)

io.load_tree_ete3(file_path)

From the loading of a Newick tree, generate a ete3.Tree object

io.export_fasta(sequences, sequences_id, outpath)

Export intermediate files in fasta format

io.load_pdb(path2pdb, pdb_id, chain)

Read in a PDB file.

io.export_sector_for_pymol(mapping, ...)

Export sector information for mapping on 3D structure in PyMOL.

cocoatree.datasets: Utilities to load popular datasets.

Functions

datasets.load_S1A_serine_proteases([paper])

Load the S1A serine protease dataset

datasets.load_rhomboid_proteases()

Load the rhomboid protease dataset

cocoatree.msa: Manipulating multiple sequence alignment and sequences

Functions

msa.filter_sequences(sequences, sequences_id)

Filter sequences

msa.filter_seq_id(sequences, sequences_id, ...)

Filter sequences based on list

msa.filter_ref_seq(sequences, sequences_id)

Filter the alignment based on identity with a reference sequence

msa.map_to_pdb(pdb_seq, pdb_pos, sequences, ...)

Mapping of the unfiltered MSA positions on a PDB structure.

msa.compute_seq_identity(sequences)

Computes the identity between sequences in a MSA (as Hamming's pairwise distance)

msa.compute_seq_weights(sequences[, ...])

Compute sequence weights

msa.map_msa_positions(n_loaded_pos, ...)

Maps positions between the original and the filtered MSA

cocoatree.statistics: Computation of position-specific and pairwise statistics

Functions

statistics.compute_all_frequencies(sequences)

Compute frequencies on sequences

statistics.pairwise.compute_sca_matrix(sequences)

Compute the SCA coevolution matrix

statistics.pairwise.compute_mutual_information_matrix(...)

Compute the mutual information matrix

statistics.pairwise.compute_apc(MIij)

Computes the average product correction (APC) as described in Dunn et al. (2008).

statistics.pairwise.compute_entropy_correction(...)

Computes the entropy correction according to Vorberg et al. (2018).

statistics.position.compute_entropy(aa_freq)

Computes Shannon's entropy for each position in the alignment

statistics.position.compute_conservation(...)

Compute the conservation of amino acid at each position.

cocoatree.deconvolution: Co-evolution matrix deconvolution

Functions

deconvolution.extract_independent_components(...)

Extract independent components from a coevolution matrix

deconvolution.extract_principal_components(...)

Perform principal component decomposition of a coevolution matrix

deconvolution.extract_sectors(...)

Extract residue positions of sectors

deconvolution.substract_first_principal_component(...)

Remove global correlations

cocoatree.visualization: Visualization with ete3

Module to visualize phylogenetic trees along with sectors

Functions

visualization.update_tree_ete3_and_return_style(...)

Update ete3 tree with sector info and attributes and return tree_style for further visualization.