Closed apal6 closed 5 months ago
To people who encountered the same error, please try: annotation_test <- data.frame(test$annotation)
Yes, I was able to fix it after converting it to a dataframe.
merged_obj$Phenotype <- Idents(merged_obj)
annotation <- as.data.frame(merged_obj$Phenotype)
annotation$Phenotype <- annotation$merged_obj$Phenotype
annotation$merged_obj$Phenotype
<- NULL
annotation <- as.data.frame(annotation)
Hi and thank you for using CytoTRACE 2!
Thank you all for taking the time to suggest a solution to this issue! Your input is greatly appreciated. I’d like to add some clarification to ensure that the solution covers all aspects of the problem:
Regarding your first question about having your samples in different layers, the tool uses the specified slot type (with slot_type argument) of the "RNA" assay of the input Seurat object, so if you want to run the tool on all your samples combined, the entire expression data needs to be accessible by seurat[["RNA"]]@slot_type. However, if you suspect any batch effect between your samples, you might want to run CytoTRACE 2 on each dataset separately. Please refer to item 4 of our FAQ section in the README for more details.
As for the annotation object, it should be passed as a loaded data.frame object containing cell IDs as rownames and phenotype labels (string formatted without special characters) in the first column. Any additional columns will be ignored. Please refer to Input files section in the README for more details.
Thanks again for reaching out!
Hi,
It appears that this issue has been successfully resolved, and no further questions have come up given the clarifications we provided. Consequently, I am closing this issue ticket.
Thank you for reaching out to us!
Hi,
Thank you for the wonderful package.
My seurat object stores multiple samples as layers. Should I merge the layers and then run cytotrace2? What would you recommend?
Also, after I defined my annotations and ran the plotData command, i get this error,
Error in
[.data.frame(annotation, "Phenotype") : undefined columns selected
code: `# extract annotation data annotation_test <- test$annotation
plots_test <- plotData(cytotrace2_result = cytotrace2_result_test, annotation = annotation_test, expression_data = expression_data_test)`
Thank you