Learn R Programming

TransView (version 1.16.0)

peak2tss: Changes the peak center to the next TSS according to previous annotation

Description

Sets the peak boundaries of an annotated GRanges object with peak locations to TSS centered ranges based on the transcript_id column.

Usage

peak2tss(peaks, gtf, peak_len=500)

Arguments

peaks
An annotated GRanges object with a meta data column ‘transcript_id’ and ‘exon_id’ like e.g. from gtf2gr.
gtf
A GRanges object with a meta data column ‘transcript_id’ like e.g. from annotatePeaks.
peak_len
The desired total size of the region with the TSS located in the middle.

Value

A GRanges object

Details

Convenience function to change the peak centers to TSS for e.g. plotting with plotTV.

Examples

Run this code

exgtf<-dir(system.file("extdata", package="TransView"),full=TRUE,patt="gtf.gz$")[2]
fn.macs<-dir(system.file("extdata", package="TransView"),full=TRUE,patt="xls$")

GTF<-gtf2gr(exgtf)
peaks<-macs2gr(fn.macs,psize=500)

peaks.anno<-annotatePeaks(peaks=peaks,gtf=GTF)

peak2tss(peaks.anno, GTF, peak_len=500)

Run the code above in your browser using DataLab