broadinstitute / SynerClust

source code for SynerClust
Other
9 stars 4 forks source link

WF_RefineClusters.py errors at line 284 and stalls #11

Closed tstraub89 closed 4 years ago

tstraub89 commented 4 years ago

I got this error message. Traceback (most recent call last): File "/home/unix/tstraub/.conda/envs/synerclust/lib/python2.7/multiprocessing/process.py", line 267, in _bootstrap self.run() File "/gsap/garage-bacterial/Users/Tim/.conda/envs/synerclust/bin/WF_RefineClusters.py", line 58, in run identical_index = next_task(self.mrca, genes_to_cluster, self.cluster_counter, self.lock, ok_trees, identical_orphans_to_check, identical_orphans_to_check_dict, identical_index, potentials, self.minSynFrac, self.synteny) File "/gsap/garage-bacterial/Users/Tim/.conda/envs/synerclust/bin/WF_RefineClusters.py", line 284, in __call__ if pairs[k][1] == 0.0 and self.graph[n1][k]['identical'] == 1 and self.graph[k][n1]['identical'] == 1: KeyError: 0

I traced it to line 284. I edited the script to include checking for each key value before trying to access the dictionary with given value. I.e.

if pairs[k][1] == 0.0 and n1 in self.graph and k in self.graph[n1] and self.graph[n1][k]['identical'] == 1 and k in self.graph and n1 in self.graph[k] and self.graph[k][n1]['identical'] == 1:

This seemed to fix the error, though I did not verify that the tool performed the analysis as expected.

GeorgescuC commented 4 years ago

Issue fixed in 136f25044a18031a2f1c6e5ffd224c204d5975f4.