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

computeSumFactors run error (Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘assay’ for signature ‘"matrix", "character"’) #66

Closed rdcwuyy closed 3 years ago

rdcwuyy commented 3 years ago

Hi,

First of all, thank you so much for your wonderful work on this tutorial!

I run into this error:

"_Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘assay’ for signature ‘"matrix", "character"’ "

when executing this line of code:

"size_factors = computeSumFactors(data_mat, clusters=input_groups, min.mean=0.1)"

I searched and found it was reported previously, and it seems to be a version conflict problem. I have thus tried to install different Bioconductor and/or R versions, but so far failed to make it work.

Therefore I tried to instead run the tutorial (https://github.com/theislab/single-cell-tutorial/blob/master/latest_notebook/Case-study_Mouse-intestinal-epithelium_1906.ipynb) on docker https://hub.docker.com/r/leanderd/single-cell-analysis, unfortunately, the problem still persist, even running in the docker container.

Could you please help to have a look?

Thanks again. Best wishes, Yanying

rdcwuyy commented 3 years ago

Sorry, just read the closed issues and found it was reported recently already.

LuckyMD commented 3 years ago

Apologies... the new code is available in a PR, but not yet merged as I need to go through this and check some stuff.

rdcwuyy commented 3 years ago

Thanks a lot for your kind reply!

Looking forward to the new release.

So far, the solution you provided previously worked. :)

Many thanks again and Happy Easter! Best wishes, Yanying

在 2021年4月3日,01:33,MalteDLuecken @.***> 写道:

 Apologies... the new code is available in a PR, but not yet merged as I need to go through this and check some stuff.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.

LuckyMD commented 3 years ago

Great! The previously provided solution is for the new version of the tutorial ;).

Happy Easter!

eleonoravercesi commented 3 years ago

@rdcwuyy you mentioned a solution provided by author, however I am not able to find it. I have the same error and I am not able to solve it. Here some details about my computer:

MacBook Air (M1, 2020) - MacOS BigSur 11.6
R version 4.1.1 (2021-08-10)
Python 3.6.13
Bioconductor version: 3.13

Thank you for any answer!

rdcwuyy commented 3 years ago

@rdcwuyy you mentioned a solution provided by author, however I am not able to find it. I have the same error and I am not able to solve it. Here some details about my computer:

MacBook Air (M1, 2020) - MacOS BigSur 11.6
R version 4.1.1 (2021-08-10)
Python 3.6.13
Bioconductor version: 3.13

Thank you for any answer!

Hello,

The following solution worked for me:

(https://github.com/theislab/single-cell-tutorial/issues/60)

LuckyMD commented on 21 Feb Ah, you seem to be the victim of an updated docker container with a notebook that hasn't been updated yet. I'm still reviewing the new code update to make sure we can update this. The new version of scran expects a SingleCellExperiment object rather than just a data matrix.

You can adapt the above by replacing the offending line with: size_factors = sizeFactors(computeSumFactors(SingleCellExperiment(list(counts=data_mat)), clusters=input_groups, min.mean=0.1))

Good luck! Yanying

eleonoravercesi commented 3 years ago

@rdcwuyy Thank you! This also worked for me!