Using msaR

Zach Charlop-Powers

2017-10-01

Basic Usage

msaR is a an htmlwidgets wrapper of the BioJS MSA viewer javascript library. msa will pass alignments to the BioJS MSA and has a convenience funtion that will handle the following formats:

  1. A character string which is interpreted to be a fastafile (opened by ape::read.dna)
  2. A DNAbin class object (ape)
  3. An XStringSet (Biostrings) including “DNAStringSet”, “RNAStringSet”, “AAStringSet”, and “BStringSet”
  4. An XMultiple Alignment (Biostings) including “DNAMultipleAlignment”,“RNAMultipleAlignment”, and“AAMultipleAlignment”

Any of these types of objects can be passed to msaR to create an html widget:

library(msaR)

# read some sequences from a Multiple sequence alignment file.
seqfile <- system.file("sequences","AHBA.aln", package="msaR")

# display the MSA.
msaR(seqfile, menu=F, overviewbox = F)

Customized MSAs

msaR(seqfile, menu=F, overviewbox = F)

Use as a Shiny widget

msaR can be used as a widget with the Shiny web application framework.

In ui.R

msaROutput("msa", width="100%")

In server.R

output$msa <- renderMsaR(
  msaR(seqfile)
)