ssvFetchBamPE.RNA: ssvFetchBamPE

View source: R/functions_fetchBamPE.R

ssvFetchBamPE.RNAR Documentation

ssvFetchBamPE

Description

wrapper to handle pileup of standard RNA-seq FR paired end data

Usage

ssvFetchBamPE.RNA(
  file_paths,
  qgr,
  win_size = 50,
  target_strand = "both",
  splice_strategy = "ignore",
  return_data.table = FALSE,
  win_method = "sample",
  max_dupes = Inf,
  flip_strand = FALSE,
  sum_reads = TRUE,
  n_cores = getOption("mc.cores", 1),
  force_skip_centerFix = TRUE,
  n_region_splits = 1
)

Arguments

file_paths

character vector of file_paths to load from. Alternatively, file_paths can be a data.frame or data.table whose first column is a character vector of paths and additial columns will be used as metadata.

qgr

Set of GRanges to query. For valid results the width of each interval should be identical and evenly divisible by win_size.

win_size

The window size that evenly divides widths in qgr.

target_strand

character. if one of "+" or "-", reads are filtered to match. ignored if any other value.

splice_strategy

character, one of c("none", "ignore", "add", "only", "splice_count"). Default is "none" and spliced alignment are asssumed not present. fragLen must be NA for any other value to be valid. "ignore" will not count spliced regions. add" counts spliced regions along with others, "only" will only count spliced regions and ignore others.

return_data.table

logical. If TRUE the internal data.table is returned instead of GRanges. Default is FALSE.

n_region_splits

integer number of splits to apply to qgr. The query GRanges will be split into this many roughly equal parts for increased parallelization. Default is 1, no split.

Value

a GRanges (or data.table if return_data.table == TRUE)

Examples

if(Sys.info()['sysname'] != "Windows"){
library(GenomicRanges)
bam_f = system.file("extdata/testPE.bam",
    package = "seqsetvis", mustWork = TRUE)
bam_files = c("a" = bam_f, "b" = bam_f)
qgr = CTCF_in_10a_overlaps_gr[1:5]
bw_gr = ssvFetchBamPE(bam_files, qgr, win_size = 10)
bw_gr
}

jrboyd/ssvRecipes documentation built on May 22, 2022, 7:07 a.m.