# install bioconductor dependencies source("https://bioconductor.org/biocLite.R") biocLite(c("msa", "ggtree")) # install from github library(devtools) install_github("esnapd/DegeneratePrimerTools") # you will probably also want muscle and FastTree on your CLI # see [bioconda](https://bioconda.github.io/) for easy install of these programs
library(dplyr) library(Biostrings) library(DegeneratePrimerTools) # load sequences ahbafna <- system.file("sequences/AHBA.fna",package="DegeneratePrimerTools") AHBAseqs <- readDNAStringSet(ahbafna) AHBAseqs AHBA_degeprimer <- degeprimer(AHBAseqs) AHBA_degeprimer
# alignments use the MSA package. You an Also provide your own sequence alignment AHBA_degeprimer <- AHBA_degeprimer %>% run_alignment() AHBA_degeprimer
# build a tree from the multiple sequence alignment using the bionj funciton frmo APE. # you can also provide your own tree AHBA_degeprimer <- AHBA_degeprimer %>% build_tree() AHBA_degeprimer plot(AHBA_degeprimer@phy_tree)
# run DEGEPRIME to find degenerate primers and store them in the # primerdata slot AHBA_degeprimer <- AHBA_degeprimer %>% design_primers(maxdegeneracies=c(1,10, 20, 50), number_iterations=2, force=TRUE) AHBA_degeprimer tail(AHBA_degeprimer@primerdata)
#to get to this point it is also possible to use chaining AHBA_degeprimer <- degeprimer(AHBAseqs) %>% run_alignment() %>% build_tree() %>% design_primers(maxdegeneracies=c(1,10), number_iterations=2) # this can take awhile
# interactive display of primers that helps choose the best degernate primer locations AHBA_degeprimer %>% choose_primer()
AHBA_degeprimer <- AHBA_degeprimer %>% add_primerpair(name="primerpair1", fpos=455, fdeg=10, rpos=617, rdeg=10) %>% add_primerpair(name="primerpair2", fpos=928, fdeg=10, rpos=1133, rdeg=10) AHBA_degeprimer@primerpairs
plot_coveragematrix(AHBA_degeprimer,max.mismatch = 0) plot_coveragematrix(AHBA_degeprimer,max.mismatch = 1) plot_coveragematrix(AHBA_degeprimer,max.mismatch = 2) plot_coveragematrix(AHBA_degeprimer,max.mismatch = 3)
DegeneratePrimerTools provides a Shiny App that lets you upload a fastafile and optionally choose a series of degeneracy values. IT will run a multiple sequence alingment, use DEGEPRIME to find deernate primers and display the top 4 most conserved sites and the primers chosen at those sites.
shiny::runGitHub("esnapd/DegeneratePrimerTools", subdir = "shiny")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.