@@ -175,6 +175,10 @@ dt.vdjdb.s2 = dt.vdjdb.s %>%
175175 mhc_count = length(unique(mhc_key[which(pub_date <= pub_date2)])))
176176
177177p1=ggplot(dt.vdjdb.s2, aes(x = as.integer(pub_date2), y = tcr_count, color = chains)) +
178+ annotate("segment", x = 2017, xend = 2017, y = 0, yend = 19000, linetype="dotted", size = 0.3) +
179+ annotate("text", x = 2017, y = 21000, label = "AIRR-seq for tet+", hjust = 1, vjust = 1) +
180+ annotate("segment", x = 2019, xend = 2019, y = 0, yend = 27000, linetype="dotted", size = 0.3) +
181+ annotate("text", x = 2019, y = 30000, label = "10X & dCODE", hjust = 1, vjust = 1) +
178182 geom_line() +
179183 geom_point() +
180184 ylab("") +
@@ -185,6 +189,8 @@ p1=ggplot(dt.vdjdb.s2, aes(x = as.integer(pub_date2), y = tcr_count, color = cha
185189 axis.line = element_line(size = 0.3))
186190
187191p2=ggplot(dt.vdjdb.s2, aes(x = as.integer(pub_date2), y = epi_count, color = chains)) +
192+ annotate("segment", x = 2021, xend = 2021, y = 0, yend = 1000, linetype="dotted", size = 0.3) +
193+ annotate("text", x = 2021, y = 1150, label = "COVID-19 studies", hjust = 1, vjust = 1) +
188194 geom_line() +
189195 geom_point() +
190196 ylab("") +
@@ -391,7 +397,7 @@ ggplot(df.score, aes(x=paste(mhc.class, gene, sep = " "), y=total, fill = as.fac
391397
392398#### Spectratype
393399
394- Representative data for Homo Sapiens. The spectratype is colored by epitope.
400+ Representative data for Homo Sapiens. CDR3 length distribution ( spectratype) is colored by cognate epitope. Second plot shows epitope length distribution for MHC class I and II colored by unique CDR3 (alpha or beta) records .
395401
396402``` {r message=FALSE, warning=FALSE}
397403df.spe = subset(df, species=="HomoSapiens")
@@ -400,11 +406,13 @@ ggplot(df.spe %>% mutate(
400406 epi_len = nchar(antigen.epitope),
401407 antigen.epitope = as.factor(antigen.epitope)),
402408 aes(x=nchar(as.character(cdr3)))) +
403- geom_histogram(aes(fill = antigen.epitope %>% fct_reorder(epi_len) %>% as.integer(),
404- group = antigen.epitope), #),
409+ geom_histogram(aes(fill = antigen.epitope %>%
410+ fct_reorder(epi_len) %>% as.integer(),
411+ group = antigen.epitope %>%
412+ fct_reorder(epi_len)),
405413 bins = 21, size = 0,
406414 binwidth = 1, alpha = 0.9, color = NA) +
407- geom_density(aes(y=..count..), adjust = 4 , linetype = "dotted") +
415+ geom_density(aes(y=..count..), adjust = 3.0 , linetype = "dotted") +
408416 scale_x_continuous(limits = c(5,25), breaks = seq(5,25,5)) +
409417 facet_wrap(~gene) +
410418 scale_fill_distiller(palette = "Spectral", guide=F, "") +
@@ -413,6 +421,25 @@ ggplot(df.spe %>% mutate(
413421 theme_classic() +
414422 theme(axis.line = element_line(size = 0.3),
415423 strip.background = element_blank())
424+
425+ ggplot(df.spe %>% mutate(
426+ cdr3_len = nchar(cdr3),
427+ cdr3 = as.factor(cdr3)),
428+ aes(x=nchar(antigen.epitope))) +
429+ geom_histogram(aes(fill = cdr3 %>%
430+ fct_reorder(cdr3_len) %>% as.integer(),
431+ group = cdr3 %>%
432+ fct_reorder(cdr3_len)),
433+ size = 0,
434+ binwidth = 1, alpha = 0.9, color = NA) +
435+ scale_x_continuous(breaks = 7:25) +
436+ facet_wrap(.~mhc.class, scales = "free") +
437+ scale_fill_distiller(palette = "Spectral", guide=F, "") +
438+ #scale_fill_viridis_d(guide=F, direction = -1) +
439+ xlab("Epitope length") + ylab("Records") +
440+ theme_classic() +
441+ theme(axis.line = element_line(size = 0.3),
442+ strip.background = element_blank())
416443```
417444
418445#### V(D)J usage and MHC alleles
0 commit comments