# Any ideas what my problems are?

**URL:** <https://discourse.scverse.org/t/any-ideas-what-my-problems-are/40>\
**Category:** scanpy\
**Created:** [March 1, 2021, 9:42pm UTC](https://discourse.scverse.org/t/any-ideas-what-my-problems-are/40 "2021-03-01T21:42:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sunliang3361](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/sunliang3361/32/20_2.png) [@sunliang3361](https://discourse.scverse.org/u/sunliang3361)\
**Post date:** [March 1, 2021, 9:42pm UTC](https://discourse.scverse.org/t/any-ideas-what-my-problems-are/40/1 "2021-03-01T21:42:33Z")

</div>

sc.pl.scatter(adata, basis=‘draw\_graph\_k10’, color=[‘Time point (days)’, ‘leiden\_k10’, ‘leiden\_k100’], frameon=False, size=5)  
sc.pl.scatter(adata, basis=‘draw\_graph\_k100’, color=[‘Time point (days)’, ‘leiden\_k10’, ‘leiden\_k100’], frameon=False, size=5)

## Received the following error messages:

ValueError Traceback (most recent call last)  
 in   
----\> 1 sc.pl.scatter(adata, basis=‘draw\_graph\_k10’, color=[‘Time point (days)’, ‘leiden\_k10’, ‘leiden\_k100’], frameon=False, size=5)  
2 sc.pl.scatter(adata, basis=‘draw\_graph\_k100’, color=[‘Time point (days)’, ‘leiden\_k10’, ‘leiden\_k100’], frameon=False, size=5)

/programs/x86\_64-linux/scvi-tools/0.8.1/scvi-tools\_extlib/miniconda3-4.8.3-fp7e/lib/python3.8/site-packages/scanpy/plotting/\_anndata.py in scatter(adata, x, y, color, use\_raw, layers, sort\_order, alpha, basis, groups, components, projection, legend\_loc, legend\_fontsize, legend\_fontweight, legend\_fontoutline, color\_map, palette, frameon, right\_margin, left\_margin, size, title, show, save, ax)  
118 args = locals()  
119 if basis is not None:  
 → 120 return \_scatter\_obs(\*\*args)  
121 if x is None or y is None:  
122 raise ValueError(‘Either provide a `basis` or `x` and `y`.’)

/programs/x86\_64-linux/scvi-tools/0.8.1/scvi-tools\_extlib/miniconda3-4.8.3-fp7e/lib/python3.8/site-packages/scanpy/plotting/\_anndata.py in \_scatter\_obs(adata, x, y, color, use\_raw, layers, sort\_order, alpha, basis, groups, components, projection, legend\_loc, legend\_fontsize, legend\_fontweight, legend\_fontoutline, color\_map, palette, frameon, right\_margin, left\_margin, size, title, show, save, ax)  
319 colorbar = False  
320 else:  
 → 321 raise ValueError(  
322 f’key {key!r} is invalid! pass valid observation annotation, ’  
323 f’one of {adata.obs\_keys()} or a gene name {adata.var\_names}’

ValueError: key ‘Time point (days)’ is invalid! pass valid observation annotation, one of [‘Day’, ‘Batch’, ‘n\_counts’, ‘Batch index’, ‘doublet\_score’, ‘predicted\_doublet’, ‘n\_genes\_by\_counts’, ‘total\_counts’, ‘total\_counts\_mt’, ‘pct\_counts\_mt’, ‘mt MAD p-val’, ‘mt MAD p-val BH’, ‘mt\_accepted’, ‘\_scvi\_batch’, ‘\_scvi\_labels’, ‘\_scvi\_local\_l\_mean’, ‘\_scvi\_local\_l\_var’, ‘leiden\_k100’, ‘\_scvi\_raw\_norm\_scaling’, ‘leiden\_k1’, ‘leiden\_k2’, ‘leiden\_k5’, ‘leiden\_k10’, ‘leiden\_k20’, ‘leiden\_k50’] or a gene name Index([‘SAMD11’, ‘PLEKHN1’, ‘HES4’, ‘ISG15’, ‘AGRN’, ‘C1QTNF12’, ‘MXRA8’,  
‘ANKRD65’, ‘VWA1’, ‘TMEM240’,  
…  
‘COL18A1’, ‘AJ011932.1’, ‘COL6A1’, ‘COL6A2’, ‘MCM3AP-AS1’, ‘C21orf58’,  
‘PCNT’, ‘S100B’, ‘MT-ND6’, ‘AC007325.4’],  
dtype=‘object’, length=4060)

---

<div class="post-metadata">

**Author:** ![adamgayoso](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.scverse.org/adamgayoso/32/100_2.png) [@adamgayoso](https://discourse.scverse.org/u/adamgayoso)\
**Post date:** [March 2, 2021, 5:38am UTC](https://discourse.scverse.org/t/any-ideas-what-my-problems-are/40/2 "2021-03-02T05:38:02Z")

</div>

> [@sunliang3361](#):
>
> sc.pl.scatter(adata, basis=‘draw\_graph\_k10’, color=[‘Time point (days)’, ‘leiden\_k10’, ‘leiden\_k100’], frameon=False, size=5)

Based on the traceback, `"Time point (days)"` is not in `adata.obs.keys()`, but `"Day"` is.

Also, this issue is specific to Scanpy and not scvi-tools. These sorts of questions can be asked here:

[https://scanpy.discourse.group/](https://scanpy.discourse.group/)
