Stem Inverter

An inverter that would rotate each stem by 180 degrees. (Swapping of the 5’ and 3’ stem sequences without change.)

During solution generation I employ heuristics to explore the solution space, and perform any necessary repairs on the result. An operation like flipping all the pairs is easy to perform manually, but stem inversion is more time consuming and prone to errors.

Inspiration comes from DNA inversion when a segment of DNA is cleaved, rotates, and is repaired in the opposite orientation.

Inversion is an involution, so performing it twice should return the WT. Inversion of a palindromic stem, like stems 1 and 14, doesn’t produce a change. A single pair, like at 4, is just a flip.

For implementation, it may help to scan from base 1 to the end and only trigger inversion when a base is paired to a higher number base (to avoid operating on the same stem twice). Then initiate a scan that looks at both strands, counting up on one and down on the other (to detect bulges, like at 56), and perform the inversion on a separate copy of the sequence when any unpaired base is detected. Then resume the primary scan at a position that is increased by the length of the stem just inverted. And of course set the sequence to the inverted one at the end.

Thanks for reading.

2 Likes

@Ucad, I love your idea.

I have sometimes wished for option for making one type of pairs into another for multiple base pairs at a time. However when I was trying to mutate as many bases as possible base pairs in each R6 puzzles, such a base pair flip option would have been wonderful. Here is an example from R6 subpuzzle W05

Kissing loop R6 fully mutated versus wildtype


Mutation maxing #M90 0.734

1 Like

Good about this , really its an amazing

You could use the Clip and Flip booster to do this one stem at a time. See Cut and paste functionality - #4 by spvincent You need to consider that the marked bases are the first bases in each segment, so if bases 10 to 15 paired with bases 20 to 25, you would actually mark bases 10, 16, 20, and 26 to flip the stem.