tidysq icon indicating copy to clipboard operation
tidysq copied to clipboard

I would like to add x numer of N between concatenated sequences with collapse

Open ericgonzalezs opened this issue 1 year ago • 2 comments

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.

ericgonzalezs avatar Jul 05 '23 00:07 ericgonzalezs

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.

ErdaradunGaztea avatar Jul 05 '23 07:07 ErdaradunGaztea

It worked, many thanks!

ericgonzalezs avatar Jul 05 '23 21:07 ericgonzalezs