generate_peak_gtf: Merge peak and generate gft

View source: R/preprocess.R

generate_peak_gtfR Documentation

Merge peak and generate gft

Description

Merge the peaks that are close to each other and modify the length of the peak to 2*(peak_half_width). Finally, return peaks related gtf file

Usage

generate_peak_gtf(peak, peak_half_width = 250)

Arguments

peak

data.frame, indicating peaks file. If you call peak for each sample separately, you need to combine these peaks firstly through cbind().

peak_half_width

numeric, indicating half of peak width

Value

return peaks related gtf file

Examples

load(system.file("extdata", "test_peak.rda", package = "IReNA"))
peaks <- test_peak[,c(1,2,3)]
gtf <- generate_gtf(peaks)

## Not run: 
 sample1_peaks <- read.delim("sample1_peaks.narrowPeak", header=FALSE)
 sample2_peaks <- read.delim("sample2_peaks.narrowPeak", header=FALSE)
 sample3_peaks <- read.delim("sample3_peaks.narrowPeak", header=FALSE)
 sample4_peaks <- read.delim("sample4_peaks.narrowPeak", header=FALSE)
 sample5_peaks <- read.delim("sample5_peaks.narrowPeak", header=FALSE)
 sample6_peaks <- read.delim("sample6_peaks.narrowPeak", header=FALSE)
 all_peak <- rbind(sample1_peaks, sample2_peaks, sample3_peaks, sample4_peaks,
 sample5_peaks, sample6_peaks)
 peaks_merged_gtf <- generate_peak_gtf(all_peak)

## End(Not run)

jiang-junyao/IReNA documentation built on Nov. 15, 2024, 1:51 a.m.