knitr::opts_chunk$set(tidy = FALSE, message = FALSE)
library("seqcombo")
Here we use the data published in Potato
Research
[@chang_complete_2015] as an example.
fas <- list.files(system.file("examples","GVariation", package="seqcombo"), pattern="fas", full.names=TRUE) fas
The input fasta file should contains two aligned sequences. User need
to specify which sequence (1 or 2, 1 by default) as reference. The
seqdiff
function will parse the fasta file and calculate the
nucleotide differences by comparing the non-reference one to reference.
x1 <- seqdiff(fas[1], reference=1) x1
We can visualize the differences by plot
method:
plot(x1)
We can parse several files and visualize them simultaneously.
x <- lapply(fas, seqdiff) plts <- lapply(x, plot) plot_grid(plotlist=plts, ncol=1, labels=LETTERS[1:3])
fas <- system.file("examples/GVariation/sample_alignment.fa", package="seqcombo") simplot(fas, 'CF_YL21')
Here is the output of sessionInfo()
on the system on which this document was compiled:
sessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.