ssvFetchBam.single: fetch a windowed version of a bam file, returns GRanges

Description Usage Arguments Value

View source: R/functions_fetch_bam.R

Description

fetch a windowed version of a bam file, returns GRanges

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
ssvFetchBam.single(
  bam_f,
  qgr,
  win_size = 50,
  win_method = c("sample", "summary")[1],
  summary_FUN = stats::weighted.mean,
  fragLen = NULL,
  target_strand = c("*", "+", "-", "both")[1],
  anchor = c("left", "left_unstranded", "center", "center_unstranded")[3],
  return_data.table = FALSE,
  max_dupes = Inf,
  splice_strategy = c("none", "ignore", "add", "only", "splice_count")[1],
  flip_strand = FALSE,
  return_unprocessed = FALSE,
  force_skip_centerFix = FALSE,
  ...
)

Arguments

bam_f

character or BamFile to load

qgr

GRanges regions to fetchs

win_size

numeric >=1. pileup grabbed every win_size bp for win_method sample. If win_method is summary, this is the number of windows used (confusing, sorry).

win_method

character. one of c("sample", "summary"). Determines if viewGRangesWinSample_dt or viewGRangesWinSummary_dt is used to represent each region in qgr.

summary_FUN

function. only relevant if win_method is "summary". passed to viewGRangesWinSummary_dt.

fragLen

numeric, NULL, or NA. if numeric, supplied value is used. if NULL, value is calculated with fragLen_calcStranded if NA, raw bam pileup with no cross strand shift is returned.

target_strand

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

anchor

character, one of c("center", "center_unstranded", "left", "left_unstranded")

return_data.table

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

max_dupes

numeric >= 1. duplicate reads by strandd start position over this number are removed, Default is Inf.

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.

flip_strand

if TRUE, strand alignment is flipped prior to fragLen extension. Default is FALSE.

return_unprocessed

boolean. if TRUE returns read alignment in data.table. Default is FALSE.

force_skip_centerFix

boolean, if TRUE all query ranges will be used "as is". This is already the case by default if win_method == "summary" but may have applications where win_method == "sample".

...

passed to Rsamtools::ScanBamParam()

Value

tidy GRanges (or data.table if specified) with pileups from bam file. pileup is calculated only every win_size bp.


seqsetvis documentation built on Nov. 8, 2020, 5:57 p.m.