alakazam包括一套功能来分析Ig和TCR氨基酸序列的物理化学性质。特别是对CDR3氨基酸特性的分析。可以通过 aminoAcidProperties 函数获取多种氨基酸 理化特征,包括:
length: 氨基酸长度 (total amino acid count) gravy: 平均疏水性 (grand average of hydrophobicity) bulkiness: 平均体积 (average bulkiness) polarity: 平均极性 (average polarity) aliphatic: 归一化脂肪族指数 (normalized aliphatic index) charge: 归一化净电荷 (normalized net charge) acidic: 酸性氨基酸 含量 (acidic side chain residue content) basic: 碱性氨基酸含量 (basic side chain residue content) aromatic: 芳香族氨基酸含量 (aromatic side chain content)
# Load required packages
library(alakazam)
library(dplyr)
# Subset example data
data(ExampleDb)
db <- ExampleDb[ExampleDb$sample_id == "+7d", ]这个例子演示了如何从先前加载的AIRR文件计算DNA序列对应氨基酸特性。默认情况下,使用nt=TRUE参数完成DNA序列到氨基酸序列的翻译。如果只关注CDR3序列,我们指定参数trim=TRUE,这将在分析之前剥离第一个和最后一个密码子(保守残基)。使用label="cdr3"参数将前缀cdr3添加到输出列名中。
#核心代码
db_props <- aminoAcidProperties(db, seq="junction", trim=TRUE,
label="cdr3")
# The full set of properties are calculated by default
dplyr::select(db_props[1:3, ], starts_with("cdr3"))
# Define a ggplot theme for all plots
tmp_theme <- theme_bw() + theme(legend.position="bottom")
# Generate plots for all four of the properties
g1 <- ggplot(db_props, aes(x=c_call, y=cdr3_aa_length)) + tmp_theme +
ggtitle("CDR3 length") +
xlab("Isotype") + ylab("Amino acids") +
scale_fill_manual(name="Isotype", values=IG_COLORS) +
geom_boxplot(aes(fill=c_call))
g2 <- ggplot(db_props, aes(x=c_call, y=cdr3_aa_gravy)) + tmp_theme +
ggtitle("CDR3 hydrophobicity") +
xlab("Isotype") + ylab("GRAVY") +
scale_fill_manual(name="Isotype", values=IG_COLORS) +
geom_boxplot(aes(fill=c_call))
g3 <- ggplot(db_props, aes(x=c_call, y=cdr3_aa_basic)) + tmp_theme +
ggtitle("CDR3 basic residues") +
xlab("Isotype") + ylab("Basic residues") +
scale_y_continuous(labels=scales::percent) +
scale_fill_manual(name="Isotype", values=IG_COLORS) +
geom_boxplot(aes(fill=c_call))
g4 <- ggplot(db_props, aes(x=c_call, y=cdr3_aa_acidic)) + tmp_theme +
ggtitle("CDR3 acidic residues") +
xlab("Isotype") + ylab("Acidic residues") +
scale_y_continuous(labels=scales::percent) +
scale_fill_manual(name="Isotype", values=IG_COLORS) +
geom_boxplot(aes(fill=c_call))
# Plot in a 2x2 grid
gridPlot(g1, g2, g3, g4, ncol=2)
图1:CDR3氨基酸理化特征
图片来源
图1https://alakazam.readthedocs.io/en/stable/vignettes/AminoAcids-Vignette/