scan_genomic_contigs {spiky} | R Documentation

## scan genomic contigs in a BAM/CRAM file

### Description

The default workflow for spiky is roughly as follows:

### Usage

    scan_genomic_contigs(bam, spike, param = NULL, ...)

### Arguments

`bam` | the BAM or CRAM file
`spike` | the spike-in reference database (e.g. data(spike))
`param` | a ScanBamParam object specifying which reads to count (NULL)
`...` | additional arguments to pass to scanBamFlag()

### Details

1. Identify and quantify the spike-in contigs in an experiment.

2. Fit a model for sequence-based abundance artifacts using the spike-ins.

3. Quantify raw fragment abundance on genomic contigs, and adjust per step 2.

scan_genomic_contigs addresses the first half of step 3. The assumption is that anything which isn't a spike contig, is a genomic contig. This isn't necessarily true, so the user can also supply a ScanBamParam object for the `param` argument and restrict scanning to whatever contigs they wish, which also allows for non-default MAPQ, pairing, and quality filters.

### Value

         a CompressedGRangesList with bin- and spike-level coverage

### See Also

        Rsamtools::ScanBamParam

### Examples

    library(Rsamtools)
    data(spike, package="spiky")

    fl <- system.file("extdata", "ex1.bam", package="Rsamtools",
                      mustWork=TRUE)
    scan_genomic_contigs(fl, spike=spike) # will warn user about spike contigs

    sb <- system.file("extdata", "example.spike.bam", package="spiky",
                      mustWork=TRUE)
    scan_genomic_contigs(sb, spike=spike) # will warn user about genomic contigs

[Package spiky version 1.0.0 Index]