bacpop / PopPUNK

PopPUNK 👨‍🎤 (POPulation Partitioning Using Nucleotide Kmers)
https://www.bacpop.org/poppunk
Apache License 2.0
88 stars 18 forks source link

Cytoscape visualization not being generated #184

Closed andreaniml closed 2 years ago

andreaniml commented 2 years ago

Versions poppunk 2.4.0 poppunk_sketch 1.7.3

Command used and output returned Taking the listeria example dataset mentioned on Quickstart in 2.2.0 docs (https://poppunk.readthedocs.io/en/v2.2.0-docs/quickstart.html): poppunk --create-db --r-files reference_list.txt --output lm_example poppunk --fit-model bgmm --ref-db lm_example --output modelK4 --K 4 poppunk_visualise --ref-db lm_example --model-dir modelK4 --output Try01 --cytoscape

Describe the bug

Hello! Here's the cytoscape bug I mentioned in the other issue

I can't generate a cytoscape output, whenever I try with --cytoscape flag I get:

Graph-tools OpenMP parallelisation enabled: with 1 threads PopPUNK: visualise Loading BGMM 2D Gaussian model Completed model loading Building phylogeny Writing cytoscape output Traceback (most recent call last): File "/home/malu/miniconda3/envs/poppunk/bin/poppunk_visualise", line 11, in sys.exit(main()) File "/home/malu/miniconda3/envs/poppunk/lib/python3.9/site-packages/PopPUNK/visualise.py", line 452, in main generate_visualisations(args.query_db, File "/home/malu/miniconda3/envs/poppunk/lib/python3.9/site-packages/PopPUNK/visualise.py", line 440, in generate_visualisations genomeNetwork = load_network_file(network_file, use_gpu = gpu_graph) File "/home/malu/miniconda3/envs/poppunk/lib/python3.9/site-packages/PopPUNK/network.py", line 146, in load_network_file genomeNetwork = gt.load_graph(fn) File "/home/malu/miniconda3/envs/poppunk/lib/python3.9/site-packages/graph_tool/init.py", line 3381, in load_graph g.load(file_name, fmt, ignore_vp, ignore_ep, ignore_gp) File "/home/malu/miniconda3/envs/poppunk/lib/python3.9/site-packages/graph_tool/init.py", line 2927, in load props = self.__graph.read_from_file("", file_name, fmt, OSError: error reading from file '':basic_ios::clear: iostream error

A folder is created, however it is empty I was able create a microreact output, it seems to be a cystoscape-only probem

Maybe useful information: I'm using poppunk in WSL

nickjcroucher commented 2 years ago

Hi @andreaniml - does the version you are using have a --network-file option? That has been added in recent versions to enable different types of file to be visualised with cytoscape. If you use this to specify the path to the graph file (e.g. --network-file modelK4/modelK4_graph.gt) that should hopefully generate the output you want.

andreaniml commented 2 years ago

It worked! Thank you!

Just to check, here the names of the nodes are imported as "n0, n1, n2" instead of the sample names (those on "id") image This is normal behavior, right? (I'm sorry for the silly question, I never used cytoscape)

nickjcroucher commented 2 years ago

Yes, this is the expected format for outputs to Cytoscape - we'll update the tutorial accordingly.

johnlees commented 2 years ago

Closing as this will be addressed in #185