---
title: "interacCircos"
output: rmarkdown::html_vignette
date: "`r Sys.Date()`"
author: "Zhe Cui"
vignette: >
  %\VignetteIndexEntry{interacCircos}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
keep_md: TRUE
self_contained: TRUE
---

## Introduction

JavaScript-based Circos libraries have been widely implemented to generate interactive Circos plots on web applications. However, these libraries require either local installation that requires compiling extra libraries or extra data processing procedures to prepare input and configuration for each track of plot, which limits the utility and capability of integration with powerful packages of R. Here, we present interacCircos, an R package for creating interactive Circos plots through the intregration of JavaScript-based libraries. interacCircos can simply and flexibly implement 14 track-plot functions and 7 auxiliary functions for presenting large-scale genomic data in interactive Circos plots. 

## Quick Start

The Quick Start step for interacCircos is available at https://mrcuizhe.github.io/interacCircos_documentation/html/quick_start.html

## Example

### Default genome track

```{r}
library(interacCircos)
Circos(width = 700,height = 550)
```

### Try changing genome list and its color

```{r, screenshot.force = FALSE}
library(interacCircos)
Circos(zoom = TRUE,genome=list("Example1"=100,"Example2"=200,
      "Example3"=300),genomeFillColor = c("red","blue","green"),
      width = 700,height = 550)
```

### Try automatically filling genome color

```{r, screenshot.force = FALSE}
library(interacCircos)
set.seed(1)
Circos(zoom = FALSE,genome=list("Example1"=100,"Example2"=200,
      "Example3"=300),genomeFillColor = "Blues",
      width = 700,height = 550)

```

### Simple example with multiple modules

#### Histogram module

```{r, screenshot.force = FALSE}
library(interacCircos)

histogramData <- histogramExample
Circos(moduleList=CircosHistogram('HISTOGRAM01', data = histogramData,
      fillColor= "#ff7f0e",maxRadius = 210,minRadius = 175,
      animationDisplay = TRUE),genome=list("2L"=23011544,"2R"=21146708,"3L"=24543557,"3R"= 27905053,"X"=22422827,"4"=1351857),
      outerRadius = 220, width = 700,height = 550)
```

#### SNP and Background module

```{r, screenshot.force = FALSE}
library(interacCircos)

snpData <- snpExample
Circos(moduleList=CircosSnp('SNP01', minRadius =150, 
      maxRadius = 190, data = snpExample,SNPFillColor= "#9ACD32", 
      circleSize= 2, SNPAxisColor= "#B8B8B8", SNPAxisWidth= 0.5, 
      animationDisplay=TRUE,animationTime= 2000, animationDelay= 0, 
      animationType= "linear") + 
      CircosBackground('BG01',minRadius = 145,maxRadius = 200),
      width = 700,height = 550)

```

## Session info
```{r, screenshot.force = FALSE}
sessionInfo()
```

## Document

Please visit https://mrcuizhe.github.io/interacCircos_documentation/index.html for a full document of interacCircos.

## Contact

Please visit https://github.com/mrcuizhe/interacCircos/issues for bug issues or contact cuizhet[at]hit.edu.cn for helping.
