ViennaRNA / forgi

An RNA manipulation library.
GNU General Public License v3.0
52 stars 31 forks source link

Cannot visualize RNA co-folded structures #44

Open itamarwe opened 2 years ago

itamarwe commented 2 years ago

I'm trying to visualize a co-folded structure, for example: ..(((...((((((..&.)))))).((((....))))))) When trying to visualize the structure, I'm getting the following error:

# Plot structure from dotbracket notation
fvm.plot_rna(forgi.graph.bulge_graph.BulgeGraph.from_dotbracket('..(((...((((((..&.)))))).((((....)))))))'))
plt.show()

The error:

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
Input In [38], in <cell line: 2>()
      1 # Plot structure from dotbracket notation
----> 2 fvm.plot_rna(forgi.graph.bulge_graph.BulgeGraph.from_dotbracket('..(((...((((((..&.)))))).((((....)))))))'))
      3 plt.show()

File ~/miniconda3/lib/python3.9/site-packages/forgi/visual/mplotlib.py:300, in plot_rna(cg, ax, offset, text_kwargs, backbone_kwargs, basepair_kwargs, color, lighten, annotations)
    298 for i, coord in enumerate(coords):
    299     if color:
--> 300         c = el_to_color[el_string[i]]
    301         h,l,s = colorsys.rgb_to_hls(*mc.to_rgb(c))
    302         if lighten>0:

IndexError: string index out of range