ReadCounts-class {ChIPseqR} | R Documentation

## Class "ReadCounts"

### Description

Represents counts of (possibly extended) reads for each strand of the genome.

### Usage

    ReadCounts(counts=list(), names=NULL, compress=TRUE)

### Arguments

`counts` | A list of read counts. Each component is a two column matrix of strand specific read counts for a chromosome.
`names` | Character vector of chromosome names. If this is `NULL` the names of `counts` are used instead.
`compress` | Logical indicating whether read counts should be compressed.

### Objects from the Class

Objects can be created by calls of the form `ReadCounts(counts, names, compress=FALSE)` or by calls to `strandPileup`.

### Slots

`counts`:

  Object of class `"list"` with one component per chromosome, containing a matrix of read counts (one column per strand).

### Methods

[<-

  `signature(x = "ReadCounts", i = "ANY", j = "missing")`: Replace read counts for chromosomes indicated by `i`.

[

  `signature(x = "ReadCounts", i = "ANY", j = "missing", drop = "missing")`: Returns list of read counts for chromosomes indicated by `i`.

[[<-

  `signature(x = "ReadCounts", i = "ANY", j = "missing")`: Replace read counts for chromosome `i`.

[[

  `signature(x = "ReadCounts", i = "ANY", j = "missing")`: Returns read counts for chromosome `i`.

$<-

  `signature(x = "ReadCounts")`: Replace read counts for chromosome `i` (by name).

$

  `signature(x = "ReadCounts")`: Returns read counts for chromosome `i` (by name).

callBindingSites

  `signature(data = "ReadCounts")`: Predict bindingsites from read counts.

chrLength

  `signature(x = "ReadCounts", subset = "ANY")`: Returns length of all chromosomes represented in `x`.

lapply

  `signature(X = "ReadCounts")`: Apply function to read counts for each chromosome.

length<-

  `signature(x = "ReadCounts")`: Change the number of chromosomes represented by `x` to `value`.

length

  `signature(x = "ReadCounts")`: Number of chromosomes represented by `x`.

names<-

  `signature(x = "ReadCounts", value = "ANY")`: Change names of chromosomes.

names

  `signature(x = "ReadCounts")`: Chromosome names.

nreads

  `signature(x = "ReadCounts", byStrand = "Logical", subset = "ANY")`: Returns the number of reads on each chromosome, split by strand (if `byStrand` is `TRUE`).

sapply

  `signature(X = "ReadCounts")`: Apply function to read counts for each chromosome.

### Author(s)

Peter Humburg

### See Also

`BindScore`, `strandPileup` , `compress`, `decompress`

### Examples

    showClass("ReadCounts")

    ## generate some very simple artificial read data
    set.seed(1)
    fwd <- sample(c(50:70, 250:270), 30, replace=TRUE)
    rev <- sample(c(197:217, 347:417), 30, replace=TRUE)
    ## create data.frame with read positions as input to strandPileup
    reads <- data.frame(chromosome="chr1", position=c(fwd, rev),
    	length=25, strand=factor(rep(c("+", "-"), times=c(30, 30))))

    ## create object of class ReadCounts
    readPile <- strandPileup(reads, chrLen=500, extend=1, plot=FALSE, compress=FALSE)

    names(readPile)
    length(readPile)
    sapply(readPile, sum)

[Package ChIPseqR version 1.46.0 Index]