get_base_name {spiky} | R Documentation

## refactored out of rename_spikes and rename_spike_seqlevels

### Description

A common task between generate_spike_fasta, rename_spikes, and rename_spike_seqlevels is to determine what the largest common subset of characters between existing contig names and stored standardized contigs might be. This function eases that task.

### Usage

    get_base_name(contig_names, sep = "_")

### Arguments

`contig_names` | the names of contigs
`sep` | separator character in contig names ("_")

### Value

                   a vector of elements 1:3 from each contig name

### Examples

    sb <- system.file("extdata", "example.spike.bam", package="spiky",
                      mustWork=TRUE)
    bh <- scanBamHeader(BamFile(sb))
    orig_contigs <- names(bh$targets)
    get_base_name(orig_contigs)

[Package spiky version 1.0.0 Index]