简体   繁体   中英

How can I plot multiple sequence alignment in R as a boxplot and scatterplot:

  • I've fasta file contains 16 protein and I aligned them with package ("msa"). now I need to Visualize my results of similar sequences using boxplots and scatterplot

  • I read about "ggmsa" but it's not working on my R version, and I tried many other version but it's still not working.

  • my code:

#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()

The Bioconductor package DECIPHER have a very good tool for visualizing sequences in your browser.

It doesn't work with msa 's object type but works with regular Biostrings stringsets.

# 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

These example sequences are pre-aligned, but anything you can align and convert to an XStringSet can be visualized with BrowseSeqs() .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM