get_spike_depth {spiky} | R Documentation |
get the (max, median, or mean) coverage for spike-in contigs from a BAM/CRAM
get_spike_depth(covg, spike_gr, spike, how = c("max", "mean"))
covg |
the coverage RleList |
spike_gr |
the spike-in GRanges |
spike |
information about the spikes (default: load |
how |
how to summarize the per-spike coverage (max) |
a GRanges with summarized coverage and features for each
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)