Iterative Plotting Functions

Often times creating large numbers of plots (either as individual files or in single PDF) is part of normal workflow. This process can be simplified by creating the plots in looping functions.

scCustomize simplifies this process by allowing for the creation of many plots in multiple formats with self-contained loop functions.

Iterative functions available are:

Required Parameters

Most functions that begin with Iterate_ have shared parameters that are used to dictate file location, file name, and file type. *The exception is Iterate_PC_Loading_Plots() which is slightly different (see manual entry for more info.)

  • file_path: path to directory to save file (can also include file prefix if desired)
  • file_name: file name (if saving as single file) or suffix to add to file name (if saving individual files the meta data variable or gene will be part of file name automatically)
  • file_type: accepts one of following options: “.pdf”, “.png”, “.tiff”, “.jpeg”, “.svg”.
  • single_pdf: logical. Whether or not to save all plots to single PDF file vs. one file per variable/gene.
  • dpi: Dots per inch (only relevant for non-vector based file formats).

Added functionality

Iterate_FeaturePlot_scCustom() has an additional helpful feature when the list of features provided is named. See Marker Identification & Cluster Annotation Vignette.

When provided with named vector such as the output from Extract_Top_Markers() then Iterate_FeaturePlot_scCustom() can detect the names and add them either to the title of the plot (if single_pdf = TRUE) or the file names if FALSE.

Iterate_FeaturePlot_scCustom(seurat_object = pbmc, gene_list = top_5_presto, single_pdf = T)

Example plot showing the gene name and additional name of the plot.

Optional Parameters

Remaining parameters for each function are similar or identical to their non-iterative counterparts.

More Information

For more info on each functions and optional parameters check out the manual entry using ?Function_Name or browsing the Reference Manual