sidhomj / DeepTCR

Deep Learning Methods for Parsing T-Cell Receptor Sequencing (TCRSeq) Data
https://sidhomj.github.io/DeepTCR/
MIT License
113 stars 40 forks source link

Tutorial: Clustering TCR Sequences list index out of Range Error when using DeepTCR in WSL #53

Closed jkbenotmane closed 2 years ago

jkbenotmane commented 3 years ago

I tried to run the jupyter notebook tutorial as is after installing DeepTCR Development Version into its own Environment like this : pip3 install git+https://github.com/sidhomj/DeepTCR.git.

Running the Second Cell of the Tutorial (Phenograph Clustering) of the loaded Data I get a List index out of Range Error:

Command:

DTCRU.Cluster(clustering_method='phenograph')

Output:

Finding 30 nearest neighbors using minkowski metric and 'auto' algorithm Neighbors computed in 3.4997947216033936 seconds Jaccard graph constructed in 1.022956371307373 seconds Wrote graph to binary file in 0.5937418937683105 seconds Running Louvain modularity optimization

Error:


---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-2-1c6d55ce009b> in <module>
----> 1 DTCRU.Cluster(clustering_method='phenograph')

~/.local/lib/python3.8/site-packages/DeepTCR/DeepTCR.py in Cluster(self, set, clustering_method, t, criterion, linkage_method, write_to_sheets, sample, n_jobs, order_by_linkage)
   1044 
   1045             elif clustering_method == 'phenograph':
-> 1046                 IDX, _, _ = phenograph.cluster(features, k=30, n_jobs=n_jobs)
   1047 
   1048             elif clustering_method == 'kmeans':

~/.local/lib/python3.8/site-packages/DeepTCR/phenograph/cluster.py in cluster(data, k, directed, prune, min_cluster_size, jaccard, primary_metric, n_jobs, q_tol, louvain_time_limit, nn_method)
    114     uid = uuid.uuid1().hex
    115     graph2binary(uid, graph)
--> 116     communities, Q = runlouvain(uid, tol=q_tol, time_limit=louvain_time_limit)
    117     print("PhenoGraph complete in {} seconds".format(time.time() - tic), flush=True)
    118     communities = sort_by_size(communities, min_cluster_size)

~/.local/lib/python3.8/site-packages/DeepTCR/phenograph/core.py in runlouvain(filename, max_runs, time_limit, tol)
    261 
    262         # continue only if we've reached a higher modularity than before
--> 263         if q[-1] - Q > tol:
    264 
    265             Q = q[-1]

IndexError: list index out of range
``

What am I doing wrong ?
jkbenotmane commented 2 years ago

The Error is probably caused by an unknown Error of using DeepTCR in WSL.

Closing this and leaving it for others.