This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How To Create Dot-Bracket Annotation For Rna With Pseudoknots

Dear all,

I am trying to figure out a way of creating a Dot-Bracket structure for an RNA with arbitrary pseudoknots. The input data is a list of base pairs like this one:

5 17
6 16
7 15
10 20
11 19

The output should look like this:

....(((..[[...))).]]
AUGUACCGUCCUUUUGGAGG

Since there is no restriction on the pseudoknots there could also be a base pair 12 30 which would need a different set of brackets, e.g. { }.

Does anyone know an effective way of doing this? Any help would be appreciated!

Regards Nick

rna secondary

Closing as "no longer relevant", since you quickly answered your own question.

1 answer

Ok, I just solved it :-)

I create a stack for each kind of brackets I use and for each new base pair I check if it crosses any of the base pairs on one stack. If it doesn't I put it on this stack and use the corresponding brackets, if not I move on to the next stack.

I don't know if it's the most efficient way but it's sufficient.

Log in to answer this question.