Clinical-Genomics-Lund / bonsai

Visualize and analyze resistance and outbreak of bacterial pathogen
https://bonsai-wgs.readthedocs.io/en/latest/
GNU General Public License v3.0
4 stars 1 forks source link

Release v0.1.0 #109

Closed mhkc closed 10 months ago

mhkc commented 10 months ago

This PR is the first beta release of Bonsai. This release is compatible with JASEN v0.3.0.

Tests

alkc commented 10 months ago

Confirmed that cgMLST clustering works. One issue though: sample metadata does not reach grapetree:

bild

alkc commented 10 months ago

Confirmed that admin user can create/edit groups

alkc commented 10 months ago

Confirmed that comments can be added/removed from sample

alkc commented 10 months ago

minhash clustering works with no sample metadata loss when loading into grapetree

alkc commented 10 months ago

mlst clustering works when clustering all 15 samples, but seems to suffer from the same sample metadata loss as cgMLST clustering.

also the clustering fails when trying to cluster lower nbr of samples:

for example sending the following samples to mlst clustering:

19NG0500446_S9
19NG0500446_S2
19NG0500481_S1
19NG0500540
19NG0500538_S4
19NG0500586
19NG0500634
19NG0500471_S3
19NG0500546
19NG0500538_S12

leads to the following error in the api logs, with its source in the allele_cluster_service

INFO:     172.18.0.1:36132 - "POST /cluster/mlst/ HTTP/1.1" 201 Created                                        
INFO:     172.18.0.1:36138 - "GET /job/status/7c329e42-9337-47c8-bb10-8f446390e8c3 HTTP/1.1" 200 OK            
[2023-12-21 08:58:45,626] WARNING in queue: Redis job JobStatusCodes.FAILED; Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/rq/worker.py", line 1428, in perform_job                       
    rv = job.perform()                                                                                         
         ^^^^^^^^^^^^^                                                                                         
  File "/usr/local/lib/python3.11/site-packages/rq/job.py", line 1278, in perform                              
    self._result = self._execute()                                                                             
                   ^^^^^^^^^^^^^^^                                                                             
  File "/usr/local/lib/python3.11/site-packages/rq/job.py", line 1315, in _execute                             
    result = self.func(*self.args, **self.kwargs)                                                              
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                              
  File "/home/worker/app/allele_cluster_service/tasks.py", line 27, in cluster                                 
    newick = backend(profile=profile, method=method.value)                                                     
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                     
  File "/home/worker/app/allele_cluster_service/ms_trees.py", line 1147, in backend                            
    tre = eval("methods." + params["method"])(names, profiles, embeded, **params)                              
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                              
  File "/home/worker/app/allele_cluster_service/ms_trees.py", line 726, in MSTree                              
    tree = methods._network2tree(tree, names)                                                                  
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                  
  File "/home/worker/app/allele_cluster_service/ms_trees.py", line 667, in _network2tree                       
    in_use = {branches[0][0]: 1}                                                                               
              ~~~~~~~~^^^                                                                                      
IndexError: list index out of range                                                                            

INFO:     172.18.0.1:36138 - "GET /job/status/7c329e42-9337-47c8-bb10-8f446390e8c3 HTTP/1.1" 200 OK            

if it's an expected failure due to a too low nbr of samples, then a suggestion for a future update is to berate user for their poor choices w/ informative error message (right now it just says that clustering failed w/o elaborating)

alkc commented 10 months ago

sample results are displayed and look great!

one suggestion though (for a future update) might be to improve some of the tables (like the ones below) which are a bit crowded:

bild

Quick suggestions could be to (if possible):

  1. Decrease font size whilst retaining cell/column sizes
  2. Increase column spacing where possible
  3. Increasing the vertical padding to separate the table rows
  4. Links can be color-coded instead of underlined
  5. The hovertip question mark symbols can be rendered in some shade of grey and perhaps be made a bit smaller, so they don't detract too much from the table values

for comparison the variants table looks good:

bild

mhkc commented 10 months ago

mlst clustering works when clustering all 15 samples, but seems to suffer from the same sample metadata loss as cgMLST clustering.

also the clustering fails when trying to cluster lower nbr of samples:

for example sending the following samples to mlst clustering:

19NG0500446_S9
19NG0500446_S2
19NG0500481_S1
19NG0500540
19NG0500538_S4
19NG0500586
19NG0500634
19NG0500471_S3
19NG0500546
19NG0500538_S12

leads to the following error in the api logs, with its source in the allele_cluster_service

INFO:     172.18.0.1:36132 - "POST /cluster/mlst/ HTTP/1.1" 201 Created                                        
INFO:     172.18.0.1:36138 - "GET /job/status/7c329e42-9337-47c8-bb10-8f446390e8c3 HTTP/1.1" 200 OK            
[2023-12-21 08:58:45,626] WARNING in queue: Redis job JobStatusCodes.FAILED; Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/rq/worker.py", line 1428, in perform_job                       
    rv = job.perform()                                                                                         
         ^^^^^^^^^^^^^                                                                                         
  File "/usr/local/lib/python3.11/site-packages/rq/job.py", line 1278, in perform                              
    self._result = self._execute()                                                                             
                   ^^^^^^^^^^^^^^^                                                                             
  File "/usr/local/lib/python3.11/site-packages/rq/job.py", line 1315, in _execute                             
    result = self.func(*self.args, **self.kwargs)                                                              
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                              
  File "/home/worker/app/allele_cluster_service/tasks.py", line 27, in cluster                                 
    newick = backend(profile=profile, method=method.value)                                                     
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                     
  File "/home/worker/app/allele_cluster_service/ms_trees.py", line 1147, in backend                            
    tre = eval("methods." + params["method"])(names, profiles, embeded, **params)                              
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                              
  File "/home/worker/app/allele_cluster_service/ms_trees.py", line 726, in MSTree                              
    tree = methods._network2tree(tree, names)                                                                  
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                  
  File "/home/worker/app/allele_cluster_service/ms_trees.py", line 667, in _network2tree                       
    in_use = {branches[0][0]: 1}                                                                               
              ~~~~~~~~^^^                                                                                      
IndexError: list index out of range                                                                            

INFO:     172.18.0.1:36138 - "GET /job/status/7c329e42-9337-47c8-bb10-8f446390e8c3 HTTP/1.1" 200 OK            

if it's an expected failure due to a too low nbr of samples, then a suggestion for a future update is to berate user for their poor choices w/ informative error message (right now it just says that clustering failed w/o elaborating)

I bug in GrapeTree. Seem to be caused when all MLST alleles are the same.

mhkc commented 10 months ago

https://github.com/Clinical-Genomics-Lund/bonsai/pull/109#issuecomment-1865825479

This is now fixed in master