plot_dataset: Generate an IDOC plot

View source: R/plot.R

plot_datasetR Documentation

Generate an IDOC plot

Description

Take a dataset and its analysis, together with plotting parameters, to visualize an IDOC experiment

Usage

plot_dataset(
  experiment_folder,
  dataset,
  analysis,
  result_folder = NULL,
  plot_preference_index = TRUE,
  plot_decision_zone = TRUE,
  plot_crosses = TRUE,
  subtitle = "",
  colors = c(TREATMENT_A = "red", TREATMENT_B = "blue"),
  labels = c(TREATMENT_A = "TREATMENT_A", TREATMENT_B = "TREATMENT_B"),
  analysis_mask = NULL,
  plot_mask = NULL,
  downward = TRUE,
  nrow = 1,
  ncol = 20,
  suffix = "",
  cross_size = 2,
  line_alpha = 1,
  marker_shape = 16,
  marker_colors = c("#35b347", "#00abee"),
  do_mark_analysis_mask = TRUE,
  do_document = TRUE,
  orientation = "y",
  style = "default",
  ...
)

Arguments

experiment_folder

Path to folder containing IDOC results .csv files

dataset

List of raw data including:

  • roi: every row records the position of one animal at one point in time

  • controller: every row records the status of all IDOC stimulus at one point in time

  • limits

  • border

analysis

List of processed data including:

  • annotation: every row is a decision zone exit and its appetitive / aversive value

  • pi: preference index scored by each animal

result_folder

Path to a folder where to save results. If not passaed, it is set to experiment_folder

plot_preference_index

Whether to show the scored preference index with the region id on the facet label (TRUE), or just the region id (FALSE)

plot_decision_zone

Whether to display the decision zone (TRUE) or not.

plot_crosses

Whether to display the decision zone crosses (TRUE) or not.

subtitle

Character to write on the plot subtitles

colors

Named vector of colors. Values should be colors and names need to map to controller events

labels

Character vector whose values become the name of the treatments as rendered in the plot's legend

analysis_mask

Numeric vector of length 2 containing start and end timepoint of mask in seconds since the start of the experiment Every behavior outside of the mask is ignored

plot_mask

If not NULL, the plot contains data contained within the interval's start and end (s)

downward

Whether the 0 should be at the top (TRUE) or the bottom (FALSE) of the plot

nrow

Number of rows used for facetting data

ncol

Number of cols used for facetting data

suffix

A character (word) that will differentiate resulting output from other output produced on the same experiment folder. Useful for segmenting the experiment into different periods of interest and analyzing these periods separately.

cross_size

Size of dots used to represent decision zone exits (crosses)

line_alpha

Alpha of position trace

...

Extra arguments for save_plot

Details

A corssing dataset where every record represents a decision zone exit of one animal is required to show the exits in the plot

Value

ggplot2 object

See Also

mark_stimuli()

mark_decision_zone()

mark_crosses()

save_plot()


shaliulab/idocr documentation built on June 1, 2025, 4:59 p.m.