mikolmogorov / Ragout

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

NetworkX 2.3 not supported #51

Open ipetrushin opened 5 years ago

ipetrushin commented 5 years ago

Dear support!

Since NetworkX 2.3 requires Python 3.5+ (https://networkx.github.io/documentation/stable/install.html) && Ragout uses Python 2.7 it's impossible to run Ragout (or install via conda) with NetworkX 2.3 installed. I have to downgrade first, then Ragout runs OK.

mikolmogorov commented 5 years ago

Thanks for letting me know - I will specify networkx version 2.2 as a requirement for now. Will need to transition to Python3 at some point..

ipetrushin commented 5 years ago

I see Ragout depends only on Flye assembler which made for 2.7 version. Does other parts of code run on Python 3.5+ ?

mikolmogorov commented 5 years ago

No, Ragout is independent from Flye. Ragout is currently supports only Python 2.7.

pmoulos commented 4 years ago

Hi @fenderglass, thanks for this wonderful package!

I think you might have to revisit this issue as I faced problems with networkx 2.2.

Traceback (most recent call last):
  File "/opt/ngstools/ragout/ragout", line 32, in <module>
    sys.exit(main())
  File "/opt/ngstools/archive/ragout-2.3/ragout/main.py", line 295, in main
    _run_ragout(args)
  File "/opt/ngstools/archive/ragout-2.3/ragout/main.py", line 200, in _run_ragout
    chim_detect = ChimeraDetector(raw_bp_graphs, run_stages, target_sequences)
  File "/opt/ngstools/archive/ragout-2.3/ragout/breakpoint_graph/chimera_detector.py", line 28, in __init__
    self._make_hierarchical_breaks()
  File "/opt/ngstools/archive/ragout-2.3/ragout/breakpoint_graph/chimera_detector.py", line 39, in _make_hierarchical_breaks
    breaks = self._get_contig_breaks(self.bp_graphs[stage])
  File "/opt/ngstools/archive/ragout-2.3/ragout/breakpoint_graph/chimera_detector.py", line 94, in _get_contig_breaks
    subgraphs = bp_graph.connected_components()
  File "/opt/ngstools/archive/ragout-2.3/ragout/breakpoint_graph/breakpoint_graph.py", line 80, in connected_components
    subgraphs = nx.connected_component_subgraphs(self.bp_graph)
AttributeError: module 'networkx' has no attribute 'connected_component_subgraphs'

I fixed this locally using this suggestion and by digging through your code. I made a PR with the solution that works for me. Maybe it's not the best coding practice but it works, given that I am not a Python guy. :)

marcovth commented 2 years ago

This worked fine for me ... `conda create -y -n py27 python=2.7

conda activate py27

conda install -c bioconda ragout

ragout -h

conda deactivate `

aguilar-gomez commented 1 year ago

is this still only for Python2? I got an error with network too:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. pong 1.5 requires networkx~=2.5, but you have networkx 2.2 which is incompatible.

I am using Python 3

mikolmogorov commented 1 year ago

@aguilar-gomez there is likely a conflict between the packages in your environment, the easiest thing would be to install ragout in a separate bioconda environment: conda create -n ragout ragout