extendRanges {htSeqTools} | R Documentation

## Extend reads or sequences by a user-specified number of bases.

### Description

This function allows to extend ranges up to a user-specified length, which can be helpful in ChIP-seq analysis.

### Usage

    extendRanges(x, seqLen = 200, chrlength, mc.cores=1)

### Arguments

`x` | Object containing reads.
`seqLen` | Desired sequence length after extension.
`chrlength` | Integer vector indicating the length of each chromosome. `names(chrlength)` must match those in `x`. This argument is used to ensure that no reads are extended beyond the maximum chromosome length.
`mc.cores` | Number of cores to use in parallel computations (passed on to `mclapply`).

### Value

A list of `IRanges` objects with extended sequence length.

### Methods

`signature(x = "RangedData")`

  `space(x)` indicates the chromosome, `start(x)` and `end(x)` the start/end positions of each read.

`signature(x = "list")`

  Each element in `x` is assumed to correspond to a different sample.

### Author(s)

David Rossell

### Examples

    set.seed(1)
    st <- round(rnorm(1000,500,100))
    st[st>2000] <- 2000
    strand <- rep(c('+','-'),each=500)
    space <- rep('chr1',length(st))
    sample1 <- RangedData(IRanges(st,st+38),strand=strand,space=space)
    extendRanges(sample1, seqLen=200, chrlength=c(chr1=2000))

[Package htSeqTools version 1.30.0 Index]