sunduanchen / Scissor

Scissor package
GNU General Public License v3.0
168 stars 29 forks source link

Run error in our own Seurat object #16

Open l-magnificence opened 2 years ago

l-magnificence commented 2 years ago

When I run in our own Seurat object, it occurs error

infos1 <- Scissor(bulk_dataset, tumor, phenotype, alpha = 0.05, 
                  family = "cox", Save_file = './processed/Scissor_survival.RData')
Error in array(x, c(length(x), 1L), if (!is.null(names(x))) list(names(x),  : 
  'data' must be of a vector type, was 'NULL'

But when we use Seurat_preprocessing before, it run success

tumor<- Seurat_preprocessing(seurat@assays$SCT@counts, verbose = F)
infos1 <- Scissor(bulk_dataset, tumor, phenotype, alpha = 0.05, 
                  family = "cox", Save_file = './processed/Scissor_survival.RData')

Is there any bug in applying Scissor function to our own seurat object?

sunduanchen commented 2 years ago

For your own seurat object, Scissor requires the normalized data and a constructed nearest neighbor network (slot name: data and RNA_snn).

You can check whether your data has these Scissor inputs. If our code still cannot run, you can send me your seurat data to my email: sunduanchen@gmail.com and I will debug it soon.

Thanks, Duanchen

l-magnificence commented 2 years ago

Yes, my data have normalized data and a constructed nearest neighbor network. I think the problem may be the process of seurat. In your Seurat_preprocessing function, the object only do the LogNormalize function, so the downstream analysis in Scissor only accept LogNormalized seurat. But if one use SCTransform to normalize the data and FindNeighbors in slot SCT, there may occur error.

sunduanchen commented 2 years ago

Thank you very much for your feedback. I will make an update to allow users to choose the desired slot.

Eddylyf commented 2 years ago

I have the same issue!

hyjforesight commented 2 years ago

agree with @l-magnificence . I changed from SCTransform back to the LogNormalized workflow. this error was solved.

Miooooooo commented 2 years ago

My input data is integrated and my sc_dataset@graphs list have two dataframe named "integrated_nn" and "integrated_snn" so I got the same error. I can rename the fies to sc_dataset@graphs$RNA_snn to deal with this error. But I confuse about sample `s batch when using Scissor, better remove or not ?

AClab-sgarcia commented 1 year ago

@sunduanchen Has the correction been made to be able to use SCT?

hyjforesight commented 1 year ago

@Miooooooo is correct. Merge2.combined@graphs$RNA_snn=Merge2.combined@graphs$integrated_snn plays the trick.