squid.impress

Module Contents

Classes

hidden_prints

Function to temporarily hide print statements.

Functions

plot_y_hist(y_mut[, save_dir])

Function for visualizing histogram of inferred predictions for MAVE dataset.

plot_performance(model, info[, save_dir])

Function for visualizing MAVE-NN model training performance.

plot_additive_logo(logo[, center, view_window, ...])

Function for visualizing MAVE-NN additive model parameters.

plot_pairwise_matrix(theta_lclc[, view_window, ...])

Function for visualizing MAVE-NN pairwise model parameters.

plot_y_vs_yhat(model, mave_df[, save_dir])

Function for visualizing comparison of MAVE values and MAVE-NN predictions.

plot_y_vs_phi(model, mave_df[, save_dir])

Function for visualizing comparison of MAVE values and MAVE-NN latent phenotypes.

plot_eig_vals(vals[, save_dir])

Function for visualizing eigenvalue spectrum, if using PCA.

plot_eig_vecs(U, v1, v2[, save_dir])

Function for visualizing subspace defined by two eigenvectors, if using PCA.

squid.impress.plot_y_hist(y_mut, save_dir=None)[source]

Function for visualizing histogram of inferred predictions for MAVE dataset.

Parameters:
  • y_mut (numpy.ndarray) – Inferred predictions for sequences (shape: (N,1)).

  • save_dir (str) – Directory for saving figures to file.

Return type:

matplotlib.pyplot.Figure

squid.impress.plot_performance(model, info, save_dir=None)[source]

Function for visualizing MAVE-NN model training performance.

Parameters:
  • model (mavenn.src.model.Model) – MAVE-NN model object.

  • info (float) – MAVE-NN estimated variational information (I_pred), in bits.

  • save_dir (str) – Directory for saving figures to file.

Return type:

matplotlib.pyplot.Figure

Function for visualizing MAVE-NN additive model parameters.

Parameters:
  • logo (numpy.ndarray) – Additive model parameters (shape: (L,C)).

  • center (bool) – If True, the stack of characters at each position will be centered around zero. This is accomplished by subtracting the mean value in each row of the matrix from each element in that row.

  • view_window ([int, int]) – Index of start and stop position along sequence to probe; i.e., [start, stop], where start < stop and both entries satisfy 0 <= int <= L.

  • alphabet (list) – The alphabet used to determine the C characters in the logo such that each entry is a string; e.g., [‘A’,’C’,’G’,’T’] for DNA.

  • fig_size ([float, float]) – Width, height in inches for matplotlib.pyplot figure.

  • save_dir (str) – Directory for saving figure to file.

  • save_name (str) – If save_dir is not None, save_name sets the filename for saving figure to file.

Return type:

matplotlib.pyplot.Figure

squid.impress.plot_pairwise_matrix(theta_lclc, view_window=None, alphabet=['A', 'C', 'G', 'T'], threshold=None, save_dir=None)[source]

Function for visualizing MAVE-NN pairwise model parameters.

Parameters:
  • theta_lclc (numpy.ndarray) – Pairwise model parameters (shape: (L,C,L,C)).

  • view_window ([int, int]) – Index of start and stop position along sequence to probe; i.e., [start, stop], where start < stop and both entries satisfy 0 <= int <= L.

  • alphabet (list) – The alphabet used to determine the C characters in the logo such that each entry is a string; e.g., [‘A’,’C’,’G’,’T’] for DNA.

  • threshold (float) – Define threshold window centered around zero for removing potential noise from parameters for cleaner pairwise matrix visualization

  • save_dir (str) – Directory for saving figures to file.

Return type:

matplotlib.pyplot.Figure

squid.impress.plot_y_vs_yhat(model, mave_df, save_dir=None)[source]

Function for visualizing comparison of MAVE values and MAVE-NN predictions.

Parameters:
  • model (mavenn.src.model.Model) – MAVE-NN model object.

  • mave_df (pandas.core.frame.DataFrame) – Dataframe containing MAVE training splits, y floats, and x strings (shape : (N,3))

  • save_dir (str) – Directory for saving figures to file.

Return type:

matplotlib.pyplot.Figure

squid.impress.plot_y_vs_phi(model, mave_df, save_dir=None)[source]

Function for visualizing comparison of MAVE values and MAVE-NN latent phenotypes.

Parameters:
  • model (mavenn.src.model.Model) – MAVE-NN model object.

  • mave_df (pandas.core.frame.DataFrame) – Dataframe containing MAVE training splits, y floats, and x strings (shape : (N,3))

  • save_dir (str) – Directory for saving figures to file.

Return type:

matplotlib.pyplot.Figure

squid.impress.plot_eig_vals(vals, save_dir=None)[source]

Function for visualizing eigenvalue spectrum, if using PCA.

Parameters:
  • vals (numpy.ndarray) – Eigenvalues obtained from PCA.

  • save_dir (str) – Directory for saving figures to file.

Return type:

matplotlib.pyplot.Figure

squid.impress.plot_eig_vecs(U, v1, v2, save_dir=None)[source]

Function for visualizing subspace defined by two eigenvectors, if using PCA.

Parameters:
  • U (numpy.ndarray) – Eigenvectors obtained from PCA.

  • v1 (int) – Index of first eigenvector.

  • v2 (int) – Index of second eigenvector.

  • save_dir (str) – Directory for saving figures to file.

Return type:

matplotlib.pyplot.Figure

class squid.impress.hidden_prints[source]

Function to temporarily hide print statements.

__enter__()[source]
__exit__(exc_type, exc_val, exc_tb)[source]