Gitlab migration complete. If you have any issue please read the FAQ.

Commit 95cb0f74 authored by Dominik Ternes's avatar Dominik Ternes
Browse files

Upload Gemella script.

parent 5170ed7c
This diff is collapsed.
This diff is collapsed.
---
title: "GSEA_IPA_plotting"
author: "DT"
date: "23/2/2021"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(tidyverse)
library(readxl)
```
Based on IPA analysis, cellular functions were extracted that are increased in Fuso vs. Non-Fuso
exported excel contains sorted activation score filtered for increased activation
# TCGA
## Canonical pathways
```{r IPA visualization (TCGA), fig.width=10, fig.height=5}
Extracted_pathways_TCGA <- c("Tumor Microenvironment Pathway",
"CCR5 Signaling in Macrophages",
"Natural Killer Cell Signaling",
"Clathrin-mediated Endocytosis Signaling",
"HMGB1 Signaling",
"RhoGDI Signaling",
"Crosstalk between DC and NK Cells",
"Superpathway of Methionine Degradation",
"Actin Cytoskeleton Signaling",
"NFAT Regulation of the Immune Response")
ipa_TCGA <- read_excel("../raw_data/IPA/Full_TCGA_gm_load_hogh_no_05.xls", skip = 1) %>%
dplyr::select(diseasefun = "Ingenuity Canonical Pathways",
zscore = "z-score", padj = "-log(p-value)", Molecules) %>%
mutate(zscore = ifelse(is.na(zscore), 0, zscore)) %>%
mutate(molecules = lengths(strsplit(.$Molecules, ","))) %>%
mutate(diseasefun = ifelse(diseasefun == "Crosstalk between Dendritic Cells and Natural Killer Cells",
"Crosstalk between DC and NK Cells",
ifelse(diseasefun == "Role of NFAT in Regulation of the Immune Response",
"NFAT Regulation of the Immune Response",
diseasefun)))
ipa_TCGA %>% mutate(diseasefun = fct_reorder(diseasefun, zscore)) %>%
filter(diseasefun %in% Extracted_pathways_TCGA) %>%
ggplot(aes(x = zscore, y = diseasefun, size = molecules, color = padj)) +
geom_point() +
xlab("Activation score (z-score)") +
ylab("") +
theme_classic() +
scale_colour_gradient(low = "grey", high = "black") +
labs(size="# of molecules", colour="-log(p-value)") +
theme(axis.text.y = element_text(size = 18),
axis.text.x = element_text(size = 16),
axis.title.x = element_text(size = 16))
ggsave("../GSEA_IPA_plotting_results/IPA_TCGAGm_dis_pat_plot_top.png", last_plot(), device = "png", width = 10, height = 5)
```
## GSEA (pathfindr - KEGG)
```{r Plot TCGAFnveryhigh RA_Output, fig.width=8, fig.height=4}
TCGA_RA_output <- read.csv("../midica_pathseq_results/GSEA/TCGAGm_Gm-high_RA_output_Kegg.csv")
Extracted_pathways_TCGA <- c("Adherens junction",
"Complement and coagulation cascades",
"Neurotrophin signaling pathway",
"Regulation of actin cytoskeleton",
"Ras signaling pathway",
"Proteoglycans in cancer",
"Tight junction",
"Leukocyte transendothelial migration",
"Wnt signaling pathway",
"Transcriptional misregulation in cancer 1.")
TCGA_RA_output %>% mutate(Term_Description = fct_reorder(Term_Description, Fold_Enrichment)) %>%
mutate(n_up = lengths(strsplit(.$Up_regulated, ","))) %>%
mutate(n_down = lengths(strsplit(.$Down_regulated, ","))) %>% # Only upregulated genes found
mutate(ratio_updown = log(n_up/n_down)) %>%
mutate(n_both = n_up+n_down) -> TCGA_RA_output_plot
TCGA_RA_output_plot %>%
filter(Term_Description %in% Extracted_pathways_TCGA | str_detect(Term_Description, "HIF")) %>%
top_n(10, highest_p) %>%
ggplot(aes(x = Fold_Enrichment, y = Term_Description, size = n_up, color = highest_p)) +
geom_point() +
xlab("Fold Enrichment") +
ylab("") +
theme_classic() +
scale_colour_gradient(low = "grey", high = "black") +
labs(size="# genes", color = "p-value") +
theme(axis.text.y = element_text(size = 16),
axis.text.x = element_text(size = 14),
axis.title.x = element_text(size = 14))
ggsave("../GSEA_IPA_plotting_results/KEGG_TCGA_Gm-very_high_plot_top.png", last_plot(), device = "png", width = 8, height = 5)
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment