Skip to contents

This is the function to generate a box plot to show CPM levels of DE genes among selected treatment samples and control samples.

Usage

plot_counts(
  data = NULL,
  genes = NULL,
  group_by = NULL,
  treatment_samples = NULL,
  control_samples = NULL,
  color_by = NULL,
  normalisation = NULL,
  batch = 1
)

Arguments

data

A tidyseurat object merged with metadata. Must contain columns "Well_ID", "Row", "Column".

genes

Genes to be plotted

group_by

A column that specifies the treatment group in the input data

treatment_samples

Value in the column "combined_id" representing replicates of treatment samples in the data

control_samples

Value in the column "combined_id" representing replicates of control samples in the data

color_by

A column that specifies the group coloring

normalisation

One of "raw", "logNorm", "cpm", "clr", "SCT", "DESeq2", "edgeR", "RUVg", "RUVs", "RUVr", "limma_voom"

batch

To indicate patch factor

Value

a ggplot2 object

Examples

data(mini_mac)
genes <- mini_mac@tools$diff_exprs$Staurosporine_10$gene[1:6]
p <- plot_counts(mini_mac, genes = genes, group_by = "combined_id", 
treatment_samples = "Staurosporine_10", 
control_samples = "DMSO_0",
normalisation = "clr")
#> Normalizing layer: counts
#> Normalizing across cells
#> 
  |                                                  | 0 % ~calculating  
  |+                                                 | 1 % ~00s          
  |++                                                | 3 % ~00s          
  |++                                                | 4 % ~00s          
  |+++                                               | 5 % ~00s          
  |++++                                              | 6 % ~00s          
  |++++                                              | 8 % ~00s          
  |+++++                                             | 9 % ~00s          
  |++++++                                            | 10% ~00s          
  |++++++                                            | 12% ~00s          
  |+++++++                                           | 13% ~00s          
  |++++++++                                          | 14% ~00s          
  |++++++++                                          | 16% ~00s          
  |+++++++++                                         | 17% ~00s          
  |++++++++++                                        | 18% ~00s          
  |++++++++++                                        | 19% ~00s          
  |+++++++++++                                       | 21% ~00s          
  |++++++++++++                                      | 22% ~00s          
  |++++++++++++                                      | 23% ~00s          
  |+++++++++++++                                     | 25% ~00s          
  |+++++++++++++                                     | 26% ~00s          
  |++++++++++++++                                    | 27% ~00s          
  |+++++++++++++++                                   | 29% ~00s          
  |+++++++++++++++                                   | 30% ~00s          
  |++++++++++++++++                                  | 31% ~00s          
  |+++++++++++++++++                                 | 32% ~00s          
  |+++++++++++++++++                                 | 34% ~00s          
  |++++++++++++++++++                                | 35% ~00s          
  |+++++++++++++++++++                               | 36% ~00s          
  |+++++++++++++++++++                               | 38% ~00s          
  |++++++++++++++++++++                              | 39% ~00s          
  |+++++++++++++++++++++                             | 40% ~00s          
  |+++++++++++++++++++++                             | 42% ~00s          
  |++++++++++++++++++++++                            | 43% ~00s          
  |+++++++++++++++++++++++                           | 44% ~00s          
  |+++++++++++++++++++++++                           | 45% ~00s          
  |++++++++++++++++++++++++                          | 47% ~00s          
  |+++++++++++++++++++++++++                         | 48% ~00s          
  |+++++++++++++++++++++++++                         | 49% ~00s          
  |++++++++++++++++++++++++++                        | 51% ~00s          
  |++++++++++++++++++++++++++                        | 52% ~00s          
  |+++++++++++++++++++++++++++                       | 53% ~00s          
  |++++++++++++++++++++++++++++                      | 55% ~00s          
  |++++++++++++++++++++++++++++                      | 56% ~00s          
  |+++++++++++++++++++++++++++++                     | 57% ~00s          
  |++++++++++++++++++++++++++++++                    | 58% ~00s          
  |++++++++++++++++++++++++++++++                    | 60% ~00s          
  |+++++++++++++++++++++++++++++++                   | 61% ~00s          
  |++++++++++++++++++++++++++++++++                  | 62% ~00s          
  |++++++++++++++++++++++++++++++++                  | 64% ~00s          
  |+++++++++++++++++++++++++++++++++                 | 65% ~00s          
  |++++++++++++++++++++++++++++++++++                | 66% ~00s          
  |++++++++++++++++++++++++++++++++++                | 68% ~00s          
  |+++++++++++++++++++++++++++++++++++               | 69% ~00s          
  |++++++++++++++++++++++++++++++++++++              | 70% ~00s          
  |++++++++++++++++++++++++++++++++++++              | 71% ~00s          
  |+++++++++++++++++++++++++++++++++++++             | 73% ~00s          
  |++++++++++++++++++++++++++++++++++++++            | 74% ~00s          
  |++++++++++++++++++++++++++++++++++++++            | 75% ~00s          
  |+++++++++++++++++++++++++++++++++++++++           | 77% ~00s          
  |+++++++++++++++++++++++++++++++++++++++           | 78% ~00s          
  |++++++++++++++++++++++++++++++++++++++++          | 79% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++         | 81% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++         | 82% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++        | 83% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 84% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++       | 86% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++      | 87% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 88% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++     | 90% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++    | 91% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 92% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++   | 94% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++  | 95% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 96% ~00s          
  |+++++++++++++++++++++++++++++++++++++++++++++++++ | 97% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 99% ~00s          
  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=00s