immunogenomics / harmony

Fast, sensitive and accurate integration of single-cell data with Harmony
https://portals.broadinstitute.org/harmony/
Other
512 stars 98 forks source link

Warning: Invalid name supplied, making object name syntactically valid #71

Closed rahulnutron closed 4 years ago

rahulnutron commented 4 years ago

Dear Harmony Team,

Thanks for the tool!

I was running this tool with a plant scRNA-seq data, however this resulted an warning while combining with Seurat. I tried to use the "new object name", however it also fails. Thanks in advance for any help! My code and error are given below Regards, Rahul

set.seed(42)

ara.data <- Read10X(data.dir = "E:/Arabidopsis datasets/Zhang/root_atlas/root_matrix/TAIR/") ara <- CreateSeuratObject(counts = ara.data, min.cells = 3, project = "Zhang_SC")

dim(ara)

ara[["percent.mt"]] <- PercentageFeatureSet(ara, pattern = "^ATM") ara[["percent.ct"]] <- PercentageFeatureSet(ara, pattern = "^ATC")

ara <- subset(ara, subset = nFeature_RNA > 500 & nFeature_RNA < 5000 & percent.mt < 5 & percent.ct < 5) VlnPlot(ara, features = c("nFeature_RNA", "nCount_RNA", "percent.mt","percent.ct"), ncol = 4)

dim(ara)

ara <- NormalizeData(ara, normalization.method = "LogNormalize") ara <- FindVariableFeatures(ara, selection.method = "vst", nfeatures = 2000, verbose = FALSE) ara <- ScaleData(ara, verbose = FALSE) ara <- RunPCA(ara, npcs = 30, verbose = FALSE) ara <- RunHarmony(ara,"orig.ident",assay.use="RNA") Harmony converged after 4 iterations Warning: Invalid name supplied, making object name syntactically valid. New object name is Seurat..ProjectDim.RNA.harmony; see ?make.names for more details on syntax validity

rahulnutron commented 4 years ago

I proceed with RunUMAP and its working

gloriafight commented 3 years ago

I met the same warning. Will it affect the follow-up analysis?

colinmcgovern commented 2 years ago

I am not sure what this error means, but if you the following your umap will be updated:

main_exp <- FindNeighbors(main_exp, reduction="harmony", dims = 1:NUM_PCAS)
main_exp <- RunUMAP(main_exp, reduction="harmony", dims = 1:NUM_PCAS)

source:https://nbisweden.github.io/workshop-scRNAseq/labs/compiled/seurat/seurat_03_integration.html

Romhop commented 1 year ago

I wonder why you should RUNharnomy when you only have one data set?

YogiBud commented 1 year ago

add "project.dim = F", the warning will disappear. H_Cellular_Harmony <- H_Sobj_Cellular %>% RunHarmony(group.by.vars = "sample_name", plot_convergence = FALSE, project.dim = F)

officialprofile commented 1 year ago

I wonder why you should RUNharnomy when you only have one data set?

Because even within one data set you can have batch effect

TdzBAS commented 2 months ago

@officialprofile Sure, but you cant account for it. Because you have no reference to do the batch correction. So harmony for instance is not suited for one batch. I am not aware of any batch algorithm that does account for one batch correction. This is usually adjusted for when doing scaling aka the first step of Normalization.