Skip to content

Cannot visualize RNA co-folded structures #44

Description

@itamarwe

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions