Replace a region between two positions in sequences

seq_replace_position(x, position_in, position_out, replacement)

Arguments

x

a DNA, RNA or AA vector.

position_in

an integer giving the position where to start to replace.

position_out

an integer giving the position where to stop to replace.

replacement

a vector of replacements.

Value

A vector of same class as x.

See also

Examples


x <- dna("ACGTTAGTGTAGCCGT", "CTCGAAATGA")
seq_replace_position(x, c(5, 2), 6, "-------")
#> DNA vector of 2 sequences
#> >   ACGT-------GTGTAGCCGT
#> >   C-------ATGA