# How to plot a 2D RNA structure in python using dot-bracket input?

I need some help with forgi library for visualisation of RNA secondary structure.

I have an RNA sequence and dot-bracket notation of the secondary structure and I would like to plot 2D graph like that you can find here.

The input file is a .fx file, or a fasta file where the sequence is single-line and the third line is the dot-bracket notation of the RNA structure.

>1y26
CGCUUCAUAUAAUCCUAAUGAUAUGGUUUGGGAGUUUCUACCAAGAGCCUUAAACUCUUGAUUAUGAAGUG
((((((((((..(((((((.......)))))))......).((((((.......))))))..)))))))))


If there any other possibilities to plot it in real-time (for instance, in jupyter notebook avoiding any crossing external scripts), I will be very thankful to learn them!

• Hi there, do I understand right that you got an RNA sequence and you with to predict the secondary structure and plot it within a jupyter notebook? Could you maybe edit your question to clarify what is exactly your input and desired output? – Kamil S Jaron Dec 11 '18 at 14:13
• cross posted : biostars.org/p/353919 – Pierre Dec 11 '18 at 17:54
• @KamilSJaron, hi! I have an RNA sequence with it dot-bracket notation, for instance: seq = 'AAAACCGGGCCUUUUACCCCAAAUUGGAA' dot_bracket = '((((..(((..)))..))))...((..))' And for this seq and dot_bracket I want to plot 2D graph where edges will be biult according to dot_bracket and top will show the necessary nucleotide – kitsune_breeze Dec 12 '18 at 8:28
• @kitsune_breeze Ah, I got it. Just note that you can edit your question to improve and I would strongly encourage you to do that if you find new clues or to add more details. For instance, what was the problem with forgi library? Could you share what you tried and what was the error you got? – Kamil S Jaron Dec 12 '18 at 12:24
• Awesome, that's something we can work at. Just edit your question and add this information. Something like, "I know how to create the plot in terminal by running .... However, I don't know how to call the command from jupyter notebook". I am trying to convince you here, that you should not write more information in comments but directly to question. ;-) – Kamil S Jaron Dec 12 '18 at 15:04