This function creates a scatterplot of cell-group proportions, optionally highlighting significant differences based on a given significance threshold.
plot_scatterplot(
.data,
data_proportion,
factor_of_interest,
.cell_group,
.sample,
significance_threshold = 0.05,
my_theme
)
Data frame containing the main data.
Data frame containing proportions of cell groups.
A factor indicating the biological condition of interest.
The cell group to be analysed.
The sample identifier.
Numeric value specifying the significance threshold for highlighting differences. Default is 0.025.
A ggplot2 theme object to be applied to the plot.
A ggplot object representing the scatterplot.
# Example usage:
# plot_scatterplot(.data, data_proportion, "condition", "cell_group", "sample", 0.025, theme_minimal())