get_spike_depth {spiky} | R 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, spike, how = c("max", "mean"))

### Arguments

`covg` | the coverage RleList
`spike_gr` | the spike-in GRanges
`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)

[Package spiky version 1.0.0 Index]