ViennaRNA / forgi

An RNA manipulation library.
GNU General Public License v3.0
51 stars 30 forks source link

RuntimeWarning: invalid value encountered in true_divide #39

Open afandiadib opened 3 years ago

afandiadib commented 3 years ago

Hi,

I just installed forgi via pip and I got this error when I want to visualize RNA structure. It happened on some of my RNA structures.

/mnt/Data/Programs/conda/lib/python3.8/site-packages/forgi/visual/mplotlib.py:118: RuntimeWarning: invalid value encountered in true_divide norm_vec/=ftuv.magnitude(norm_vec)

Code to reproduce:

import forgi.graph.bulge_graph as fgb
import forgi.visual.mplotlib as fvm

bg = fgb.BulgeGraph.from_dotbracket('......((((((((((((((((......))))))))))))))))((((.(((((....).))))))))(((((((....))))))).....................')
fvm.plot_rna(bg)
mwittep commented 2 years ago

Similar error here. I have tried 3 python versions (3.6, 3.8 and 3.9). For the following sequences I get the same error as above:

bg = fgb.BulgeGraph.from_dotbracket("((...)).(..(..))")
bg = fgb.BulgeGraph.from_dotbracket("((...)).(.(..))")

But the following one does work:

bg = fgb.BulgeGraph.from_dotbracket("((...)).((..))")