get_spike_depth: get the (max, median, or mean) coverage for spike-in contigs...

View source: R/get_spike_depth.R

get_spike_depthR Documentation

get the (max, median, or mean) coverage for spike-in contigs from a BAM/CRAM

Description

get the (max, median, or mean) coverage for spike-in contigs from a BAM/CRAM

Usage

get_spike_depth(covg, spike_gr = NULL, spike = NULL, how = c("max", "mean"))

Arguments

covg

the coverage RleList

spike_gr

the spike-in GRanges (default: figure out from seqinfo)

spike

information about the spikes (default: load spike)

how

how to summarize the per-spike coverage (max)

Value

     a GRanges with summarized coverage and features for each

Examples

sb <- system.file("extdata", "example.spike.bam", package="spiky",
                  mustWork=TRUE)
data(spike, package="spiky")
si <- seqinfo_from_header(sb)
genome(si) <- "spike"
mgr <- get_merged_gr(si,spike=spike)

fl <- scanBamFlag(isDuplicate=FALSE, isPaired=TRUE, isProperPair=TRUE)
bp <- ScanBamParam(flag=fl)
bamMapqFilter(bp) <- 20

covg <- get_spiked_coverage(sb, bp=bp, gr=mgr)
get_spike_depth(covg, spike_gr=mgr, spike=spike)


trichelab/spiky documentation built on Sept. 17, 2022, 8:44 a.m.