Truncate input sequence after input position before next stop codons (*).

seq_truncate_nonstop(seq, pos)

Arguments

seq

Sequence

pos

position relative to sequence

Value

a character

This can be used to remove peptide sequence parts in a context sequence (in a fixed-sized window around a position of interest) after a stop codon * occurs.

Examples


seq_truncate_nonstop("1234*6789", 2) # "1234"
#> [1] "1234"
seq_truncate_nonstop("1234*6789", 8) # "1234*6789"
#> [1] "1234*6789"

seq <- "QIP*LGSNSLLFPYQLMAGSTRP*SWALGC"
seq_truncate_nonstop(seq, 14) #"QIP*LGSNSLLFPYQLMAGSTRP"
#> [1] "QIP*LGSNSLLFPYQLMAGSTRP"