Skip to content

# Perform dimensionality reduction and clustering of GEX and TCR data. # UMAP reduction and louvain clustering are the defaults. adata = conga.preprocess.cluster_and_tsne_and_umap(adata) print('adata.shape:', adata.shape) print('adata.obs_keys():', adata.obs_keys()) print('adata.obsm_keys():', adata.obsm_keys()) #72

Description

@szy23333

Selection deleted

Perform dimensionality reduction and clustering of GEX and TCR data.

UMAP reduction and louvain clustering are the defaults.

adata = conga.preprocess.cluster_and_tsne_and_umap(adata)

print('adata.shape:', adata.shape)
print('adata.obs_keys():', adata.obs_keys())
print('adata.obsm_keys():', adata.obsm_keys())
computing X_pca_gex using sc.tl.pca
Exception ignored on calling ctypes callback function: <function ExecutionEngine._raw_object_cache_getbuffer at 0x13ca65940>
Traceback (most recent call last):
File "/opt/anaconda3/envs/conga/lib/python3.9/site-packages/llvmlite/binding/executionengine.py", line 210, in _raw_object_cache_getbuffer
buf = self._object_cache_getbuffer(module)
File "/opt/anaconda3/envs/conga/lib/python3.9/site-packages/numba/core/codegen.py", line 902, in _object_getbuffer_hook
if self._object_caching_enabled and self._compiled_object:
ReferenceError: weakly-referenced object no longer exists
Exception ignored on calling ctypes callback function: <function ExecutionEngine._raw_object_cache_notify at 0x13ca658b0>
Traceback (most recent call last):
File "/opt/anaconda3/envs/conga/lib/python3.9/site-packages/llvmlite/binding/executionengine.py", line 194, in _raw_object_cache_notify
self._object_cache_notify(module, buf)
File "/opt/anaconda3/envs/conga/lib/python3.9/site-packages/numba/core/codegen.py", line 889, in _object_compiled_hook
if self._object_caching_enabled:
ReferenceError: weakly-referenced object no longer exists
running 1D UMAP gex
ran louvain clustering: louvain_gex
preprocess.cluster_and_tsne_and_umap:: X_pca_tcr is not present in adata.obsm; using exact tcrdist nbrs for umap and clustering
util.run_command: cmd= /Users/shaozheyu/Desktop/单细胞教程/TCR:BCR自用/conga/conga/tcrdist_cpp/bin/find_neighbors -f tmp_tcrdists3585_tcrs.tsv -n 10 -d /Users/shaozheyu/Desktop/单细胞教程/TCR:BCR自用/conga/conga/tcrdist_cpp/db/tcrdist_info_human.txt -o tmp_tcrdists3585_calc_tcrdist
Read 37313 paired tcrs from file tmp_tcrdists3585_tcrs.tsv
making tmp_tcrdists3585_calc_tcrdist_knn_indices.txt and tmp_tcrdists3585_calc_tcrdist_knn_distances.txt
.................................................. 5000
.................................................. 10000
.................................................. 15000
.................................................. 20000
.................................................. 25000
.................................................. 30000
.................................................. 35000
......................
try new name for compute_connectivities_umap
.

AttributeError Traceback (most recent call last)
File ~/Desktop/单细胞教程/TCR:BCR自用/conga/conga/conga/preprocess.py:1865, in calc_tcrdist_nbrs_umap_clusters_cpp(adata, num_nbrs, tmpfile_prefix, umap_key_added, cluster_key_added, clustering_resolution, clustering_method, n_components_umap, make_1d_umaps, umap_1d_key_added)
1864 try: # HACK: the naming of this function changes across scanpy versions
-> 1865 distances,connectivities= sc.neighbors.compute_connectivities_umap(
1866 knn_indices, knn_distances, adata.shape[0], num_nbrs)
1867 except:

AttributeError: module 'scanpy.neighbors' has no attribute 'compute_connectivities_umap'

During handling of the above exception, another exception occurred:

AttributeError Traceback (most recent call last)
Cell In[10], line 3
1 # Perform dimensionality reduction and clustering of GEX and TCR data.
2 # UMAP reduction and louvain clustering are the defaults.
----> 3 adata = conga.preprocess.cluster_and_tsne_and_umap(adata)
5 print('adata.shape:', adata.shape)
6 print('adata.obs_keys():', adata.obs_keys())

File ~/Desktop/单细胞教程/TCR:BCR自用/conga/conga/conga/preprocess.py:736, in cluster_and_tsne_and_umap(adata, clustering_resolution, recompute_pca_gex, skip_tsne, skip_tcr, clustering_method, n_neighbors, n_gex_pcs, make_1d_umaps, umap_min_dist, umap_spread)
732 if tag == 'tcr' and 'X_pca_tcr' not in adata.obsm_keys():
733 print('preprocess.cluster_and_tsne_and_umap:: X_pca_tcr is'
734 ' not present in adata.obsm; using exact tcrdist nbrs'
735 ' for umap and clustering')
--> 736 calc_tcrdist_nbrs_umap_clusters_cpp(
737 adata, n_neighbors, make_1d_umaps=make_1d_umaps,
738 clustering_method=clustering_method,
739 clustering_resolution=clustering_resolution,
740 )
741 continue
743 adata.obsm['X_pca'] = adata.obsm['X_pca_'+tag]

File ~/Desktop/单细胞教程/TCR:BCR自用/conga/conga/conga/preprocess.py:1869, in calc_tcrdist_nbrs_umap_clusters_cpp(adata, num_nbrs, tmpfile_prefix, umap_key_added, cluster_key_added, clustering_resolution, clustering_method, n_components_umap, make_1d_umaps, umap_1d_key_added)
1867 except:
1868 print('try new name for compute_connectivities_umap')
-> 1869 distances,connectivities= sc.neighbors._compute_connectivities_umap(
1870 knn_indices, knn_distances, adata.shape[0], num_nbrs)
1872 if issparse(connectivities): # I think this is always true
1873 from scipy.sparse.csgraph import connected_components

AttributeError: module 'scanpy.neighbors' has no attribute '_compute_connectivities_umap'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions