find_spike_contigs {spiky} | R Documentation

## find spike-in seqlevels in an object `x`, where !is.null(seqinfo(x))

### Description

Find the spike-like contigs in a BAM with both natural and spiked contigs. This started out as glue in some other functions and got refactored out.

### Usage

    find_spike_contigs(x, spike)

### Arguments

`x` | something with seqlevels
`spike` | a DataFrame with spike-in information

### Details

The indices have an attribute "mappings", which is a character vector such that attr(find_spike_contigs(x), "mappings") == standardized for all contig names in the CRAM/BAM/whatever, and standardized is the rowname in `spike` that corresponds to the original contig name.

### Value

       indices of which contigs in seqlevels(x) are spike-in contigs

### See Also

get_base_name

rename_spike_seqlevels

### Examples

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

[Package spiky version 1.0.0 Index]