knitr::opts_chunk$set(tidy = FALSE,
           message = FALSE)
library("seqcombo")

Sequence difference plot

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])

Sequence similarity plot

fas <- system.file("examples/GVariation/sample_alignment.fa", package="seqcombo")
simplot(fas, 'CF_YL21')

Session info

Here is the output of sessionInfo() on the system on which this document was compiled:

sessionInfo()

References



GuangchuangYu/seqcombo documentation built on Oct. 31, 2024, 10:13 a.m.