ciccalab / SIMPLI

SIMPLI is a highly configurable pipeline for the analysis of multiplexed imaging data.
https://github.com/ciccalab/SIMPLI/wiki
Other
35 stars 5 forks source link

Issue with CreateSeuratObject #9

Closed AlessiaCaramello closed 1 year ago

AlessiaCaramello commented 1 year ago

Hey Michele,

I'm trying to run SIMPLI again but I'm getting an issue at the clustering step. This is the clustering_log.txt output:

Loading required package: ggplot2
Loading required package: cowplot
Loading required package: Matrix
Registered S3 method overwritten by 'gplots':
  method         from 
  reorder.factor gdata
Warning: namespace ‘dimRed’ is not available and has been replaced
by .GlobalEnv when processing object ‘<unknown>’
Warning: namespace ‘dimRed’ is not available and has been replaced
by .GlobalEnv when processing object ‘<unknown>’
[1] "annotated_cells.csv"                                                                                                                                                                                                                                                                                                             
[2] "sample_metadata_SEN.csv"                                                                                                                                                                                                                                                                                                         
[3] "all_cells"                                                                                                                                                                                                                                                                                                                       
[4] "Intensity_MeanIntensity_CD163@Intensity_MeanIntensity_p16@Intensity_MeanIntensity_yH2AX@Intensity_MeanIntensity_OLIG2@Intensity_MeanIntensity_p21@Intensity_MeanIntensity_MAP2@Intensity_MeanIntensity_GLB1@Intensity_MeanIntensity_GFAP@Intensity_MeanIntensity_Ki67@Intensity_MeanIntensity_Iba1@Intensity_MeanIntensity_GLUT1"
[5] "0.4"                                                                                                                                                                                                                                                                                                                             
[6] "all_cells"                                                                                                                                                                                                                                                                                                                       
[7] "all_cells"                                                                                                                                                                                                                                                                                                                       
Reading the clustering data by sample
Scaling and centering clustering data by sample.
Error in (function (cl, name, valueClass)  : 
  assignment of an object of class “NULL” is not valid for @‘cell.names’ in an object of class “seurat”; is(value, "vector") is not TRUE
Calls: lapply -> FUN -> CreateSeuratObject -> <Anonymous>
In addition: There were 50 or more warnings (use warnings() to see the first 50)
Execution halted

I've run your code from Seurat_Runner.R up to creating the seurats_by_sample object on my RStudio and it works, but I have the new version of Seurat. Do you have any suggestions on how to fix it?

Thanks a lot for your help!

MicheleBortol commented 1 year ago

Hi Alessia,

Could you share the input files: "annotated_cells.csv", "sample_metadata_SEN.csv"? I suspect there could be some issue with the way the script is reading the "CellName" column of the "annotated_cells.csv" file. Does it contain any special characters?

Best,

Michele

AlessiaCaramello commented 1 year ago

Hi Michele,

thanks for quick reply! You can download the input files from the link below. Archive.zip

The CellName is generally something like this:Alz_A16317_EC_2-1 so no special characthers unless too many underscores is an issue.

Thanks a lot for your help!

Best Alessia

MicheleBortol commented 1 year ago

Perfect, thank you for the files. I had a very quick look and all the names seem fine, underscores should be totally OK. I will try running the script in the singularity container and see if I get the same error. I'll update you when I reproduce the error.

Best

Michele

AlessiaCaramello commented 1 year ago

Thanks a lot Michele!

MicheleBortol commented 1 year ago

OK, so the error is caused by one of the samples ("Ctrl_PDC16_MTG_4") having only one cell in the "all_cells". You can find a fix in: #10. It is not merged yet, but you can just switch to this branch for the fixed code. or just download the script from here. Now it works for me with your script, but please let usknow if you find any issues downstream.

AlessiaCaramello commented 1 year ago

Thank you so much Michele! It works now.