scan_spike_contigs: pretty much what it says: scan spike contigs from a BAM or...

View source: R/scan_spike_contigs.R

scan_spike_contigsR Documentation

pretty much what it says: scan spike contigs from a BAM or CRAM file

Description

default workflow is

Usage

scan_spike_contigs(bam, spike, how = "max", param = NULL, mc.cores = 16, ...)

Arguments

bam

the BAM or CRAM filename, or a vector of such filenames

spike

the spike-in reference database (e.g. data(spike))

how

how to summarize the per-spike coverage (max)

param

a ScanBamParam object, or NULL (will default to MAPQ=20 etc)

mc.cores

Number of cores to run on (default 16)

...

additional arguments to pass to scanBamFlag()

Details

  1. scan spike contigs and count fragments per contig or per bin.

  2. fit the appropriate model for adjusting genomic contigs based on spikes.

  3. scan and adjust binned fragment tallies along genomic contigs per above.

scan_spike_contigs implements step 1.

If multiple BAM or CRAM filenames are provided, all indices will be checked before attempting to run through any of the files.

Value

     a CompressedGRangesList with bin- and spike-level coverage

See Also

    Rsamtools::ScanBamParam

Examples

library(GenomicRanges)
data(spike, package="spiky")
sb <- system.file("extdata", "example.spike.bam", package="spiky",
                  mustWork=TRUE) # switch to a CRAM
res <- scan_spike_contigs(sb, spike=spike) # use default ScanBamParam
summary(res)


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