src/scBONITA/singleCell.py
def makeAttractorAnalysisPlots(
        self,
        plottingData,
        distanceDF,
        attractorsAttribute="decider",
        allAttractors=False,
        numberOfAttractorsToShow=2,
        cmap="colorblind",
        makeFrequencyPlots=True,
        frequencyGrouping="",
        freqplotsFile="",
        makeUMAP=True,
        umapFile="",
    ):

        """Uses a dataframe of cells and the attractors to which they are assigned (usually the output of assignAttractors) to generate (a) a barplot showing the frequency of cells assigned to (selected) attractors, optionally faceted by user-specified variables and (b) a 2D scatterplot, such as a UMAP or tSNE plot, showing cells colored by the attractors to which they are assigned.

        Parameters
        ----------

        plottingData: pandas DataFrame
            Usually a 2-column dataframe where rows = cells (indices must contain the cells in the training dataset) and columns = UMAP or tSNE (or similar) dimensions
        distanceDF: pandas DataFrame
            Output of assignAttractors, usually. A pandas DataFrame where rows = cells (indices must contain the cells in the training dataset) and at least one column (specified by attractorsAttribute parameter, see below) contains the attractors to which the cells have been assigned
        attractorsAttribute: str
            The column in distanceDF which contains the attractors to which the cells have been assigned. Default is 'decider', as this is the name in the output of assignAttractors
        allAttractors: bool
            True if all assigned attractors are to be included in the frequency and UMAP plots. Should usually be 'True' for making preliminary analysis plots, and 'False' while making publication-quality plots, for ease of visualization and to leave out infrequent attractors.
        numberOfAttractorsToShow: int
            The number of attractors to be shown in the analysis plots. Used when allAttractors is False. Only the top (numberOfAttractorsToShow) most frequent attractors will be shown. The others will be collapsed into a single category "Others".
        cmap: str
            The matplotlib color palette to be used for the analysis plots. Consider using 'colorblind' if the number of categories/attractors is small and a continuous palette such as 'Blues' or 'Greens' if the number is large. See matplotlib documentation for more options on color palettes.
        makeFrequencyPlots: bool
            Should frequency plots be made?
        frequencyGrouping: str
            The variable in the plottingData columns which should be used for faceting the frequency plots. Eg. sample, batch, disease/control, etc.
        freqplotsFile: str
            Path to output PDF file for frequency plots. Default plots to the standard output.
        makeUMAP: bool
            Should UMAP plots be made?
        umapFile: str
            Path to output PDF file for UMAP plots. Default plots to the standard output.

        Returns
        -------
            None
        """

        if makeFrequencyPlots:
            # Make attractor frequency plots
            sns.set_context("talk")
            plt.figure(figsize=(5, 5))
            plottingData.loc[:, "Attractors"] = distanceDF[attractorsAttribute].astype(
                "category"
            )
            plottingData.loc[:, "Attractors"].cat.categories = [
                g for g in range(len(plottingData.loc[:, "Attractors"].cat.categories))
            ]
            if isinstance(allAttractors, list):
                plottingData.loc[:, "Attractors"] = [
                    temp if temp in allAttractors else "Other"
                    for temp in plottingData.loc[:, "Attractors"]
                ]
                palette = {}
                attrColors = {
                    key: value
                    for key, value in zip(
                        allAttractors,
                        list(
                            sns.color_palette(
                                "colorblind", n_colors=len(set(allAttractors))
                            )
                        ),
                    )
                }
                for attr in set(plottingData.Attractors):
                    if attr in allAttractors:
                        palette[attr] = attrColors[attr]
                    else:
                        palette[attr] = (0.75, 0.75, 0.75)
            else:
                plottingData.Attractors = [
                    temp
                    if temp
                    in plottingData.loc[:, "Attractors"]
                    .value_counts()[: numberOfAttractorsToShow + 1]
                    .index.tolist()
                    else "Other"
                    for temp in plottingData.loc[:, "Attractors"]
                ]
                allAttractors = (
                    plottingData.loc[:, "Attractors"]
                    .value_counts()[: numberOfAttractorsToShow + 1]
                    .index.tolist()
                )
                print(allAttractors)
                palette = {}
                attrColors = {
                    key: value
                    for key, value in zip(
                        allAttractors,
                        list(sns.color_palette(cmap, n_colors=len(set(allAttractors)))),
                    )
                }
                for attr in set(plottingData.loc[:, "Attractors"]):
                    if attr in allAttractors:
                        palette[attr] = attrColors[attr]
                    else:
                        palette[attr] = (0.75, 0.75, 0.75)
            if frequencyGrouping != "":
                histData = (
                    plottingData.groupby(by=frequencyGrouping)["Attractors"]
                    .value_counts(normalize=True)
                    .mul(100)
                    .rename("Percent")
                    .reset_index()
                )
                histData.columns = [frequencyGrouping, "Attractors", "Percent"]
                ax = sns.catplot(
                    data=histData,
                    y="Attractors",
                    x="Percent",
                    col=frequencyGrouping,
                    # palette=palette,
                    color="black",
                    dodge=True,
                    orient="h",
                    legend=True,
                    kind="bar",
                    sharey=True,
                    sharex=True,
                )
                ax.set(
                    xlabel="Percentage of Cells\nMapped to Attractors",
                    ylabel="Subject Identifier",
                    xlim=(0, 100),
                )
            else:
                histData = (
                    plottingData.loc[:, "Attractors"]
                    .value_counts(normalize=True)
                    .mul(100)
                    .reset_index()
                )
                histData.columns = ["Attractors", "Percent"]
                ax = sns.catplot(
                    data=histData,
                    y=histData.columns[0],  #'Attractors',
                    x=histData.columns[1],  #'Percent',
                    # palette=palette,
                    color="black",
                    dodge=True,
                    orient="h",
                    legend=True,
                    kind="bar",
                )
                ax.set(
                    xlabel="Percentage of Cells\nMapped to Attractors",
                    ylabel="Attractor Identifier",
                    xlim=(0, 100),
                )
            if freqplotsFile == "":
                plt.show()
                plt.clf()
            else:
                ax.figure.savefig(freqplotsFile, bbox_inches="tight", pad_inches=0.01)
                plt.show()
                plt.clf()
        else:
            print("No attractor frequency plots generated")
        if makeUMAP:
            ##Make attractor UMAP plots
            plt.figure(figsize=(5, 5))
            if frequencyGrouping != "":
                col = frequencyGrouping
            else:
                col = None
            ax = sns.relplot(
                data=plottingData,
                edgecolor="black",
                linewidth=1,
                x=plottingData.columns[0],
                y=plottingData.columns[1],
                hue="Attractors",
                col=col,
                aspect=1,
                palette=palette,
                legend="full",
                s=50,
            )
            # plt.legend(
            #    loc="best", borderaxespad=0.0, ncol=10 #, bbox_to_anchor=(0.5, -0.15),
            # )
            plt.gca().set_aspect("equal")
            # plt.tight_layout()
            if umapFile != "":
                plt.show()
                plt.clf()
            else:
                # get handles and labels for reuse
                label_params = ax.get_legend_handles_labels()
                ax.get_legend().remove()
                ax.figure.savefig(umapFile, bbox_inches="tight", pad_inches=0.01)
                plt.clf()
                # save legend separately
                figl, axl = plt.subplots()
                axl.axis("off")
                axl.legend(*label_params, loc="best", ncol=10, borderaxespad=0)
                figl.savefig(
                    umapFile + "_legend.pdf", bbox_inches="tight", pad_inches=0.01
                )
                plt.clf()
        else:
            print("No UMAP plots generated")

        return None
