Garfield.analysis.filter_marker_stats

Garfield.analysis.filter_marker_stats(data, use_raw=True, min_frac_diff=0.1, min_mean_diff=0.1, max_next_frac=0.9, max_next_mean=0.95, strict=False, how='or')[source]

Filter marker statistics based on thresholds.

Parameters:
  • data (AnnData or DataFrame) – Data containing marker statistics.

  • use_raw (bool, optional) – Which data representation to use (‘raw’ or processed). Default is ‘raw’.

  • min_frac_diff (float, optional) – Minimum difference in fraction to consider a marker valid. Default is 0.1.

  • min_mean_diff (float, optional) – Minimum difference in mean expression to consider a marker valid. Default is 0.1.

  • max_next_frac (float, optional) – Maximum fraction difference for non-top markers. Default is 0.9.

  • max_next_mean (float, optional) – Maximum mean difference for non-top markers. Default is 0.95.

  • strict (bool, optional) – If True, use stricter thresholds for filtering. Default is False.

  • how (str, optional) – Logical operation to combine fraction and mean filters (‘or’ or ‘and’). Default is ‘or’.

Returns:

Filtered DataFrame containing marker statistics.

Return type:

DataFrame