metaclean3.channels

Module Contents

Functions

get_clean_time_chan(data[, time_chan, min_bin_size])

Finds the time channel in data; if there is no time channel, creates one.

verify_channels([given_chans, all_chans])

Verifies whether elements of given_chans are in all_chans.

get_clean_fp_channels(data[, fluo_chans, phys_chans, ...])

Identify fluorescent channels.

most_corr_channels(data[, chosen_chans, bins, ...])

Verifies chosen channels and finds channels most correlated with time.

metaclean3.channels.get_clean_time_chan(data: pandas.DataFrame, time_chan: str = 'time', min_bin_size: int = 2000)

Finds the time channel in data; if there is no time channel, creates one.

Args:

data (pandas.DataFrame): _description_ time_chan (str, optional): _description_. Defaults to ‘time’. min_bin_size (int, optional): _description_. Defaults to 2000.

Returns:
tuple:

str: Time channel column name in data. pandas.DataFrame: The given data sorted by the time channel.

metaclean3.channels.verify_channels(given_chans: list = [], all_chans: list = [])

Verifies whether elements of given_chans are in all_chans.

Args:

given_chans (list): User given strings. all_chans (list): The full string list.

Returns:

numpy.ndarray: User given strings that are in the full string list.

metaclean3.channels.get_clean_fp_channels(data: pandas.DataFrame, fluo_chans: list = [], phys_chans: list = [], channel_unique_no: int = 25, phys_channel_suffix: list = ['fs', 'ss', 'area', 'eccentricity', 'forward', 'side'], bad_suffix: list = ['bead', 'event', 'label', 'is_gate', 'index', 'index_original', 'bin', 'time'])

Identify fluorescent channels.

Args:

data (pandas.DataFrame): FCS pandas.DataFrame. fluo_chans (list): String vector containing fluorescent channel names.

Defaults to None.

phys_chans (list): String vector containing physical morphology

channel names. Defaults to None.

channel_unique_no (int): Minimum number of rows in each column that

can be non-unique. Defaults to 25.

phys_channel_suffix (list): Standard suffixes for phys_chans.

Defaults to [‘fs’, ‘ss’, ‘area’, ‘eccentricity’, ‘forward’, ‘side’].

bad_suffix (list): Suffixes to avoid. Defaults to [‘bead’, ‘event’,

‘label’, ‘is_gate’, ‘index’, ‘index_original’, ‘bin’, ‘time’].

Returns:
tuple:

numpy.array: fluorescent channels that can be used to clean FCS data. numpy.array: physical morphology channels.

metaclean3.channels.most_corr_channels(data: pandas.DataFrame, chosen_chans: numpy.ndarray | pandas.Series | None = None, bins: numpy.ndarray | pandas.Series | None = None, candidate_no: int = 4, min_nrows: int = 50, corr_type: str = 'max')

Verifies chosen channels and finds channels most correlated with time.

Args:

data (pd.DataFrame): FCS data matrix. chosen_chans (np.ndarray | pd.Series | None, optional):

User chosen channels. Defaults to None.

bins (np.ndarray | pd.Series | None, optional): Bin labels.

Defaults to None.

candidate_no (int, optional): Number of channels to return.

Defaults to 4.

min_nrows (int, optional): Minimum number of rows required to calculate

correlation. Defaults to 50.

corr_type (str, optional): Type of summarization to use on bins to

calculate correlation e.g. min, max, median, mean. See pandas.DataFrame.agg. Defaults to ‘max’.

Returns:

np.ndarray: Vector of candidate channel names.