bioinfologics / sdg

Sequence Distance Graph framework: graph + reads + mapping + analysis
MIT License
25 stars 6 forks source link

selected_node parameter in write_to_gfa1 not accepting int vector #113

Closed gonzalogacc closed 5 years ago

gonzalogacc commented 5 years ago

When trying to write a subset of the graph. ns_dg is

In [69]: type(ns_dg)
Out[69]: pysdg.pysdg.DistanceGraph
In [68]: ns_dg.write_to_gfa1('ns_collapsed.gfa', [x.node_id() for x in ns_dg.get_all_nodeviews(include_disconnected=False)])

Produces the following error

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-68-8b8d50e41e43> in <module>
----> 1 ns_dg.write_to_gfa1('ns_collapsed.gfa', [x.node_id() for x in ns_dg.get_all_nodeviews(include_disconnected=False)])

~/git_sources/bsg/build/pysdg/pysdg.py in write_to_gfa1(self, *args)
   1607
   1608     def write_to_gfa1(self, *args):
-> 1609         return _pysdg.DistanceGraph_write_to_gfa1(self, *args)
   1610
   1611     def write_to_gfa2(self, *args):

TypeError: Wrong number or type of arguments for overloaded function 'DistanceGraph_write_to_gfa1'.
  Possible C/C++ prototypes are:
    DistanceGraph::write_to_gfa1(std::string,std::vector< sgNodeID_t,std::allocator< sgNodeID_t > > const &,std::vector< double,std::allocator< double > > const &)
    DistanceGraph::write_to_gfa1(std::string,std::vector< sgNodeID_t,std::allocator< sgNodeID_t > > const &)
    DistanceGraph::write_to_gfa1(std::string)
gonzalogacc commented 5 years ago

Calling the function like this works

ws.sdg.write_to_gfa1('test.gfa', SDG.vectorSGNode([x.node_id() for x in ws.sdg.get_all_nodeviews(include_disconnected=False)]))