theislab / single-cell-tutorial

Single cell current best practices tutorial case study for the paper:Luecken and Theis, "Current best practices in single-cell RNA-seq analysis: a tutorial"
1.39k stars 458 forks source link

Key Error "base" in section "marker genes & annotation" #97

Closed Mari123i closed 2 years ago

Mari123i commented 2 years ago

Hello Malte, I get the following issue in the Marker genes section: This is my AnnData Object:

andata

And this is the error I get:

Anndata error base

I work with the tutorial dataset in case it is relevant, but had to skip few steps containing R code.

Greetings, Mariam

Edit: The adata.uns["log1p"] seems to be empty Bild_2022-05-19_134147024

LuckyMD commented 2 years ago

Hi @Mari123i,

Did you run sc.pp.log1p on the data at some point? Then this slot should exist. Also, which version of scanpy are you using?

Mari123i commented 2 years ago

Hello,
Yes. I use 1.9.1. Its seems to be an error of saving it and loading it again

LuckyMD commented 2 years ago

This seems to be a scanpy bug as you can see here and here. The latter issue suggests to just add the line:

adata.uns['log1p']["base"] = None after reading again, or downgrading to AnnData<0.8. Either way, this should be fixed soon by the maintenance team.

Mari123i commented 2 years ago

It works! Thank you alot!