findTailsByPeaks: Find tail positions around/within peak ranges

View source: R/scAPAtrap_funlib.R

findTailsByPeaksR Documentation

Find tail positions around/within peak ranges

Description

Find the precise positions with polyA tails within d nt of peak ranges, given a peaksfile recording peak ranges. This function narrows the search range of tails to peak ranges to speed up tail searching, which is useful for large BAM file.

Usage

findTailsByPeaks(bamfile, peaksfile, d = 200, tailsfile = NULL, ...)

Arguments

bamfile

A BAM file which needs the index file (.bai).

peaksfile

The path of the peaks.saf file generated by generateSAF.

d

Add a 5' and 3' margin of d nt to each peak to search tails. Default is 200.

tailsfile

if not NULL then output to tailsfile, and return the tailsfile name.

...

Arguments passed to other methods and/or advanced arguments. Advanced arguments:

verbose

If 'TRUE' basic status updates will be printed along the way.

logf

If not NULL, then it should be a character string denoting a file name. Then message will be written to 'logf'.

Value

A data frame recording tail positions with chr/strand/coord/count; or tailsfile name (if tailsfile not NULL).

Examples

## Not run: 
findTailsByPeaks(bamfile, peaksfile, d=500)
findTailsByPeaks(bamfile, peaksfile, d=500, tailsfile='output.tails')

## End(Not run)

BMILAB/scAPAtrap documentation built on Oct. 13, 2023, 2:36 a.m.