get_merged_gr {spiky} | R Documentation

## get a GRanges of (by default, standard) chromosomes from seqinfo

### Description

refactored from scan_spiked_bam to clarify information flow

### Usage

    get_merged_gr(si, spike, standard = TRUE)

### Arguments

`si` | seqinfo, usually from a BAM/CRAM file with spike contigs
`spike` | database of spike-in standard sequence features (spike)
`standard` | trim to standard chromosomes? (TRUE)

### Details

By default, get_merged_gr will return a GRanges with "standardized" genomic and spike contig names (i.e. genomic chr1-22, X, Y, M, and the canonical spike names in data(spike, package="spiky")).

The constraint to "standard" chromosomes on genomic contigs can be removed by setting `standard` to FALSE in the function arguments.

### Value

         GRanges with two genomes: the organism assembly and "spike"

### Examples

    sb <- system.file("extdata", "example.spike.bam", package="spiky",
                      mustWork=TRUE)
    si <- seqinfo_from_header(sb)
    genome(si) <- "spike" # no genomic contigs
    data(spike, package="spiky")
    get_merged_gr(si, spike=spike) # note canonicalized spikes

[Package spiky version 1.0.0 Index]