gamcil / clinker

Gene cluster comparison figure generator
MIT License
507 stars 66 forks source link

Broken pipe error when using clinker to plot gene clusters #109

Closed jonng2024 closed 3 weeks ago

jonng2024 commented 2 months ago

Hi, I have a broken pipe error, when I ran clinker to plot gene clusters.

This is the output I saw:

JonathanNg@ip-172-31-41-112:~/l_plantarum_genomics$ clinker clusters/*.gb -p
[12:43:20] INFO - Starting clinker
[12:43:20] INFO - Parsing files:
[12:43:20] INFO -   Lactiplantibacillus_plantarum_WCFS1_full_edit.gb
[12:43:20] WARNING - NC_004567.2 is circular, checking for genes spanning the origin
[12:43:20] WARNING - To disable this behaviour, use --dont_set_origin
[12:43:20] INFO - No features wrapping the origin
[12:43:20] INFO -   Lactobacillus_plantarum_ZJ316_full_edit.gb
[12:43:20] WARNING - CP004082.1 is circular, checking for genes spanning the origin
[12:43:20] WARNING - To disable this behaviour, use --dont_set_origin
[12:43:20] INFO - No features wrapping the origin
[12:43:20] INFO - Starting cluster alignments
[12:43:20] INFO - Lactiplantibacillus_plantarum_WCFS1_full_edit vs Lactobacillus_plantarum_ZJ316_full_edit
[12:43:44] INFO - Generating results summary...
Lactiplantibacillus_plantarum_WCFS1_full_edit vs Lactobacillus_plantarum_ZJ316_full_edit
----------------------------------------------------------------------------------------
Query           Target      Identity  Similarity
WP_011101299.1  AGE38759.1  0.94      0.97      
WP_011101299.1  AGE39649.1  0.64      0.74      
WP_011101300.1  AGE38760.1  0.86      0.93      
WP_011101300.1  AGE39648.1  0.56      0.69      
WP_011101652.1  AGE38765.1  0.72      0.86      
WP_011101652.1  AGE39643.1  0.99      1.00      
WP_011101653.1  AGE38764.1  0.62      0.75      
WP_011101653.1  AGE39644.1  1.00      1.00      
WP_003640783.1  AGE38763.1  0.60      0.74      
WP_003640783.1  AGE39645.1  0.99      0.99      
WP_011101654.1  AGE38762.1  0.74      0.88      
WP_011101654.1  AGE39646.1  1.00      1.00      
WP_003640785.1  AGE38761.1  0.74      0.83      
WP_003640785.1  AGE39647.1  1.00      1.00      
WP_063204247.1  AGE38760.1  0.59      0.71      
WP_063204247.1  AGE39648.1  0.98      0.98      
WP_011101656.1  AGE38759.1  0.65      0.78      
WP_011101656.1  AGE39649.1  0.95      0.95      
[12:43:44] INFO - Building clustermap.js visualisation
TTY detected. Printing informational message about logging configuration. Logging configuration loaded from '/etc/rstudio/logging.conf'. Logging to '/home/JohnathanNg/.local/share/rstudio/log/rpostback.log'.
[12:43:44] INFO - Serving clinker plot at http://127.0.0.1:48785/ (Ctrl+C to stop).
----------------------------------------
Exception occurred during processing of request from ('127.0.0.1', 50696)
Traceback (most recent call last):
  File "/home/JohnathanNg/anaconda3/lib/python3.11/socketserver.py", line 317, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/home/JohnathanNg/anaconda3/lib/python3.11/socketserver.py", line 348, in process_request
    self.finish_request(request, client_address)
  File "/home/JohnathanNg/anaconda3/lib/python3.11/socketserver.py", line 361, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/home/JohnathanNg/anaconda3/lib/python3.11/site-packages/clinker/plot.py", line 21, in __init__
    super().__init__(*args, **kwargs)
  File "/home/JohnathanNg/anaconda3/lib/python3.11/socketserver.py", line 755, in __init__
    self.handle()
  File "/home/JohnathanNg/anaconda3/lib/python3.11/http/server.py", line 436, in handle
    self.handle_one_request()
  File "/home/JohnathanNg/anaconda3/lib/python3.11/http/server.py", line 424, in handle_one_request
    method()
  File "/home/JohnathanNg/anaconda3/lib/python3.11/site-packages/clinker/plot.py", line 56, in do_GET
    self.copy_file(fp)
  File "/home/JohnathanNg/anaconda3/lib/python3.11/site-packages/clinker/plot.py", line 24, in copy_file
    shutil.copyfileobj(source, self.wfile)
  File "/home/JohnathanNg/anaconda3/lib/python3.11/shutil.py", line 200, in copyfileobj
    fdst_write(buf)
  File "/home/JohnathanNg/anaconda3/lib/python3.11/socketserver.py", line 834, in write
    self._sock.sendall(b)
BrokenPipeError: [Errno 32] Broken pipe
----------------------------------------
^C[13:02:43] INFO - Done!

I installed clinker using pip install clinker. Would someone help me to solve this please?

gamcil commented 1 month ago

It seems like you pressed Ctrl+C which ends the process and causes this message. When you don't specify a file name with the -p argument, the plot is served dynamically (and automatically opens in the webbrowser) until you manually end the process. Did clinker generate the plot successfully?

If you would like to just generate an HTML file, provide a file name e.g. -p output.html.

jonng2024 commented 1 month ago

Thanks so much for your reply =), can't remember if I pressed Ctrl+C now. But thanks for your suggestion on how to generate the html file. I was using clinker in my HPC, so i'm not sure if it allows a webbrowser to open automatically. Generating the html file like what you said, could work.