BAITS.VDJ.tl.calculate_qc_clones#
- BAITS.VDJ.tl.calculate_qc_clones(df, group_by, Cgene_col, clone_col, loc_x_col='X', loc_y_col='Y', plot=True)#
Compute per-group clone counts and per-spatial-location clone counts.
- Parameters:
df (pandas.DataFrame) – Input dataframe containing clone, chain, and spatial information.
group_by (str) – Column name to group by (e.g., sample or tissue region).
Cgene_col (str) – Column name for chain (Cgene).
clone_col (str) – Column containing clone identifiers.
loc_x_col (str, default='X') – Column name for x-coordinate.
loc_y_col (str, default='Y') – Column name for y-coordinate.
plot (bool, default=True) – Whether to generate QC boxplots.
- Returns:
Original dataframe with additional columns: - ‘clone_by_group’: number of clones per group - ‘clone_by_group_spatialLoc’: number of clones per spatial location
- Return type:
pandas.DataFrame