knitr::opts_chunk$set(echo = TRUE, message=FALSE, warning=FALSE)
if (!require(DECIPHER)) { BiocManager::install("DECIPHER") } library(DECIPHER)
remote_folder="https://raw.githubusercontent.com/PacktPublishing/R-Bioinformatics-Cookbook/master/datasets/ch3" # change "Chapter03" to "ch3" fa_file = "plastid_genomes.fa" if (!file.exists(fa_file)) { download.file(file.path(remote_folder,fa_file),fa_file) } stopifnot(file.exists(fa_file))
library(Biostrings) seqs <- readDNAStringSet(fa_file) seqs
sequence_names <- names(seqs) Seqs2DB(seqs, "XStringSet", "long_db", sequence_names)
synteny = FindSynteny("long_db") pairs(synteny)
plot(synteny)
alignment = AlignSynteny(synteny, "long_db")
blocks = unlist(alignment[[1]]) writeXStringSet(blocks, "genome_blocks_out.fa")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.