View source: R/summary_matrix.R

summarizePeaks | R Documentation |

Given peaks for a set of samples in a query region, construct a sample-by- feature matrix where each row is a vector of summary statistics computed from peaks in the region.

```
summarizePeaks(localpeaks, mark, cols, fraction = TRUE, n = FALSE)
```

`localpeaks` |
LocalPeaks object |

`mark` |
String specifying the name of the mark for which the LocalPeaks object is given |

`cols` |
Character vector of column names on which to compute summary statistics |

`fraction` |
Loogical: compute the fraction of the region overlapped by peaks? |

`n` |
Logical: compute the number of peaks in the region? |

A matrix where rows are samples and columns are features

```
samples <- c("E068", "E071", "E074", "E101", "E102", "E110")
bedfiles <- system.file("extdata", paste0(samples, ".H3K4me3.bed"),
package = "chromswitch")
metadata <- data.frame(Sample = samples,
H3K4me3 = bedfiles,
stringsAsFactors = FALSE)
lpk <- retrievePeaks(H3K4me3,
metadata = metadata,
region = GRanges(seqnames = "chr19",
ranges = IRanges(start = 54924104, end = 54929104)))
summarizePeaks(lpk, mark = "H3K4me3", cols = c("qValue", "signalValue"))
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.