Does anyone know how to generate a figure of the amino acid position in protein sequence?
2
0
Entering edit mode
18 months ago
mickley413 • 0

Does anyone know if there is a package or online tool to generate a figure like below given any protein sequence? Thank you so much!

acid figure protein amino sequence • 868 views
1
Entering edit mode
18 months ago
Asaf 10k

Some R code:

aa = c("A", "C", "D", "E", "F", "G", "H", "I", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "V", "W", "Y")
seq = strsplit("AKEQSWRT","")[[1]]
# Build a binary matrix with TRUE where the position has the AA in that row (positions are columns)
aamat <- matrix(aa, ncol=length(seq), nrow = length(aa)) == matrix(seq, ncol = length(seq), nrow = length(aa), byrow=T)
# Plot it
heatmap(aamat*1, Rowv=NA, Colv=NA, col=c('white','black'), xlab = "Position in protein sequence", ylab = "Amino acid")


0
Entering edit mode

Solved! Thank you so much for the idea!

0
Entering edit mode

Use "Green checkmark" to accept the answers to provide closure to this thread. You can accept multiple answers as correct.

1
Entering edit mode
18 months ago
barslmn ★ 2.2k

Never seen a package does this but like Asaf showed R is very convenient for plotting.

Here is another example:

aa <- c("A", "C", "D", "E", "F", "G", "H", "I", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "V", "W", "Y")
peptide <- sample(aa, 500, TRUE)
positions = c()
for (a in 1: length(aa)) {
for (p in 1:length(peptide)) {
if (aa[a] == peptide[p]) {
positions <- rbind(c(aa[a], p,a), positions)
}
}
}
pos <- positions[,-1]
rownames(pos) <- positions[,1]
plot(pos, pch = 20, yaxt="n")
axis(2, at=pos[,2], labels=rownames(pos), las=2)


0
Entering edit mode

It works perfectly, thank you so much!