fcgo_boxplot: Generate Boxplots

Description Usage Arguments Value Examples

View source: R/fc_graphic_output.R

Description

Generate boxplots for a subset of features in an Fc Array data frame, separated out by group membership. Plots both boxes and whiskers and jitter plot of the points. Supports more than 2 groups. Resultant plots will live in a pdf, and be saved in results_dir.

Usage

1
fcgo_boxplot(fc, to_box, results_dir, flags, gopts, seed = 1337)

Arguments

fc

The Fc Array data frame

to_box

A vector of strings of feature names that you wish to generate boxplots for.

results_dir

Where you want your results to be saved.

flags

A list of analysis booleans. Must have specified the subparameters:

  • flags$do_same_range Do you want all boxplots to have the same y-limits?

  • flags$nicer_legend Do you want a nicer legend? Currently applies only to the hardcoded case of RV144, where the binning generates groups that are "yes" and "no". If this flag is TRUE, these get replaced in the plot legends with "Infected" and "Uninfected".

gopts

A list of graphical options. Must have specified the subparameters, and then the subsequent optional parameters:

  • gopts$bpar_mar The margins for the plots. Sensible starting place is c(5.1, 4.1, 4.1, 4).

  • gopts$jplot_group_cols The group colors for the jitter plot points that get drawn on top of the boxes. Should be the same length as unique(fc$group) (i.e. the number of groups you have).

  • gopts$bplot_group_cols The same as jplot_group_cols, but for the boxes themselves. Will need to be slightly different if you want points to show up. If one of jplot_group_cols is black, for example, the corresponding bplot_group_cols should be white. Experiment to get it right.

  • gopts$box_legend_inset The inset for the legend in the boxplots. Sensible starting place is c(-0.40, 0).

  • gopts$pdf_name_suffix If specified, will change the output pdf name from "group1_group2_boxplots.pdf" to "group1_group2_[pdf_name_suffix]_boxplots.pdf".

  • gopts$main If specified, sets the title of all the boxplots to the provided string. Else, the name of the feature is used.

  • gopts$ylab If specified, sets the title of all boxplots to the provided string. Else, "MFI" will be used.

Value

Nothing! Just outputs plots.

Examples

1
2
3
4
flags = list() # add some things
gopts = list() # add some more things
# produce a pdf containing boxplots of all IgG3 features, with points colored by fc$group membership
fcgo_boxplot(fc, colnames(fc)[grepl("IgG3", colnames(fc), fixed=TRUE)], "/home/me/results/", flags, gopts)

kmorrisongr/fcan documentation built on Sept. 9, 2020, 10:12 a.m.