BAITS.VDJ.tl.stat_clone#
- BAITS.VDJ.tl.stat_clone(df, groupby, Cgene_col, clone_col, plot=True, palette='Set2', xlabel=None, ylabel=None, ylog=False, figsize=(4, 3.5))#
Compute the number of unique clones per group and optionally plot.
- Parameters:
df (pandas.DataFrame) – Input dataframe containing clone information.
groupby (str) – Column name for grouping (e.g., sample, tissue region).
Cgene_col (str) – Column name for chain (Cgene).
clone_col (str) – Column containing clone identifiers.
plot (bool, default=True) – Whether to plot a bar chart of clone counts.
palette (str, default='Set2') – Color palette for plotting.
xlabel (str, optional) – Label for the x-axis.
ylabel (str, optional) – Label for the y-axis.
ylog (bool, default=False) – Whether to use log scale for y-axis.
figsize (tuple, default=(4,3.5)) – Figure size for the plot.
- Returns:
Original dataframe with an additional column
'clone_by_<groupby>'containing clone counts per group.- Return type:
pandas.DataFrame