簡體   English   中英

如何在 R 中將 plot 多序列 alignment 作為箱線圖和散點圖:

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM