From 858243ddb633a6da4fe37252d29b64c0809f9d2b Mon Sep 17 00:00:00 2001 From: kirchmair Date: Sat, 7 Oct 2023 16:59:06 +0200 Subject: [PATCH] Final formatting --- README.md | 2 +- analyses/01-RNA-Differentiation.Rmd | 2 -- analyses/02-13C-Differentiation.Rmd | 2 -- analyses/03-RNA-Exhaustion.Rmd | 2 -- analyses/04-13C-Exhaustion.Rmd | 2 -- analyses/05-RNA-Exhaustion-Public.Rmd | 1 - analyses/06-RNA-Mitochondria.Rmd | 4 ++-- analyses/08-Results.Rmd | 34 +++++++++++++-------------- 8 files changed, 19 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 475eb59..8bbded0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## Kirchmair et al., Frontiers in Immunology 2023 -Data analyses for _13C tracer analysis reveals the landscape of metabolic checkpoints in human CD8+ T cell differentiation and exhaustion (Kirchmair et al., Frontiers in Immunology 2023)_ +Data analyses for _13C tracer analysis reveals the landscape of metabolic checkpoints in human CD8+ T cell differentiation and exhaustion_ (Kirchmair et al., Frontiers in Immunology 2023) diff --git a/analyses/01-RNA-Differentiation.Rmd b/analyses/01-RNA-Differentiation.Rmd index 1d17977..a612b75 100644 --- a/analyses/01-RNA-Differentiation.Rmd +++ b/analyses/01-RNA-Differentiation.Rmd @@ -6,7 +6,6 @@ params: --- ```{r setup, include=FALSE} - library(datamisc) library(DESeq2) library(ggplot2) @@ -16,7 +15,6 @@ library(GEOquery) library(clusterProfiler) dir.create("../data/rnaseq", showWarnings = FALSE) - ``` diff --git a/analyses/02-13C-Differentiation.Rmd b/analyses/02-13C-Differentiation.Rmd index 09158c4..fb57b1b 100644 --- a/analyses/02-13C-Differentiation.Rmd +++ b/analyses/02-13C-Differentiation.Rmd @@ -6,7 +6,6 @@ params: --- ```{r setup, include=FALSE} - library(c13ms) library(datamisc) library(dplyr) @@ -15,7 +14,6 @@ library(ggplot2) dir.create("../data/metabolomics", showWarnings = FALSE) dir.create(params$results, showWarnings = FALSE) - ``` diff --git a/analyses/03-RNA-Exhaustion.Rmd b/analyses/03-RNA-Exhaustion.Rmd index 9ef32f2..d75ec77 100644 --- a/analyses/03-RNA-Exhaustion.Rmd +++ b/analyses/03-RNA-Exhaustion.Rmd @@ -6,7 +6,6 @@ params: --- ```{r setup, include=FALSE} - library(datamisc) library(DESeq2) library(ggplot2) @@ -16,7 +15,6 @@ library(GEOquery) library(clusterProfiler) dir.create("../data/rnaseq", showWarnings = FALSE) - ``` diff --git a/analyses/04-13C-Exhaustion.Rmd b/analyses/04-13C-Exhaustion.Rmd index 92e4653..0485552 100644 --- a/analyses/04-13C-Exhaustion.Rmd +++ b/analyses/04-13C-Exhaustion.Rmd @@ -7,7 +7,6 @@ params: ```{r setup, include=FALSE} - library(c13ms) library(datamisc) library(dplyr) @@ -15,7 +14,6 @@ library(openxlsx) dir.create("../data/metabolomics", showWarnings = FALSE) dir.create(params$results, showWarnings = FALSE) - ``` diff --git a/analyses/05-RNA-Exhaustion-Public.Rmd b/analyses/05-RNA-Exhaustion-Public.Rmd index 5e92865..7874e92 100644 --- a/analyses/05-RNA-Exhaustion-Public.Rmd +++ b/analyses/05-RNA-Exhaustion-Public.Rmd @@ -11,7 +11,6 @@ library(DESeq2) library(datamisc) dir.create(params$data, showWarnings = FALSE) - ``` diff --git a/analyses/06-RNA-Mitochondria.Rmd b/analyses/06-RNA-Mitochondria.Rmd index 02eaf13..6e17a53 100644 --- a/analyses/06-RNA-Mitochondria.Rmd +++ b/analyses/06-RNA-Mitochondria.Rmd @@ -18,7 +18,6 @@ library(TCGAbiolinks) dir.create(params$data, showWarnings = FALSE) if (!exists("mitodata")) mitodata <- list() if (!exists("mitogenes")) mitogenes <- list() - ``` @@ -234,7 +233,8 @@ linmod <- lm(tumor_copy_number ~ ., data = ndata[,sel]) selmod <- step(linmod, trace = FALSE, steps = 10000) summary(selmod) -mitomodel$fit <- selmod +mitomodel$linmod <- linmod +mitomodel$selmod <- selmod ``` diff --git a/analyses/08-Results.Rmd b/analyses/08-Results.Rmd index 782726e..d642653 100644 --- a/analyses/08-Results.Rmd +++ b/analyses/08-Results.Rmd @@ -10,7 +10,6 @@ params: --- ```{r setup, include=FALSE} - library(ggplot2) library(c13ms) library(patchwork) @@ -25,7 +24,6 @@ dir.create(params$figures, showWarnings = FALSE) dir.create(params$tables, showWarnings = FALSE) source("../lib/R-functions.R") - ``` @@ -228,22 +226,22 @@ C13cells <- subset(C13mem, Sampletype == "cells") Plots ```{r} -# dir.create(fp(params$figures, "isoplots"), showWarnings = FALSE) -# -# C13cells |> -# isoplot(summarise_by = Celltype, assay = "mid_clean", -# col_cex = 0.5, linewidth = 2, nacolor = "white", colorscale = c("white", "#1702a1"), -# dir = fp(params$figures, "isoplots"), title = "ID", height = 10, title_size = 120, fontsize = 100, -# dev = "pdf", label = FALSE, cumulative = TRUE, legend = FALSE) -# -# # plot legend -# leg_plot <- C13cells |> -# isoplot(summarise_by = Celltype, assay = "mid_clean", mets = "lac", fontsize = 120, colorscale = c("white", "#1702a1")) -# leg_plot <- leg_plot + theme_basic() + theme(plot.background = element_blank(), panel.background = element_blank(), legend.background = element_blank()) + -# guides(fill = guide_colourbar(barheight = grid::unit(200, "mm"), barwidth = grid::unit(20, "mm"), raster = FALSE, nbin = 20, -# ticks.colour = "black", frame.colour = "black", ticks.linewidth = 0.5, frame.linewidth = 0.5)) -# cowplot::get_legend(leg_plot) |> -# cowplot::ggsave2(filename = fp(params$figures, "isoplots", "legend.pdf"), dev = "pdf", width = 10, height = 20) +dir.create(fp(params$figures, "isoplots"), showWarnings = FALSE) + +C13cells |> + isoplot(summarise_by = Celltype, assay = "mid_clean", + col_cex = 0.5, linewidth = 2, nacolor = "white", colorscale = c("white", "#1702a1"), + dir = fp(params$figures, "isoplots"), title = "ID", height = 10, title_size = 120, fontsize = 100, + dev = "pdf", label = FALSE, cumulative = TRUE, legend = FALSE) + +# plot legend +leg_plot <- C13cells |> + isoplot(summarise_by = Celltype, assay = "mid_clean", mets = "lac", fontsize = 120, colorscale = c("white", "#1702a1")) +leg_plot <- leg_plot + theme_basic() + theme(plot.background = element_blank(), panel.background = element_blank(), legend.background = element_blank()) + + guides(fill = guide_colourbar(barheight = grid::unit(200, "mm"), barwidth = grid::unit(20, "mm"), raster = FALSE, nbin = 20, + ticks.colour = "black", frame.colour = "black", ticks.linewidth = 0.5, frame.linewidth = 0.5)) +cowplot::get_legend(leg_plot) |> + cowplot::ggsave2(filename = fp(params$figures, "isoplots", "legend.pdf"), dev = "pdf", width = 10, height = 20) ```