Utils#

Utility functions for models and metrics. Plotting functionality for models mapping sequences to either embedding- or property-space. Diagnostics to evaluate embedding models alignment with the feature(s) of interest.

Projections#

Projection and visualization of sequence embeddings.

seqme.utils.pca

Project embeddings into 2D using PCA.

seqme.utils.tsne

Project embeddings into 2D using t-SNE.

seqme.utils.umap

Project embeddings into 2D using UMAP.

seqme.utils.plot_embeddings

Plot projections for one or more groups.

Diagnostics#

Helpers to select an appropriate embedding model.

seqme.utils.spearman_alignment_score

Compute the Spearman correlation coefficient using the pairwise distance between embedding spaces.

seqme.utils.knn_alignment_score

Compute the k-NN feature alignment score of an embedding model.

seqme.utils.plot_knn_alignment_score

Plot the k-NN feature alignment score of an embedding model using variable-number of neighbors.

Sequence Operations#

Helpers for generating and transforming sequence data.

seqme.utils.shuffle_characters

Randomly shuffle characters within each sequence.

seqme.utils.subsample

Sample a subset of the sequences without replacement.