:py:mod:`squid.impress` ======================= .. py:module:: squid.impress Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: squid.impress.hidden_prints Functions ~~~~~~~~~ .. autoapisummary:: squid.impress.plot_y_hist squid.impress.plot_performance squid.impress.plot_additive_logo squid.impress.plot_pairwise_matrix squid.impress.plot_y_vs_yhat squid.impress.plot_y_vs_phi squid.impress.plot_eig_vals squid.impress.plot_eig_vecs .. py:function:: plot_y_hist(y_mut, save_dir=None) Function for visualizing histogram of inferred predictions for MAVE dataset. :param y_mut: Inferred predictions for sequences (shape: (N,1)). :type y_mut: numpy.ndarray :param save_dir: Directory for saving figures to file. :type save_dir: str :rtype: matplotlib.pyplot.Figure .. !! processed by numpydoc !! .. py:function:: plot_performance(model, info, save_dir=None) Function for visualizing MAVE-NN model training performance. :param model: MAVE-NN model object. :type model: mavenn.src.model.Model :param info: MAVE-NN estimated variational information (I_pred), in bits. :type info: float :param save_dir: Directory for saving figures to file. :type save_dir: str :rtype: matplotlib.pyplot.Figure .. !! processed by numpydoc !! .. py:function:: plot_additive_logo(logo, center=True, view_window=None, alphabet=['A', 'C', 'G', 'T'], fig_size=None, save_dir=None, save_name=None) Function for visualizing MAVE-NN additive model parameters. :param logo: Additive model parameters (shape: (L,C)). :type logo: numpy.ndarray :param center: 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. :type center: bool :param view_window: Index of start and stop position along sequence to probe; i.e., [start, stop], where start < stop and both entries satisfy 0 <= int <= L. :type view_window: [int, int] :param alphabet: 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. :type alphabet: list :param fig_size: Width, height in inches for matplotlib.pyplot figure. :type fig_size: [float, float] :param save_dir: Directory for saving figure to file. :type save_dir: str :param save_name: If save_dir is not None, save_name sets the filename for saving figure to file. :type save_name: str :rtype: matplotlib.pyplot.Figure .. !! processed by numpydoc !! .. py:function:: plot_pairwise_matrix(theta_lclc, view_window=None, alphabet=['A', 'C', 'G', 'T'], threshold=None, save_dir=None) Function for visualizing MAVE-NN pairwise model parameters. :param theta_lclc: Pairwise model parameters (shape: (L,C,L,C)). :type theta_lclc: numpy.ndarray :param view_window: Index of start and stop position along sequence to probe; i.e., [start, stop], where start < stop and both entries satisfy 0 <= int <= L. :type view_window: [int, int] :param alphabet: 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. :type alphabet: list :param threshold: Define threshold window centered around zero for removing potential noise from parameters for cleaner pairwise matrix visualization :type threshold: float :param save_dir: Directory for saving figures to file. :type save_dir: str :rtype: matplotlib.pyplot.Figure .. !! processed by numpydoc !! .. py:function:: plot_y_vs_yhat(model, mave_df, save_dir=None) Function for visualizing comparison of MAVE values and MAVE-NN predictions. :param model: MAVE-NN model object. :type model: mavenn.src.model.Model :param mave_df: Dataframe containing MAVE training splits, y floats, and x strings (shape : (N,3)) :type mave_df: pandas.core.frame.DataFrame :param save_dir: Directory for saving figures to file. :type save_dir: str :rtype: matplotlib.pyplot.Figure .. !! processed by numpydoc !! .. py:function:: plot_y_vs_phi(model, mave_df, save_dir=None) Function for visualizing comparison of MAVE values and MAVE-NN latent phenotypes. :param model: MAVE-NN model object. :type model: mavenn.src.model.Model :param mave_df: Dataframe containing MAVE training splits, y floats, and x strings (shape : (N,3)) :type mave_df: pandas.core.frame.DataFrame :param save_dir: Directory for saving figures to file. :type save_dir: str :rtype: matplotlib.pyplot.Figure .. !! processed by numpydoc !! .. py:function:: plot_eig_vals(vals, save_dir=None) Function for visualizing eigenvalue spectrum, if using PCA. :param vals: Eigenvalues obtained from PCA. :type vals: numpy.ndarray :param save_dir: Directory for saving figures to file. :type save_dir: str :rtype: matplotlib.pyplot.Figure .. !! processed by numpydoc !! .. py:function:: plot_eig_vecs(U, v1, v2, save_dir=None) Function for visualizing subspace defined by two eigenvectors, if using PCA. :param U: Eigenvectors obtained from PCA. :type U: numpy.ndarray :param v1: Index of first eigenvector. :type v1: int :param v2: Index of second eigenvector. :type v2: int :param save_dir: Directory for saving figures to file. :type save_dir: str :rtype: matplotlib.pyplot.Figure .. !! processed by numpydoc !! .. py:class:: hidden_prints Function to temporarily hide print statements. .. !! processed by numpydoc !! .. py:method:: __enter__() .. py:method:: __exit__(exc_type, exc_val, exc_tb)