Skip to content

module dca


function get_seqid

get_seqid(
    s1: Tensor,
    s2: Tensor | None = None,
    average: bool = False
) → Union[Tensor, Tuple[Tensor, Tensor]]

When average is True: - If s2 is provided, computes the mean and the standard deviation of the mean sequence identity between two sets of one-hot encoded sequences. - If s2 is a single sequence (L, q), it computes the mean and the standard deviation of the mean sequence identity between the dataset s1 and s2. - If s2 is none, computes the mean and the standard deviation of the mean of the sequence identity between s1 and a permutation of s1.

When average is False it returns the array of sequence identities.

Args:

  • s1 (torch.Tensor): Sequence dataset 1.
  • s2 (torch.Tensor | None): Sequence dataset 2. Defaults to None.
  • average (bool): Whether to return the average and standard deviation of the sequence identity or the array of sequence identities.

Returns:

  • torch.Tensor | Tuple[torch.Tensor, torch.Tensor]: List of sequence identities or mean sequence identity and standard deviation of the mean.

function set_zerosum_gauge

set_zerosum_gauge(params: Dict[str, Tensor]) → Dict[str, Tensor]

Sets the zero-sum gauge on the coupling matrix.

Args:

  • params (Dict[str, torch.Tensor]): Parameters of the model.

Returns:

  • Dict[str, torch.Tensor]: Parameters with fixed gauge.

function get_contact_map

get_contact_map(params: Dict[str, Tensor], tokens: str) → ndarray

Computes the contact map from the model coupling matrix.

Args:

  • params (Dict[str, torch.Tensor]): Model parameters.
  • tokens (str): Alphabet.

Returns:

  • np.ndarray: Contact map.

function get_mf_contact_map

get_mf_contact_map(
    data: Tensor,
    tokens: str,
    weights: Tensor | None = None
) → ndarray

Computes the contact map from the model coupling matrix.

Args:

  • data (torch.Tensor): Input one-hot data tensor.
  • tokens (str): Alphabet.
  • weights (torch.Tensor | None): Weights for the data points. Defaults to None.

Returns:

  • np.ndarray: Contact map.

This file was automatically generated via lazydocs.