morphomapping.MM

Contents

morphomapping.MM#

class morphomapping.MM#

A class to create interactive dimensionality reduction plots. Based on pandas DataFrame.

Parameters:

df – DataFrame containing all Imaging Flow Cytometry data

Return type:

None

Methods

add_metadata(label, value)

add column with specific value to self.df

cat_plot(feature, subs, colors, outputf, ...)

Create plot with categorical color mapper.Choose feature, colors and more.

check_dataframe()

check if df is empty

cluster_gmm(number_component, random_s, ...)

Cluster self.df by Gaussian Mixture Modeles and plot result.

cluster_hdbscan(cluster_size, label_x, label_y)

Cluster self.df by hdbscan and plot result.

cluster_kmeans(n_cluster, label_x, label_y)

Cluster self.df by kmeans clustering and show result as plt.show().

concat_df(*new_df[, join])

concatenate self.df and new DataFrame(s) (joining inner by default)

concat_variables(*dataframes)

attach new columns as df to self.df and return resulting df

configure_axes_and_legend(plot, show_axes, ...)

Settings for axes and legend.

configure_hover_tooltips(feature[, ...])

Set hover tooltips.

convert_to_CSV(fcs_path, csv_path)

Converts fcs-file to .csv file and saves it to csv_path.

create_base_plot(fig_width, fig_height, ...)

Settings for plotting umap/densmap.

dmap(dlambda, nn, mdist, met)

Run dmap with self.df.

drop_events(first_row, last_row)

drop specific rows from self.df

drop_variables(*labels)

drop certain columns from self.df

feature_importance(dep, indep)

Calculates feature importance of columns in self.df (especially for x and y after dmap/umap were run).

get_df()

return self.df

get_features()

return list of self.df columns

lin_plot(outputf, feature, colors, ...[, ...])

Create plot with Linear color mapper.Choose feature, colors and more.

minmax_norm([first_column, last_column])

Apply MinMax normalization to self.df.

plot_feature_importance(features, path[, ...])

Plots the ten most important features and returns a pyplot.

prepare_data_source()

set ColumnDataSource as self.df and return ColumnDataSource

quant_scaler([first_column, last_column])

Apply QuantileTransformer to self.df.

read_CSV(path[, add_index, index_name])

Load csv-file and save it as self.df

rename_variables(label_mapping)

rename column(s) with new column labels

save_csv(path)

save self.df as csv to chosen path

save_feature(*features)

save specific columns of self.df in new DataFrame and return new DataFrame

save_xlsx(path)

save self.df as xlsx file to chosen path

select_condition(condition, value)

select specific rows by condition and save new df as self.df

select_events(event_size)

randomly select events and save as self.df

umap(nn, mdist, met)

Run umap with self.df.

update_column_values(column_name, rename_values)

replace values in a specific column with a specific new value