ovrlpy.pre_process_coordinates

ovrlpy.pre_process_coordinates(coordinate_df, grid_size=1, coordinates=('x', 'y', 'z'), use_message_passing=True, measure='mean', inplace=True, **kwargs)

Runs the pre-processing routine of the coordinate dataframe.

It assigns x,y coordinate pixels to all molecules in the data frame and determines a z-coordinate-center for each pixel.

Parameters:
  • coordinate_df (DataFrame) – A dataframe of coordinates.

  • grid_size (int, optional) – The size of the pixel grid. Defaults to 1.

  • coordinates (tuple[str, str, str], optional) – Name of the coordinate columns.

  • use_message_passing (bool, optional) – Whether to use message passing to determine the z-dimension delimiter. Defaults to True.

  • measure (str, optional) – The measure to use to determine the z-dimension delimiter. Defaults to ‘mean’. Other option is ‘median’.

  • inplace (bool, optional) – Whether to modify the input dataframe or return a copy. Defaults to True.

Returns:

A dataframe with added x_pixel, y_pixel and z_delim columns.

Return type:

DataFrame