Given a path to a directory containing .fcs files and a pattern to match in the file names, generates density plots of FACS data across time points.

facs_density_plot2(strain_code, dir = "./", output_dir = dir, gate,
  y_axis_label = "Time in meiosis\n(hrs)\n", plot_color = "black",
  plot_transparency = 0.8, file_format = "jpeg", user_input = TRUE)

Arguments

strain_code

The lab's database numeric code identifier of the yeast strain (used to name files). No default.

dir

Path to directory containing .fcs files. Defaults to current working directory ("./").

output_dir

Path to output directory. Defaults to dir.

gate

Optional two-element vector containing gating limits. No default (corresponds to no gating).

y_axis_label

Character string indicating the label for the plot's y axis. Defaults to "Time in meiosis\n(hrs)\n".

plot_color

Optional R color to fill the plot. Defaults to "black".

plot_transparency

Floating point number between 0 and 1 indicating transparency of the plot (corresponds to the plotting alpha argument: 0 is full transparency and 1 is completely opaque). Defaults to 0.8. (corresponds to no gating).

file_format

Character string indicating the plot file format. Must be one of the options jpeg and pdf. Defaults to jpeg.

user_input

Logical indicating whether to ask user before saving plot to file. Defaults to TRUE.

Value

Density plot file in the same directory as the .fcs files.

Details

The function is designed to search all .fcs files (named according to the convention "Well strain_timepoint.fcs". e.g. "A01 119_0.fcs") for those matching the provided pattern (yeast strain code) and build a density plot. An ungated version of the plot is printed to the screen and the final plot is saved to a file in the selected format in the same directory as the .fcs files.

Examples

# NOT RUN {
facs_density_plot2(119)

facs_density_plot2(strain_code=8401, dir='~/Desktop/my_facs_data',
                   output_dir='~/Desktop', gate=c(1500000, 7000000))

facs_density_plot2(strain_code=119, dir='~/Desktop/', output_dir='~/Desktop',
                   gate=c(1500000, 7000000), y_axis_label='Samples',
                   plot_color='orange', plot_transparency=1, user_input=F)
# }