This function creates the actual plot based on processed data and aesthetic choices.

create_plot(
  data,
  color1 = "cornflowerblue",
  color2 = "grey",
  color3 = "indianred",
  highLog2fc = 0.585,
  lowLog2fc = -0.585,
  expressionDirection = "regulation",
  negativeLogPValue = "negLog10p",
  logFoldChange = "log2fc",
  timeVariable = "reg_time_org",
  xAxis = "organ",
  yAxis = "timePoint"
)

Arguments

data

The data frame containing the plot data.

color1

Color for one category of data points.

color2

Color for another category of data points.

color3

Color for a third category of data points.

highLog2fc

Threshold for high log2 fold change values.

lowLog2fc

Threshold for low log2 fold change values.

expressionDirection

Direction of gene expression.

negativeLogPValue

The name of the column containing the negative log p-values.

logFoldChange

The name of the column containing log fold change values.

timeVariable

The variable representing time.

xAxis

The name of the x-axis variable.

yAxis

The name of the y-axis variable.

Value

The ggplot object.

Examples

plotdata <- get_clear_scatterplot_df()
p <- create_plot(
  plotdata,
  color1 = "cornflowerblue",
  color2 = "grey",
  color3 = "indianred",
  highLog2fc = 0.585,
  lowLog2fc = -0.585,
  expressionDirection = "regulation",
  negativeLogPValue = "negLog10p",
  logFoldChange = "log2fc",
  timeVariable = "reg_time_org",
  xAxis = "organ",
  yAxis = "timePoint"
)
#> Scale for colour is already present.
#> Adding another scale for colour, which will replace the existing scale.