find_spike_contigs: find spike-in seqlevels in an object 'x', where...

View source: R/find_spike_contigs.R

find_spike_contigsR 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)


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