Question: Display BrowseSeqs output in R Notebook?
0
gravatar for lauren.fitch
10 weeks ago by
lauren.fitch0 wrote:

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?

ADD COMMENTlink modified 10 weeks ago by Erik Wright140 • written 10 weeks ago by lauren.fitch0
Answer: Display BrowseSeqs output in R Notebook?
1
gravatar for Erik Wright
10 weeks ago by
Erik Wright140
Erik Wright140 wrote:

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))
```
ADD COMMENTlink written 10 weeks ago by Erik Wright140

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.

ADD REPLYlink written 9 weeks ago by lauren.fitch0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 255 users visited in the last hour