Uses a dataframe of cells and the attractors to which they are assigned (usually the output of assignAttractors) to generate (a) a barplot showing the frequency of cells assigned to (selected) attractors, optionally faceted by user-specified variables and (b) a 2D scatterplot, such as a UMAP or tSNE plot, showing cells colored by the attractors to which they are assigned.

        Parameters
        ----------

        plottingData: pandas DataFrame
            Usually a 2-column dataframe where rows = cells (indices must contain the cells in the training dataset) and columns = UMAP or tSNE (or similar) dimensions
        distanceDF: pandas DataFrame
            Output of assignAttractors, usually. A pandas DataFrame where rows = cells (indices must contain the cells in the training dataset) and at least one column (specified by attractorsAttribute parameter, see below) contains the attractors to which the cells have been assigned
        attractorsAttribute: str
            The column in distanceDF which contains the attractors to which the cells have been assigned. Default is 'decider', as this is the name in the output of assignAttractors
        allAttractors: bool
            True if all assigned attractors are to be included in the frequency and UMAP plots. Should usually be 'True' for making preliminary analysis plots, and 'False' while making publication-quality plots, for ease of visualization and to leave out infrequent attractors.
        numberOfAttractorsToShow: int
            The number of attractors to be shown in the analysis plots. Used when allAttractors is False. Only the top (numberOfAttractorsToShow) most frequent attractors will be shown. The others will be collapsed into a single category "Others".
        cmap: str
            The matplotlib color palette to be used for the analysis plots. Consider using 'colorblind' if the number of categories/attractors is small and a continuous palette such as 'Blues' or 'Greens' if the number is large. See matplotlib documentation for more options on color palettes.
        makeFrequencyPlots: bool
            Should frequency plots be made?
        frequencyGrouping: str
            The variable in the plottingData columns which should be used for faceting the frequency plots. Eg. sample, batch, disease/control, etc.
        freqplotsFile: str
            Path to output PDF file for frequency plots. Default plots to the standard output.
        makeUMAP: bool
            Should UMAP plots be made?
        umapFile: str
            Path to output PDF file for UMAP plots. Default plots to the standard output.

        Returns
        -------
            None
        
