ggonnella/gfapy

unhashable type: 'SegmentEnd' with `is_cut_segment`

mir-cat opened this issue · 0 comments

Hello,

I am encountering an error when attempting to use the functions graph.is_cut_segment and graph.remove_dead_ends where it appears that the function attempts to interate over a SegmentEnd and fails:

EG

In [41]: graph.remove_dead_ends(1000000)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-41-da5e655a6017> in <module>()
----> 1 graph.remove_dead_ends(1000000)

/Users/henglinm/opt/miniconda3/envs/tester/lib/python3.6/site-packages/gfapy/graph_operations/artifacts.py in remove_dead_ends(self, minlen)
     34       if s.length < minlen and \
     35         (c[0]==0 or c[1]==0) and \
---> 36           not self.is_cut_segment(s):
     37         self.rm(s)

/Users/henglinm/opt/miniconda3/envs/tester/lib/python3.6/site-packages/gfapy/graph_operations/topology.py in is_cut_segment(self, segment)
     52       for l in segment.dovetails_of_end(et):
     53         start_points.add(l.other_end(\
---> 54             gfapy.SegmentEnd(segment.name, et)).inverted())
     55     cc = []
     56     for start_point in start_points:

TypeError: unhashable type: 'SegmentEnd'

This was performed a version 1 GFA file immediately after import. Is this only for GFA 2 files?