bam.cov.skel: Get coverage as GRanges from BAM using exons as tiles

View source: R/fragCounter.R

bam.cov.skelR Documentation

Get coverage as GRanges from BAM using exons as tiles

Description

Quick way to get tiled coverage via piping to samtools (e.g. ~10 CPU-hours for 100bp tiles, 5e8 read pairs)

Gets coverage for user-defined regions of the genome, pulling "chunksize" records at a time and incrementing bin

Usage

bam.cov.skel(
  bam.file,
  skeleton,
  chunksize = 1e+05,
  min.mapq = 1,
  verbose = TRUE,
  reference = NULL,
  max.tlen = 10000,
  st.flag = "-f 0x02 -F 0x10",
  fragments = TRUE,
  do.gc = FALSE,
  use.skel = FALSE
)

Arguments

bam.file

string Input BAM file

skeleton

string Input data.table with intervals for which there is coverage data

chunksize

integer Size of window (default = 1e5)

min.mapq

integer Minimim map quality reads to consider for counts (default = 30)

verbose

boolean Flag to increase vebosity (default = TRUE)

max.tlen

integer Maximum paired-read insert size to consider (default = 1e4)

st.flag

string Samtools flag to filter reads on (default = '-f 0x02 -F 0x10')

fragments

boolean flag (default = FALSE) detremining whether to compute fragment (i.e. proper pair footprint aka insert) density or read density

do.gc

boolean Flag to execute garbage collection via 'gc()' (default = FALSE)

use.skel

boolean flag If false then default exome skeleton from gencode is used, if TRUE, user defined skeleton is used

Value

GRanges of user defined tiles across seqlengths of bam.file with meta data field $counts specifying fragment counts centered (default = TRUE) in the given bin.

Author(s)

Trent Walradt


mskilab/fragCounter documentation built on Jan. 27, 2024, 2:35 p.m.