## ----chunk, include = FALSE---------------------------------------------------
knitr::opts_chunk$set(
    collapse = TRUE,
    comment = "#>",
    fig.width = 7,
    fig.height = 5,
    out.width = "100%",
    dev = "ragg_png"
)

## ----setup--------------------------------------------------------------------
library(mesa)
library(dplyr)
library(ggplot2)
library(tidyr)
library(stringr)

## ----generating-tables-of-values-fr-------------------------------------------
exampleTumourNormal %>%
    getCountTable()

## ----chunk-2------------------------------------------------------------------
exampleTumourNormal %>%
    getNRPMTable()

## ----chunk-3------------------------------------------------------------------
exampleTumourNormal %>%
    getBetaTable()

## ----chunk-4------------------------------------------------------------------
exampleTumourNormal %>%
    getBetaTable(useGroupMeans = FALSE)

exampleTumourNormal %>%
    mutate(group = str_remove(sample_name,"\\d")) %>%
    getBetaTable(useGroupMeans = TRUE) 

## ----chunk-5------------------------------------------------------------------
exampleTumourNormal %>% 
    addLibraryInformation() %>% 
    getSampleTable() %>% 
    dplyr::select(sample_name, relH)

## ----chunk-6------------------------------------------------------------------
exampleTumourNormal %>% 
    addLibraryInformation() %>% 
    getSampleTable() %>% 
    dplyr::select(sample_name, input_relH)

## ----chunk-7------------------------------------------------------------------
exampleTumourNormal %>% 
    addLibraryInformation() %>% 
    getSampleTable() %>% 
    dplyr::select(sample_name, relH_MeCap = relH, relH_Input = input_relH) %>% 
    pivot_longer(matches("relH"), 
                names_prefix = "relH_", 
                names_to = "enrichment", 
                values_to = "relH") %>%
    ggplot(aes(x = sample_name, y = relH, col = enrichment)) +
    geom_point() +
    theme_bw() +
    theme(axis.text.x = element_text(angle = 45, hjust = 1))

## ----session-info, echo=FALSE-------------------------------------------------
sessionInfo()

