• A Minimal Book Example
  • 1 Overview
  • 2 R and Package installation
  • 3 Load packages and download data
  • 4 Input data and processing
  • 5 Figure 1. Clonal hematopoiesis in longevous elderly group and common elderly group.
    • 5.1 Barplot for CH
    • 5.2 Barplot for CHIP
  • 6 Figure 2. CH mutations in the longevous elderly group versus the common elderly group.
    • 6.1 Number of mutation (boxplot)
    • 6.2 Number of mutation (barplot)
  • 7 Figure 3. Association analysis of CH and age-related biomarkers.
  • 8 Figure 4. Correlation between the size of CH versus age and aging biomarkers.
    • 8.1 Correlation analysis with scatter plot
    • 8.2 Stacked bar plot depicting CH with VAF≥10% (Large) and CH with VAF<10% (Small)
    • 8.3 Comparison of the expression of aging biomarkers (between Large and Small)
  • 9 Figure 5. Correlation between the size of CH versus the number of mutant alleles per individual
    • 9.1 Correlation analysis with scatter plot
    • 9.2 Comparison of the number of mutant alleles per individual
    • 9.3 Stacked bar plot depicting CH-positive individuals with different numbers of mutant alleles
  • 10 Supplemental Figure S1. CH or CHIP between two genders
  • Published with bookdown

The impact of age and number of mutations on the size of clonal hematopoiesis

7 Figure 3. Association analysis of CH and age-related biomarkers.

# prepare data
df_serum <- read_excel("./Serum.xlsx") %>% as_tibble() %>% pivot_longer(cols=CHIT1:IL8, names_to='Cytokines', values_to='value') %>% mutate(ID=as.character(ID)) %>% mutate(Cytokines = factor(Cytokines,levels = c("IL8","TNFα","ITAC","S100A8","CHIT1")))
# IL-8 (IL8)
# TNF-α (TNFα)
# ITAC 
# S100A8
# CHIT1
# Figure 3A Cytokines and age group
df_box1 <- df_serum %>% mutate(age_group=ifelse(Age>=90,"Longevous","Common")) %>%  mutate(age_group=factor(age_group,levels = c("Longevous","Common"))) 

# plot
Cytokines_Age=ggplot(df_box1,aes(x=age_group, y=value,color=age_group)) + 
    stat_boxplot(geom="errorbar",position=position_dodge(width=0.2),width=0.2,size=0.5) +
    geom_boxplot(aes(),notch = F,size=0.5,width=0.5,outlier.shape=NA) +
    geom_jitter(size = 0.4,alpha = 0.3,width = 0.2) + 
    theme_bw() +
    theme(axis.text = element_text(colour='black',size=9)) +
    labs(x="", y="Concentration (pg/ml)")+
    facet_wrap(~Cytokines, scales = "free_y", ncol = 5) +
    theme(strip.background = element_rect(fill=c("white"))) +
    theme(strip.text = element_text(size = 12,face = 'bold',colour = "gray2")) +
    theme(axis.text=element_text(colour='black',size = 11),legend.position ="none") +
    stat_compare_means(comparisons = list(c("Longevous", "Common")), method = "wilcox.test", label = "p.format", size = 4) +
    scale_color_manual(values = c("Longevous" = "springgreen4", "Common" = "#00D66B"), guide = FALSE) 

#file.path(outdir,"Cytokines_Age.pdf") %>% ggsave(Cytokines_Age,width=10,height=3)

# Figure 3B Cytokines and CH+/CH- 
df_box2 <- df_serum %>% mutate(CH=ifelse(CH==1,"CH+","CH-")) %>% mutate(CH=factor(CH,levels = c("CH+","CH-")))

# plot
Cytokines_ch=ggplot(df_box2,aes(x=CH, y=value,color=CH)) +
    stat_boxplot(geom="errorbar",position=position_dodge(width=0.2),width=0.2,size=0.5) +
    geom_boxplot(aes(),notch = F,size=0.5,width=0.5,outlier.shape= NA) +
    geom_jitter(size = 0.4,alpha = 0.3,width = 0.2) + 
    theme_bw() +
    theme(axis.text=element_text(colour='black',size=9)) +
    labs(x="", y="Concentration (pg/ml)", color = "CH",fill = "CH") +
    facet_wrap(~Cytokines, scales = "free_y", ncol = 5) +
    theme(strip.background = element_rect(fill=c("white"))) +
    theme(strip.text = element_text(size = 12,face = 'bold',colour = "gray2")) +
    theme(axis.text=element_text(colour='black',size = 11),legend.position ="none")+
    stat_compare_means(comparisons = list(c("CH-", "CH+")), method = "wilcox.test", size = 4)

# Figure 3A and 3B saved into a file 'Cytokines_Age_CH.pdf'
Cytokines_both <- list(Cytokines_Age,Cytokines_ch) %>% wrap_plots(nrow=2, heights =c(1,1))
file.path(outdir,"Cytokines_Age_CH.pdf") %>% ggsave(Cytokines_both,width=10,height=7)