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
321 stars 58 forks source link

export_posterior() got an unexpected keyword argument 'add_to_obsm' #276

Open kuang-da opened 1 year ago

kuang-da commented 1 year ago

Hi,

I encountered an issue while running the cell2location_tutorial.ipynb using cell2location version 0.1.3. The error seems to be related to a change in parameters. Could you please provide any guidance on how to update this step in the tutorial? Thank you!

adata_ref = mod.export_posterior(
    adata_ref, use_quantiles=True,
    # choose quantiles
    add_to_obsm=["q05","q50", "q95", "q0001"],
    sample_kwargs={'batch_size': 2500, 'use_gpu': True}
)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[20], line 1
----> 1 adata_ref = mod.export_posterior(
      2     adata_ref, use_quantiles=True,
      3     # choose quantiles
      4     add_to_obsm=["q05","q50", "q95", "q0001"],
      5     sample_kwargs={'batch_size': 2500, 'use_gpu': True}
      6 )

TypeError: RegressionModel.export_posterior() got an unexpected keyword argument 'add_to_obsm'
Linlinwangwang commented 1 year ago

I meet the same question

sondvo commented 1 year ago

I also reported it in https://github.com/BayraktarLab/cell2location/issues/281 and suggest a solution. Hope this helps

vitkl commented 1 year ago

add_to_varm should be used here, sorry for confusion. This will be fixed later this summer.