DNA/RNA/氨基酸多序列比对图R包ggmsa
## R包安装```
BiocManager::install("ggplot2")
BiocManager::install("ggmsa")
```
## DNA多序列比对图
```
# 导入内置核酸序列
nt_sequences <- system.file("extdata", "LeaderRepeat_All.fa", package = "ggmsa")
ggmsa(nt_sequences, color="Chemistry_AA", font = "DroidSansMono", char_width = 0.5, seq_name = TRUE)
```
![](data/attachment/forum/plugin_zhanmishu_markdown/202407/84b1542b5c2b3d4bc824581ff5ebc338_1720311484_6370.png)
## RNA多序列比对图
```
miRNA_sequences <- system.file("extdata", "seedSample.fa", package = "ggmsa")
ggmsa(miRNA_sequences, font = 'DroidSansMono',color = "Chemistry_NT", none_bg = TRUE) +
geom_seed(seed = "GAGGUAG", star = FALSE)ggmsa(miRNA_sequences, font = 'DroidSansMono',color = "Chemistry_NT") +
geom_seed(seed = "GAGGUAG", star = TRUE)
```
![](data/attachment/forum/plugin_zhanmishu_markdown/202407/2a24ebf12762a18632974c57ba4e900a_1720311494_8694.png)
## 蛋白质多序列比对图
```
protein_sequences <- system.file("extdata", "sample.fasta", package = "ggmsa")
ggmsa(protein_sequences, 221, 280, seq_name = TRUE, char_width = 0.5) +
geom_seqlogo(color = "Chemistry_AA") + geom_msaBar()
```
![](data/attachment/forum/plugin_zhanmishu_markdown/202407/c7b4b121d58be616e74ccd1f5cd6290b_1720311503_9955.png)
## 基因组变异图
```
fas <- list.files(system.file("extdata", "GVariation", package="ggmsa"), pattern="fas", full.names=TRUE)
x <- seqdiff(fas, reference=1)
plot(
x,
width = 50,
title = "auto",
xlab = "Nucleotide Position",
by = "bar",
fill = "firebrick",
colors = c(A = "#ff6d6d", C = "#769dcc", G = "#f2be3c", T = "#74ce98"),
xlim = NULL
)
```
![](data/attachment/forum/plugin_zhanmishu_markdown/202407/cea5a6b3a95764ff5addb8f816afa5e3_1720311513_9282.png)
页:
[1]