[英]How can I plot multiple sequence alignment in R as a boxplot and scatterplot:
我的 fasta 文件包含 16 种蛋白质,我将它们与 package(“msa”)对齐。 现在我需要使用箱线图和散点图来可视化相似序列的结果
我阅读了有关“ggmsa”的信息,但它不适用于我的 R 版本,我尝试了许多其他版本,但它仍然无法正常工作。
我的代码:
#if (!requireNamespace("BiocManager", quietly = TRUE))
#install.packages("BiocManager")
#BiocManager::install("msa")
library("msa")
mySequenceFile <-file.choose(file.choose())
mySequences <- readAAStringSet(mySequenceFile)
## ----doAlignment-----------------------------------------------
Multiple_Alignment <- msa(mySequences)
## ----showWholeWidth--------------------------------------------
sink("align.txt") #Send R Output to a File
print(Multiple_Alignment, show="complete")
sink()
Bioconductor package DECIPHER
有一个非常好的工具,可以在浏览器中可视化序列。
它不适用于msa
的 object 类型,但适用于常规Biostrings
字符串集。
# load in your library
library(DECIPHER)
# load the example DNA sequences
db <- system.file("extdata", "Bacteria_175seqs.sqlite", package="DECIPHER")
dna <- SearchDB(db) # non-coding ribosomal RNA gene sequences
# example of using the defaults with DNA sequences
BrowseSeqs(dna) # view the XStringSet in your default browser window
这些示例序列是预先对齐的,但是您可以对齐并转换为XStringSet
的任何内容都可以使用BrowseSeqs()
进行可视化。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.