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) 
                                                        

haibol2016/cleanUpdTSeq documentation built on April 14, 2022, 9:56 p.m.