I have been using BrowseSeqs from the DECIPHER package to view sequence alignments during analysis. The two output options are to open a browser window or save an HTML file. It would be very useful to have the results display in the R Notebook. Is there any way to do this?
We have figured out a workaround for displaying external html code inside R Notebooks. It is not exactly the same as displaying it in a browser window by itself, but it is better than nothing. First you tell BrowseSeqs() to write the html output to a specific file, and then you use htmltools::includeHTML() to incorporate that file into the R Notebook. For example:
```{r}
library(DECIPHER)
library(knitr)
library(htmltools)
```
```{r}
# 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
```
```{r, results = 'asis', echo = FALSE}
TF <- tempfile()
BrowseSeqs(dna,
htmlFile = TF)
cat(htmltools::includeHTML(TF))
```
Thanks! I'm creating reports for wet lab scientists at my company and it's very helpful to reduce the number of files they need to view.