flankingSequence: Get flanking sequences of a position.

Description Usage Arguments Examples

View source: R/Rmimp.R

Description

This function obtains the flanking sequence at one or more position. Out of bound indices are replaced by a blank character.

Usage

1
flankingSequence(seqs, inds, flank = 7, empty_char = "-")

Arguments

seqs

Character vector of sequences. If only one sequence is provided, indices from inds are assumed to all be from the same sequence.

inds

Numerical vector of positions corresponding to the sequences provided in seqs.

flank

Value indicating the number of characters to extract, before and after an index

empty_char

Character used to replace out of bound flanking sequences

Examples

1
2
3
4
5
6
# One sequence and one index. Central character is 'B'
flankingSequence(seqs='ABC', inds=2, flank=1)
# An example showing the use of empty.char 
flankingSequence(seqs='ABC', inds=2, flank=5)
# An example with multiple sequences and indices
flankingSequence(seqs=c('ABC', 'XYZ'), inds=c(2, 1), flank=1)

omarwagih/rmimp documentation built on May 18, 2020, 3:11 p.m.