## 1. 载入工具包

Mapping data onto a Circos figure requires that you identify what patterns in your data are (a) likely to be important and (b) likely to be present, and create a figure that exposes such patterns. Remember, if the pattern exists, you can’t afford to miss it. If it doesn’t exist, you can’t afford to be fooled into thinking that it’s there, or left wondering whether it’s occluded by other data.

## 1. Run circos

$\newcommand{\entropfrac}[2]{\frac{#1}{#2} \log \left( \frac{#1}{#2} \right)}$

## Mututal Information (MI)

### Introduction

Mutual Information (MI) distance is used to measure the distance between two genes vectors, for example $x_1 = {1, 0, 1, 1, 1, 1, 0}$ and $y_1 = {0, 1, 1, 1, 1, 1, 0}$. It is easily to transfer the two vectors into a binary table:

X/Y 1(Presence) 0(Absence) Sum
1(Presence) a b a+b
0(Absence) c d c+d
Sum a+c b+d n=a+b+c+d

# R Package ggplot2 Notes

## 1. Basic grammar

### 1.1 Plot types

The R package ggplot2 is a famous plot tool for high quality scientific figures. The ggplot2 style figures are widely seen in papers published in high quality journals such as PNAS, Nature and Cell.

The input data should be in data frame form, and it is easily to use the function as.data.frame(). “+” is used to connect different plot statement. A typical ggplot2 plot statement is like: