squid.impress
Module Contents
Classes
Function to temporarily hide print statements. |
Functions
|
Function for visualizing histogram of inferred predictions for MAVE dataset. |
|
Function for visualizing MAVE-NN model training performance. |
|
Function for visualizing MAVE-NN additive model parameters. |
|
Function for visualizing MAVE-NN pairwise model parameters. |
|
Function for visualizing comparison of MAVE values and MAVE-NN predictions. |
|
Function for visualizing comparison of MAVE values and MAVE-NN latent phenotypes. |
|
Function for visualizing eigenvalue spectrum, if using PCA. |
|
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.
- squid.impress.plot_additive_logo(logo, center=True, view_window=None, alphabet=['A', 'C', 'G', 'T'], fig_size=None, save_dir=None, save_name=None)[source]
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.
Function to temporarily hide print statements.