get_base_name: refactored out of rename_spikes and rename_spike_seqlevels

View source: R/get_base_name.R

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


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