sequenceCalc {Repitools} | R Documentation

## Find occurences of a DNA pattern

### Description

Function to find all occurrences of a DNA pattern in given locations.

### Usage

      ## S4 method for signature 'GRanges,BSgenome'
    sequenceCalc(x, organism, pattern, fixed = TRUE, positions = FALSE)
      ## S4 method for signature 'data.frame,BSgenome'
    sequenceCalc(x, organism, window = NULL, positions = FALSE, ...)

### Arguments

`x` | A `data.frame`, with columns `chr` and `position`, or instead of the column `position` there can be columns `start`, `end`, and `strand`, or a `GRanges` object of the regions.
`window` | Bases around the locations supplied in `x` that are in the window. Calculation will consider `windowSize/2-1` bases upstream, and `windowSize/2` bases downstream.
`organism` | The `BSgenome` object to calculate CpG density upon.
`pattern` | The `DNAString` to search for.
`fixed` | Whether to allow degenerate matches.
`positions` | If `TRUE` `FALSE`
`...` | Arguments passed into the `GRanges` method

### Details

If the version of the data frame with the start, end, and strand columns is given, the window will be created around the TSS.

### Value

If `positions` is `TRUE`, a list of vectors of positions of matches in relation to the elements of `x`, otherwise a `vector` of the number of matches for each element of `x`.

### Author(s)

Aaron Statham

### See Also

`cpgDensityCalc`, `mappabilityCalc`, `gcContentCalc`

### Examples

    require(BSgenome.Hsapiens.UCSC.hg18)
    TSSTable <- data.frame(chr=paste("chr",c(1,2),sep=""), position=c(100000,200000))
    sequenceCalc(TSSTable, 600, organism=Hsapiens, pattern=DNAString("CG"))

[Package Repitools version 1.26.0 Index]