This calculates the log fold change for a gimap dataset based on the annotation and metadata provided.

gimap_normalize(
  .data = NULL,
  gimap_dataset,
  timepoints = NULL,
  replicates = NULL
)

Arguments

.data

Data can be piped in with a tidyverse pipe from function to function. But the data must still be a gimap_dataset

gimap_dataset

A special dataset structure that is setup using the `setup_data()` function.

timepoints

Specifies the column name of the metadata set up in `$metadata$sample_metadata` that has a factor that represents the timepoints. Timepoints will be made into three categories: plasmid for the earliest time point, early for all middle timepoints and late for the latest timepoints. The late timepoints will be the focus for the calculations. The column used for timepoints must be numeric or at least ordinal.

replicates

Specifies the column name of the metadata set up in `$metadata$sample_metadata` that has a factor that represents column that specifies replicates. These replicates will be kept separate for the late but the early and plasmid others will be averaged and used for normalization.

Examples

if (FALSE) {

gimap_dataset <- get_example_data("gimap")

# Highly recommended but not required
run_qc(gimap_dataset)

gimap_dataset <- gimap_dataset %>%
  gimap_filter() %>%
  gimap_annotate() %>%
  gimap_normalize(
    timepoints = "day",
    replicates = "rep"
  )

# To see results
gimap_dataset$normalized_log_fc
}