visualization error layout
A-legac45 opened this issue · 1 comments
Hello,
When I am trying to follow the tutorial with my data I encounter this error message which I do not know how to solve, (I am new in python)
0. Import
import os
import sys
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scanpy as sc
import seaborn as sns
visualization settings
%config InlineBackend.figure_format = 'retina'
%matplotlib inline
plt.rcParams['figure.figsize'] = [10, 9.5]
plt.rcParams["savefig.dpi"] = 300
Visualize
embedding == "X_pca"
sc.pl.draw_graph(adata, color=clustering)
I have the same error for all the commande which start with sc.pl.draw_graph
KeyError Traceback (most recent call last)
/Users/alegac/Desktop/celloralce_test/Network_analysis_with_Seurat_data.ipynb Cell 29 line 3
1 # Visualize
2 embedding == "X_pca"
----> 3 sc.pl.draw_graph(adata, color=clustering)
File ~/opt/anaconda3/envs/celloracle_env/lib/python3.8/site-packages/scanpy/plotting/_tools/scatterplots.py:818, in draw_graph(adata, layout, **kwargs)
784 """
785 Scatter plot in graph-drawing basis.
786
(...)
815 tl.draw_graph
816 """
817 if layout is None:
--> 818 layout = str(adata.uns['draw_graph']['params']['layout'])
819 basis = 'draw_graph_' + layout
820 if 'X_' + basis not in adata.obsm_keys():
It seems your data does not include FA graph data, but you are using a visualization function for the FA graph.
The error you faced is the scanty function, not the celloracle.
I would highly recommend getting used to single-cell data analysis with Scanpy.
https://scanpy.readthedocs.io/en/stable/