getContextSequences: Retrieve upstream and downstream sequences

View source: R/02.getContextSequences.R

getContextSequencesR Documentation

Retrieve upstream and downstream sequences

Description

Retrieve upstream and downstream sequences of pA sites from a BSgenome object based on a GRanges object

Usage

getContextSequences(peaks, upstream = 40L, downstream = 30L, genome)

Arguments

peaks

An object of GRanges representing pA sites

upstream

An integer(1) vector, length of upstream sequence of pA sites, including pA site.

downstream

An integer(1) vector, length of downstream sequences of pA sites

genome

An object of BSgenome.

Value

A data.frame containing sequences upstream and downstream pA sites:

upstream.seq

sequence upstream pA site, including pA site

downstream.seq

sequence downstream pA site

Author(s)

Haibo Liu

Examples

library(BSgenome.Drerio.UCSC.danRer7)
testFile <- system.file("extdata", "test.bed",
                        package = "cleanUpdTSeq")
peaks <- BED6WithSeq2GRangesSeq(file = testFile, 
                               skip = 1L, withSeq = FALSE)
peaks_seq <- getContextSequences(peaks, 
                                 upstream = 40L, 
                                 downstream = 30L,
                                 genome = Drerio) 
                                                        

jianhong/cleanUpdTSeq documentation built on Nov. 5, 2024, 7:46 a.m.