Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(ggplot2)
- library(dplyr)
- library(forcats)
- library(hrbrthemes)
- library(viridis)
- library(tidyr)
- library(ggsignif)
- setwd("C:/Users/Christopher/OneDrive/A_UC_LabAdmin_Projects/Research_Projects/R21_PRELIMINARY_GBM_PROJECT_COLLABORATION/Data_Materials/ExternalBioinformaticDatasets/timeDB/")
- # Load Cell and Clinical Information
- lgg_cell <- read.csv(file="CD_TCGA_LGG_2_xCell_full.csv", header=TRUE)
- lgg_clinical <- read.csv(file="CD_TCGA_LGG_2_Clinical.csv", header=TRUE)
- # Modify matrices
- rownames(lgg_cell) <- lgg_cell[,1]
- rownames(lgg_clinical) <- lgg_clinical[,1]
- lgg_cell <- lgg_cell[,-1]
- lgg_clinical <- lgg_clinical[,-1]
- # Combine matrices by TCGA sample id
- lgg_cell[rownames(lgg_clinical),colnames(lgg_clinical)] <- lgg_clinical
- # Create intervals for n_age and pfs
- lgg_cell$age_int <- cut_interval(lgg_cell$n_age, n = 2)
- lgg_cell$pfs_int <- cut_interval(lgg_cell$pfs, n = 2)
- jpeg(file=paste("race-sex.jpeg", sep=""), width = 2000, height = 2000)
- lgg_cell %>%
- mutate(day = fct_reorder(c_race, c_gender)) %>%
- mutate(day = factor(c_race, levels=c("Asian", "White", "Black"))) %>%
- drop_na(c("age_int", "c_gender")) %>%
- ggplot(aes(fill=c_gender, y=Monocytes, x=age_int)) +
- geom_violin(position="dodge", alpha=0.5, outlier.colour="transparent") +
- scale_fill_viridis(discrete=T, name="") +
- theme_ipsum() +
- xlab("") +
- ylab("Tip (%)") +
- geom_signif(
- comparisons = list(c("female, [14,50.5]", "male, [14,50.5]")), # Specify the pairs to compare
- map_signif_level = TRUE, # Show the significance level as stars
- y_position=0.1
- )
- dev.off()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement