mikolmogorov / Ragout

Chromosome-level scaffolding using multiple references
Other
148 stars 27 forks source link

AttributeError: 'MultiGraph' object has no attribute 'edges_iter' #35

Closed tillea closed 5 years ago

tillea commented 5 years ago

Hi, I'm intending to package Ragout for Debian. When I try to test the result I get:

$ ragout examples/E.Coli/ecoli.rcp --outdir examples/E.Coli/out/ --refine
[14:37:25] INFO: Starting Ragout v2.1.1
[14:37:25] INFO: Running withs synteny block sizes '[5000, 500, 100]'
[14:37:25] INFO: Running Sibelia with block size 5000
[14:38:05] INFO: Running Sibelia with block size 500
[14:38:45] INFO: Running Sibelia with block size 100
[14:39:26] INFO: Inferring phylogeny from synteny blocks data
[14:39:26] INFO: Reading examples/E.Coli/out/sibelia-workdir/100/blocks_coords.txt
[14:39:26] INFO: "mg1655" synteny blocks coverage: 99.57%
[14:39:26] INFO: "dh1" synteny blocks coverage: 99.86%
[14:39:26] INFO: Inferred tree: ('mg1655' : 1.5, 'dh1' : 1.5)
[14:39:26] INFO: 'dh1' is chosen as a naming reference
[14:39:26] INFO: Processing permutation files
[14:39:26] INFO: Reading examples/E.Coli/out/sibelia-workdir/5000/blocks_coords.txt
[14:39:26] INFO: "mg1655" synteny blocks coverage: 99.45%
[14:39:26] INFO: "dh1" synteny blocks coverage: 96.42%
[14:39:26] INFO: Reading examples/E.Coli/out/sibelia-workdir/500/blocks_coords.txt
[14:39:26] INFO: "mg1655" synteny blocks coverage: 99.66%
[14:39:26] INFO: "dh1" synteny blocks coverage: 99.58%
[14:39:26] INFO: Reading examples/E.Coli/out/sibelia-workdir/100/blocks_coords.txt
[14:39:26] INFO: "mg1655" synteny blocks coverage: 99.57%
[14:39:26] INFO: "dh1" synteny blocks coverage: 99.86%
[14:39:26] INFO: Reading examples/E.Coli/out/sibelia-workdir/100/blocks_coords.txt
[14:39:26] INFO: "mg1655" synteny blocks coverage: 99.57%
[14:39:26] INFO: "dh1" synteny blocks coverage: 99.86%
[14:39:26] INFO: Reading contigs file
[14:39:27] INFO: Detecting chimeric adjacencies
Traceback (most recent call last):
  File "/usr/bin/ragout", line 35, in <module>
    sys.exit(main())
  File "/usr/lib/python2.7/dist-packages/ragout/main.py", line 290, in main
    _run_ragout(args)
  File "/usr/lib/python2.7/dist-packages/ragout/main.py", line 198, in _run_ragout
    chim_detect = ChimeraDetector(raw_bp_graphs, run_stages, target_sequences)
  File "/usr/lib/python2.7/dist-packages/ragout/breakpoint_graph/chimera_detector.py", line 26, in __init__
    self._make_hierarchical_breaks()
  File "/usr/lib/python2.7/dist-packages/ragout/breakpoint_graph/chimera_detector.py", line 37, in _make_hierarchical_breaks
    breaks = self._get_contig_breaks(self.bp_graphs[stage])
  File "/usr/lib/python2.7/dist-packages/ragout/breakpoint_graph/chimera_detector.py", line 101, in _get_contig_breaks
    for (u, v, data) in subgr.bp_graph.edges_iter(data=True):
AttributeError: 'MultiGraph' object has no attribute 'edges_iter'

Any idea how to fix this? Kind regards, Andreas.

mikolmogorov commented 5 years ago

Hi,

Ragout was developed with networkx 1.8, and it seems that the more recent versions break backward compatibility. Is there a way to specify an older version of package dependency in Debian?

tillea commented 5 years ago

Hi, sorry, no. For new packages we have to use the libraries available in Debian unstable (currently 2.2). I think it is a good idea to port your code to recent libraries anyway (not only for the sake of packaging in Debian).

mikolmogorov commented 5 years ago

Makes sense - will try to work on this in the near future (can't promise that this will be a priority though).

mikolmogorov commented 5 years ago

The most recent 2.2 version is now using networkx 2.2 (thanks to @latticetower). I think it should work for you now - but let me know if there are any other issues.