Uses a dataframe of cells and the attractors to which they are assigned (usually the output of assignAttractors) to generate (a) a barplot showing the frequency of cells assigned to (selected) attractors, optionally faceted by user-specified variables and (b) a 2D scatterplot, such as a UMAP or tSNE plot, showing cells colored by the attractors to which they are assigned.
Parameters

pandas DataFrame
Usually a 2-column dataframe where rows = cells (indices must contain the cells in the training dataset) and columns = UMAP or tSNE (or similar) dimensions
distanceDF: pandas DataFrame
Output of assignAttractors, usually. A pandas DataFrame where rows = cells (indices must contain the cells in the training dataset) and at least one column (specified by attractorsAttribute parameter, see below) contains the attractors to which the cells have been assigned
attractorsAttribute: str
The column in distanceDF which contains the attractors to which the cells have been assigned. Default is 'decider', as this is the name in the output of assignAttractors
allAttractors: bool
True if all assigned attractors are to be included in the frequency and UMAP plots. Should usually be 'True' for making preliminary analysis plots, and 'False' while making publication-quality plots, for ease of visualization and to leave out infrequent attractors.
numberOfAttractorsToShow: int
The number of attractors to be shown in the analysis plots. Used when allAttractors is False. Only the top (numberOfAttractorsToShow) most frequent attractors will be shown. The others will be collapsed into a single category "Others".
cmap: str
The matplotlib color palette to be used for the analysis plots.

Returns

