tidysq
tidysq copied to clipboard
I would like to add x numer of N between concatenated sequences with collapse
I would like to concatenate sequences and add a determined number of N between sequences
Let's say I have these sequences
seq1 AACC seq2 CCAA seq3 CCCT
How I could concatenate them and add 2 Ns between them have this
seqNew AACCNNCCAANNCCCT
Or how to add any required amount of Ns between them?
Many thanks.
For concatenation, there's a tidysq::collapse()
function, which would take a single sq
object with these three sequences. However, there's no "separator" parameter in here, so first you'd have to add NNs manually. I guess tidysq::paste()
might handle that if executed before collapse()
, if you pass an sq
object with n-1 NN
entries and an empty one at the end (tidysq::sq(c(rep("NN", length(your_sequences) - 1), ""), "rna_ext")
basically).
Of course, you can replace "NN"
with any other expression.
It worked, many thanks!