strandPileup {ChIPseqR} | R Documentation

## Strand specific read counts

### Description

Given a set of aligned reads this function computes the number of reads starting at each position in the genome.

### Usage

    ## S4 method for signature 'AlignedRead'
    strandPileup(aligned, chrLen, extend,  coords=c("leftmost", "fiveprime"),
    		compress = TRUE, plot = TRUE, ask = FALSE, ...)
    ## S4 method for signature 'data.frame'
    strandPileup(aligned, chrLen, extend, coords=c("leftmost", "fiveprime"),
    		compress = TRUE, plot = TRUE, ask = FALSE, ...)

### Arguments

`aligned` | An object containing information about aligned reads (see Details).
`chrLen` | A numeric vector giving the length of each chromosome.
`extend` | A numeric value indicating how far reads should be extended.
`coords` | A character value indicating the coordinate system to use. See `coverage` for details.
`compress` | Logical indicating whether read counts should be compressed.
`plot` | If this is `TRUE` (the default) read coverage is plotted for all chromosomes.
`ask` | Logical. Setting this to `TRUE` causes the system to wait for user input before displaying a new plot. See `devAskNewPage`.
`...` | Further arguments to `coverage`.

### Details

The method for `data.frame` requires the column names to follow a strict naming scheme. Required columns are

‘chromosome’

  A factor with chromosome names.

‘strand’

  A factor with levels “-” and “+” indicating which strand the read mapped to.

‘start’ or ‘position’

  Start position of read on chromosome.

‘end’ or ‘length’

  End position of read or length of read respectively.

### Value

An object of class `ReadCounts`.

### Author(s)

Peter Humburg

### See Also

`coverage`, `AlignedRead`, `callBindingSites`

### Examples

    	## 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))))

    	readPile <- strandPileup(reads, chrLen=500, extend=1, plot=FALSE)

[Package ChIPseqR version 1.40.0 Index]