-
Notifications
You must be signed in to change notification settings - Fork 3
/
README.Rmd
74 lines (58 loc) · 1.63 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
output: rmarkdown::github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r echo=FALSE, message=FALSE}
knitr::opts_chunk$set(message=FALSE, warning=FALSE, comment="", fig.path="man/figures/README-")
devtools::load_all()
```
# bands
Simple interactive chromosome maps written in R
## Source
```{r, eval=FALSE}
library(bands)
```
## Barebones Example Data
```{r}
samples <- 250
bands <- paste('Chromosome', 0:9)
starts <- sample(1:500000, samples, replace=TRUE)
ends <- sapply(starts, function(x) x+sample(1:10000, 1))
df <- data.frame(band = sample(bands, samples, replace=TRUE),
start = starts,
end = ends,
stringsAsFactors=FALSE)
dim(df)
head(df)
```
### Deafult Plot
```{r}
draw.bands(df)
```
## Detailed Example Data
```{r}
samples <- 250
bands <- paste('Chromosome', 0:9)
starts <- sample(1:500000, samples, replace=TRUE)
ends <- sapply(starts, function(x) x+sample(1:10000, 1))
names <- paste('Label', sample(LETTERS, samples, replace=TRUE))
colors <- sample(c('#f3cec9', '#e7a4b6', '#cd7eaf', '#a262a9', '#6f4d96', '#3d3b72', '#182844'), samples, replace=T)
opacitys <- sample(50:100/100, samples, replace=TRUE)
df <- data.frame(band = sample(bands, samples, replace=TRUE),
start = starts,
end = ends,
name = names,
color = colors,
opacity = opacitys,
stringsAsFactors=FALSE)
dim(df)
head(df)
```
### Default Plot
```{r}
draw.bands(df)
```
### Limit or Reorder Bands
```{r}
draw.bands(df, bands=c("Chromosome 1", "Chromosome 5", "Chromosome 3"))
```