None
Uses a dataframe of cells and the attractors to which they are assigned ( usually the output of assignAttractors ) to generate ( a ) a barplot showing the frequency of cells assigned to ( selected ) attractors optionally faceted by user - specified variables and ( b ) a 2D scatterplot such as a UMAP or tSNE plot showing cells colored by the attractors to which they are assigned . Parameters pandas DataFrame Usually a 2 - column dataframe where rows = cells ( indices must contain the cells in the training dataset ) and columns = UMAP or tSNE ( or similar ) dimensions distanceDF : pandas DataFrame Output of assignAttractors usually . A pandas DataFrame where rows = cells ( indices must contain the cells in the training dataset ) and at least one column ( specified by attractorsAttribute parameter see below ) contains the attractors to which the cells have been assigned attractorsAttribute : str The column in distanceDF which contains the attractors to which the cells have been assigned . Default is ' decider ' as this is the name in the output of assignAttractors allAttractors : bool True if all assigned attractors are to be included in the frequency and UMAP plots . Should usually be ' True ' for making preliminary analysis plots and ' False ' while making publication - quality plots for ease of visualization and to leave out infrequent attractors . numberOfAttractorsToShow : int The number of attractors to be shown in the analysis plots . Used when allAttractors is False . Only the top ( numberOfAttractorsToShow ) most frequent attractors will be shown . The others will be collapsed into a single category " Others " . cmap : str The matplotlib color palette to be used for the analysis plots . Returns None
def makeAttractorAnalysisPlots(
        self,
        plottingData,
        distanceDF,
        attractorsAttribute="decider",
        allAttractors=False,
        numberOfAttractorsToShow=2,
        cmap="colorblind",
        makeFrequencyPlots=True,
        frequencyGrouping="",
        freqplotsFile="",
        makeUMAP=True,
        umapFile="",
    ):
        if makeFrequencyPlots:
            sns.set_context("talk")
            plt.figure(figsize=(5, 5))
            plottingData.loc[:, "Attractors"] = distanceDF[attractorsAttribute].astype(
                "category"
            )
            plottingData.loc[:, "Attractors"].cat.categories = [
                g for g in range(len(plottingData.loc[:, "Attractors"].cat.categories))
            ]
            if isinstance(allAttractors, list):
                plottingData.loc[:, "Attractors"] = [
                    temp if temp in allAttractors else "Other"
                    for temp in plottingData.loc[:, "Attractors"]
                ]
                palette = {}
                attrColors = {
                    key: value
                    for key, value in zip(
                        allAttractors,
                        list(
                            sns.color_palette(
                                "colorblind", n_colors=len(set(allAttractors))
                            )
                        ),
                    )
                }
                for attr in set(plottingData.Attractors):
                    if attr in allAttractors:
                        palette[attr] = attrColors[attr]
                    else:
                        palette[attr] = (0.75, 0.75, 0.75)
            else:
                plottingData.Attractors = [
                    temp
                    if temp
                    in plottingData.loc[:, "Attractors"]
                    .value_counts()[: numberOfAttractorsToShow + 1]
                    .index.tolist()
                    else "Other"
                    for temp in plottingData.loc[:, "Attractors"]
                ]
                allAttractors = (
                    plottingData.loc[:, "Attractors"]
                    .value_counts()[: numberOfAttractorsToShow + 1]
                    .index.tolist()
                )
                print(allAttractors)
                palette = {}
                attrColors = {
                    key: value
                    for key, value in zip(
                        allAttractors,
                        list(sns.color_palette(cmap, n_colors=len(set(allAttractors)))),
                    )
                }
                for attr in set(plottingData.loc[:, "Attractors"]):
                    if attr in allAttractors:
                        palette[attr] = attrColors[attr]
                    else:
                        palette[attr] = (0.75, 0.75, 0.75)
            if frequencyGrouping != "":
                histData = (
                    plottingData.groupby(by=frequencyGrouping)["Attractors"]
                    .value_counts(normalize=True)
                    .mul(100)
                    .rename("Percent")
                    .reset_index()
                )
                histData.columns = [frequencyGrouping, "Attractors", "Percent"]
                ax = sns.catplot(
                    data=histData,
                    y="Attractors",
                    x="Percent",
                    col=frequencyGrouping,
                    color="black",
                    dodge=True,
                    orient="h",
                    legend=True,
                    kind="bar",
                    sharey=True,
                    sharex=True,
                )
                ax.set(
                    xlabel="Percentage of Cells\nMapped to Attractors",
                    ylabel="Subject Identifier",
                    xlim=(0, 100),
                )
            else:
                histData = (
                    plottingData.loc[:, "Attractors"]
                    .value_counts(normalize=True)
                    .mul(100)
                    .reset_index()
                )
                histData.columns = ["Attractors", "Percent"]
                ax = sns.catplot(
                    data=histData,
                    y=histData.columns[0],  
                    x=histData.columns[1],  
                    color="black",
                    dodge=True,
                    orient="h",
                    legend=True,
                    kind="bar",
                )
                ax.set(
                    xlabel="Percentage of Cells\nMapped to Attractors",
                    ylabel="Attractor Identifier",
                    xlim=(0, 100),
                )
            if freqplotsFile == "":
                plt.show()
                plt.clf()
            else:
                ax.figure.savefig(freqplotsFile, bbox_inches="tight", pad_inches=0.01)
                plt.show()
                plt.clf()
        else:
            print("No attractor frequency plots generated")
        if makeUMAP:
            plt.figure(figsize=(5, 5))
            if frequencyGrouping != "":
                col = frequencyGrouping
            else:
                col = None
            ax = sns.relplot(
                data=plottingData,
                edgecolor="black",
                linewidth=1,
                x=plottingData.columns[0],
                y=plottingData.columns[1],
                hue="Attractors",
                col=col,
                aspect=1,
                palette=palette,
                legend="full",
                s=50,
            )
            plt.gca().set_aspect("equal")
            if umapFile != "":
                plt.show()
                plt.clf()
            else:
                label_params = ax.get_legend_handles_labels()
                ax.get_legend().remove()
                ax.figure.savefig(umapFile, bbox_inches="tight", pad_inches=0.01)
                plt.clf()
                figl, axl = plt.subplots()
                axl.axis("off")
                axl.legend(*label_params, loc="best", ncol=10, borderaxespad=0)
                figl.savefig(
                    umapFile + "_legend.pdf", bbox_inches="tight", pad_inches=0.01
                )
                plt.clf()
        else:
            print("No UMAP plots generated")
        return None
def makeAttractorAnalysisPlots ( self , plottingData , distanceDF , attractorsAttribute = "decider" , allAttractors = False , numberOfAttractorsToShow = 2 , cmap = "colorblind" , makeFrequencyPlots = True , frequencyGrouping = "" , freqplotsFile = "" , makeUMAP = True , umapFile = "" , ) : if makeFrequencyPlots : sns . set_context ( "talk" ) plt . figure ( figsize = ( 5 , 5 ) ) plottingData . loc [ : , "Attractors" ] = distanceDF [ attractorsAttribute ] . astype ( "category" ) plottingData . loc [ : , "Attractors" ] . cat . categories = [ g for g in range ( len ( plottingData . loc [ : , "Attractors" ] . cat . categories ) ) ] if isinstance ( allAttractors , list ) : plottingData . loc [ : , "Attractors" ] = [ temp if temp in allAttractors else "Other" for temp in plottingData . loc [ : , "Attractors" ] ] palette = { } attrColors = { key : value for key , value in zip ( allAttractors , list ( sns . color_palette ( "colorblind" , n_colors = len ( set ( allAttractors ) ) ) ) , ) } for attr in set ( plottingData . Attractors ) : if attr in allAttractors : palette [ attr ] = attrColors [ attr ] else : palette [ attr ] = ( 0.75 , 0.75 , 0.75 ) else : plottingData . Attractors = [ temp if temp in plottingData . loc [ : , "Attractors" ] . value_counts ( ) [ : numberOfAttractorsToShow + 1 ] . index . tolist ( ) else "Other" for temp in plottingData . loc [ : , "Attractors" ] ] allAttractors = ( plottingData . loc [ : , "Attractors" ] . value_counts ( ) [ : numberOfAttractorsToShow + 1 ] . index . tolist ( ) ) print ( allAttractors ) palette = { } attrColors = { key : value for key , value in zip ( allAttractors , list ( sns . color_palette ( cmap , n_colors = len ( set ( allAttractors ) ) ) ) , ) } for attr in set ( plottingData . loc [ : , "Attractors" ] ) : if attr in allAttractors : palette [ attr ] = attrColors [ attr ] else : palette [ attr ] = ( 0.75 , 0.75 , 0.75 ) if frequencyGrouping != "" : histData = ( plottingData . groupby ( by = frequencyGrouping ) [ "Attractors" ] . value_counts ( normalize = True ) . mul ( 100 ) . rename ( "Percent" ) . reset_index ( ) ) histData . columns = [ frequencyGrouping , "Attractors" , "Percent" ] ax = sns . catplot ( data = histData , y = "Attractors" , x = "Percent" , col = frequencyGrouping , color = "black" , dodge = True , orient = "h" , legend = True , kind = "bar" , sharey = True , sharex = True , ) ax . set ( xlabel = "Percentage of Cells\nMapped to Attractors" , ylabel = "Subject Identifier" , xlim = ( 0 , 100 ) , ) else : histData = ( plottingData . loc [ : , "Attractors" ] . value_counts ( normalize = True ) . mul ( 100 ) . reset_index ( ) ) histData . columns = [ "Attractors" , "Percent" ] ax = sns . catplot ( data = histData , y = histData . columns [ 0 ] , x = histData . columns [ 1 ] , color = "black" , dodge = True , orient = "h" , legend = True , kind = "bar" , ) ax . set ( xlabel = "Percentage of Cells\nMapped to Attractors" , ylabel = "Attractor Identifier" , xlim = ( 0 , 100 ) , ) if freqplotsFile == "" : plt . show ( ) plt . clf ( ) else : ax . figure . savefig ( freqplotsFile , bbox_inches = "tight" , pad_inches = 0.01 ) plt . show ( ) plt . clf ( ) else : print ( "No attractor frequency plots generated" ) if makeUMAP : plt . figure ( figsize = ( 5 , 5 ) ) if frequencyGrouping != "" : col = frequencyGrouping else : col = None ax = sns . relplot ( data = plottingData , edgecolor = "black" , linewidth = 1 , x = plottingData . columns [ 0 ] , y = plottingData . columns [ 1 ] , hue = "Attractors" , col = col , aspect = 1 , palette = palette , legend = "full" , s = 50 , ) plt . gca ( ) . set_aspect ( "equal" ) if umapFile != "" : plt . show ( ) plt . clf ( ) else : label_params = ax . get_legend_handles_labels ( ) ax . get_legend ( ) . remove ( ) ax . figure . savefig ( umapFile , bbox_inches = "tight" , pad_inches = 0.01 ) plt . clf ( ) figl , axl = plt . subplots ( ) axl . axis ( "off" ) axl . legend ( * label_params , loc = "best" , ncol = 10 , borderaxespad = 0 ) figl . savefig ( umapFile + "_legend.pdf" , bbox_inches = "tight" , pad_inches = 0.01 ) plt . clf ( ) else : print ( "No UMAP plots generated" ) return None
Uses a dataframe of cells and the attractors to which they are assigned (usually the output of assignAttractors) to generate (a) a barplot showing the frequency of cells assigned to (selected) attractors, optionally faceted by user-specified variables and (b) a 2D scatterplot, such as a UMAP or tSNE plot, showing cells colored by the attractors to which they are assigned.
Uses a dataframe of cells and the attractors to which they are assigned ( usually the output of assignAttractors ) to generate ( a ) a barplot showing the frequency of cells assigned to ( selected ) attractors optionally faceted by user - specified variables and ( b ) a 2D scatterplot such as a UMAP or tSNE plot showing cells colored by the attractors to which they are assigned .
"""Uses a dataframe of cells and the attractors to which they are assigned (usually the output of assignAttractors) to generate (a) a barplot showing the frequency of cells assigned to (selected) attractors, optionally faceted by user-specified variables and (b) a 2D scatterplot, such as a UMAP or tSNE plot, showing cells colored by the attractors to which they are assigned.

        Parameters
        ----------

        plottingData: pandas DataFrame
            Usually a 2-column dataframe where rows = cells (indices must contain the cells in the training dataset) and columns = UMAP or tSNE (or similar) dimensions
        distanceDF: pandas DataFrame
            Output of assignAttractors, usually. A pandas DataFrame where rows = cells (indices must contain the cells in the training dataset) and at least one column (specified by attractorsAttribute parameter, see below) contains the attractors to which the cells have been assigned
        attractorsAttribute: str
            The column in distanceDF which contains the attractors to which the cells have been assigned. Default is 'decider', as this is the name in the output of assignAttractors
        allAttractors: bool
            True if all assigned attractors are to be included in the frequency and UMAP plots. Should usually be 'True' for making preliminary analysis plots, and 'False' while making publication-quality plots, for ease of visualization and to leave out infrequent attractors.
        numberOfAttractorsToShow: int
            The number of attractors to be shown in the analysis plots. Used when allAttractors is False. Only the top (numberOfAttractorsToShow) most frequent attractors will be shown. The others will be collapsed into a single category "Others".
        cmap: str
            The matplotlib color palette to be used for the analysis plots. Consider using 'colorblind' if the number of categories/attractors is small and a continuous palette such as 'Blues' or 'Greens' if the number is large. See matplotlib documentation for more options on color palettes.
        makeFrequencyPlots: bool
            Should frequency plots be made?
        frequencyGrouping: str
            The variable in the plottingData columns which should be used for faceting the frequency plots. Eg. sample, batch, disease/control, etc.
        freqplotsFile: str
            Path to output PDF file for frequency plots. Default plots to the standard output.
        makeUMAP: bool
            Should UMAP plots be made?
        umapFile: str
            Path to output PDF file for UMAP plots. Default plots to the standard output.

        Returns
        -------
            None
        """ # Make attractor frequency plots # palette=palette, #'Attractors', #'Percent', # palette=palette, ##Make attractor UMAP plots # plt.legend( #    loc="best", borderaxespad=0.0, ncol=10 #, bbox_to_anchor=(0.5, -0.15), # ) # plt.tight_layout() # get handles and labels for reuse # save legend separately
self
plottingData
distanceDF
attractorsAttribute
allAttractors
numberOfAttractorsToShow
cmap
makeFrequencyPlots
frequencyGrouping
freqplotsFile
makeUMAP
umapFile