---
title: "seqcombo for sequence recombination"
author: "Guangchuang Yu, The University of Hong Kong"
date: "`r Sys.Date()`"
bibliography: seqcombo.bib
csl: nature.csl
output:
  prettydoc::html_pretty:
    theme: cayman
    highlight: github
    toc: true
  pdf_document:
    toc: true
vignette: >
  %\VignetteIndexEntry{seqcombo introduction}
  %\VignetteEngine{knitr::rmarkdown}
  %\usepackage[utf8]{inputenc}
---

```{r style, echo=FALSE, results="asis", message=FALSE}
knitr::opts_chunk$set(tidy = FALSE,
		   message = FALSE)
```


```{r echo=FALSE, results="hide", message=FALSE}
library("seqcombo")
```

# Sequence difference plot

Here we use the data published in `Potato
Research`[@chang_complete_2015] as an example.

```{r}
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.

```{r}
x1 <- seqdiff(fas[1], reference=1)
x1
```

We can visualize the differences by `plot` method:

```{r fig.height=4, fig.width=12}
plot(x1)
```

We can parse several files and visualize them simultaneously.

```{r fig.height=12, fig.width=12}
x <- lapply(fas, seqdiff)
plts <- lapply(x, plot)
plot_grid(plotlist=plts, ncol=1, labels=LETTERS[1:3])
```

# Sequence similarity plot

```{r}
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:
```{r echo=FALSE}
sessionInfo()
```


# References
