B_HIT.sVDJ.tl.compute_clone_counts

B_HIT.sVDJ.tl.compute_clone_counts#

B_HIT.sVDJ.tl.compute_clone_counts(rep_loc, groupby_cols, count_col, extra_cols, count_name='count', freq_name='freq', if_count=True, if_freq=True)#

Compute clone counts and frequencies for specified groups.

Parameters:
  • rep_loc (pd.DataFrame) – Input DataFrame containing clone information.

  • groupby_cols (list) – Columns to group by (e.g., sample, region, family ID).

  • count_col (str) – Column to count occurrences of (e.g., ‘family_id’).

  • extra_cols (list) – Additional columns to include before counting.

  • count_name (str, optional) – Name for the count result column (default is ‘count’).

  • freq_name (str, optional) – Name for the frequency result column (default is ‘freq’).

  • if_count (bool, optional) – Whether to compute and return counts (default is True).

  • if_freq (bool, optional) – Whether to compute and return frequencies (default is True).

Returns:

pd.DataFrame A DataFrame containing counts, frequencies, or both.