BayraktarLab / cell2location

Comprehensive mapping of tissue cell architecture via integrated single cell and spatial transcriptomics (cell2location model)
https://cell2location.readthedocs.io/en/latest/
Apache License 2.0
324 stars 58 forks source link

Error running plot in spatial coordinates #245

Closed ChristinaSteyn closed 1 year ago

ChristinaSteyn commented 1 year ago

Hi there,

I was also hoping to get assistance with this code:

with mpl.rc_context({'axes.facecolor':  'black',
                     'figure.figsize': [4.5, 5]}):
    sc.pl.spatial(adata_vis, color=['region_cluster'],
                  size=1.3, img_key='hires', alpha=0.5, save = '_region_cluster_spatial_coords.pdf')

which is giving this error:

ValueError: Found multiple possible libraries in `.uns['spatial']. Please specify. Options are: ['run_spaceranger_count_DH1', 'run_spaceranger_count_DH1a', 'run_spaceranger_count_DH2', 'run_spaceranger_count_DH2a', 'run_spaceranger_count_DH3', 'run_spaceranger_count_DH3a', 'run_spaceranger_count_DH4', 'run_spaceranger_count_DH4a']

It seems fairly straightforward but I am a novice in python and not sure how I should go about specifying one of these.

Thank you in advance!

vitkl commented 1 year ago

Please check scanpy documentation and spatial tutorial https://scanpy-tutorials.readthedocs.io/en/latest/spatial/basic-analysis.html