memo_ms.visualization module

memo_ms.visualization.plot_hca(matrix, df_metadata, filename_col, group_col, plotly_discrete_cm=['#636EFA', '#EF553B', '#00CC96', '#AB63FA', '#FFA15A', '#19D3F3', '#FF6692', '#B6E880', '#FF97FF', '#FECB52'], linkage_method='ward', linkage_metric='euclidean', norm=False, scaling=False)[source]

Simple HCA plot of a MEMO matrix / Feature table using matplotlib

Args:

matrix (DataFrame): A Table in the MemoMatrix.memo_matrix or FeatureTable.feature_table format df_metadata (DataFrame): Metadata of the MEMO matrix samples filename_col (str): Column name in df_metadata to match memo_matrix index group_col (str): Column name in df_metadata to use as groups for plotting plotly_discrete_cm ([type], optional): Plotly discrete colormap to use for groups. Defaults to px.colors.qualitative.Plotly. linkage_method (str, optional): Linkage method to use. Defaults to ‘ward’. linkage_metric (str, optional): Linkage metric to use. Defaults to ‘euclidean’. norm (bool, optional): Apply samples normalization. Defaults to False. scaling (bool, optional): Apply pareto scaling to MEMO matrix columns. Defaults to False.

Returns:

None

memo_ms.visualization.plot_heatmap(matrix, df_metadata, filename_col, group_col, plotly_discrete_cm=['#636EFA', '#EF553B', '#00CC96', '#AB63FA', '#FFA15A', '#19D3F3', '#FF6692', '#B6E880', '#FF97FF', '#FECB52'], linkage_method='ward', linkage_metric='euclidean', heatmap_metric='braycurtis', norm=False, scaling=False)[source]

HCA and heatmap plot of a MEMO matrix / Feature table using Plotly

Args:

matrix (DataFrame): A Table in the MemoMatrix.memo_matrix or FeatureTable.feature_table format df_metadata (DataFrame): Metadata of the MEMO matrix samples filename_col (str): Column name in df_metadata to match memo_matrix index group_col (str): Column name in df_metadata to use as groups for plotting plotly_discrete_cm ([type], optional): Plotly discrete colormap to use for groups. Defaults to px.colors.qualitative.Plotly. linkage_method (str, optional): Linkage method to use. Defaults to ‘ward’. linkage_metric (str, optional): Linkage metric to use. Defaults to ‘euclidean’. heatmap_metric (str, optional): Distance metric to use for heatmap. Defaults to ‘braycurtis’. norm (bool, optional): Apply samples normalization. Defaults to False. scaling (bool, optional): Apply pareto scaling to MEMO matrix columns. Defaults to False.

Returns:

None

memo_ms.visualization.plot_pcoa_2d(matrix, df_metadata, filename_col, group_col, metric='braycurtis', norm=False, scaling=False, pc_to_plot=(1, 2))[source]

Simple 2D PCoA plot of a MEMO matrix / Feature table using Plotly

Args:

matrix (DataFrame): A Table in the MemoMatrix.memo_matrix or FeatureTable.feature_table format df_metadata (DataFrame): Metadata of the MEMO matrix samples filename_col (str): Column name in df_metadata to match memo_matrix index group_col (str): Column name in df_metadata to use as groups for plotting metric (str, optional): Distance metric to use, see https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.distance.pdist.html. Defaults to ‘braycurtis’. norm (bool, optional): Apply samples normalization. Defaults to False. scaling (bool, optional): Apply pareto scaling to MEMO matrix columns. Defaults to False. pc_to_plot (list of int, optional): PCs to plot. Defaults to [1,2].

Returns:

None

memo_ms.visualization.plot_pcoa_3d(matrix, df_metadata, filename_col, group_col, metric='braycurtis', norm=False, scaling=False, pc_to_plot=(1, 2, 3))[source]

Simple 2D PCoA plot of a MEMO matrix / Feature table using Plotly

Args:

matrix (DataFrame): A Table in the MemoMatrix.memo_matrix or FeatureTable.feature_table format df_metadata (DataFrame): Metadata of the MEMO matrix samples filename_col (str): Column name in df_metadata to match memo_matrix index group_col (str): Column name in df_metadata to use as groups for plotting metric (str, optional): Distance metric to use, see https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.distance.pdist.html. Defaults to ‘braycurtis’. norm (bool, optional): Apply samples normalization. Defaults to False. scaling (bool, optional): Apply pareto scaling to MEMO matrix columns. Defaults to False. pc_to_plot (list of int, optional): PCs to plot. Defaults to [1,2,3].

Returns:

None