Skip to content

Plot heatmaps with only 2 groups being compared in multi-factor model #10

@epartan

Description

@epartan

After line 750 in rnaseq-reports/02_differential_expression/DEG.Rmd

  # also make a heatmap with just the two groups being compared
  groups_in_contrast <- c(contrast %>% str_remove("^group_") %>% str_remove("_vs_.*$"),
                          contrast %>% str_remove("^.*_vs_"))
  samples_in_contrast <- coldata %>% filter(group %in% groups_in_contrast) %>% pull(sample)
  ma <- norm_matrix[res_sig$gene_id, samples_in_contrast]
  colma <- coldata[samples_in_contrast, c(column), drop = FALSE]
  p2 <- pheatmap(ma, 
                 color = inferno(10), 
                 cluster_rows = T, 
                 show_rownames = F,
                 annotation = colma, 
                 annotation_colors = ma_colors,
                 border_color = NA, 
                 fontsize = 10, 
                 scale = "row", 
                 fontsize_row = 10, 
                 height = 20)
  print(p2)
  cat("\n\n")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions