I did as you kindly suggested as below
> md = immune.combined@meta.data
>
> rownames(md) = gsub("^_", "", rownames(md))
> head(md)
nGene nUMI orig.ident res.0.7 CELL STAGE GENO dataset stage.nice celltype var.ratio.pca res.0.6
s1.1 4331 373762 SeuratProject 0 s1.1 H16 WT 1 H16 0 1.0109592 2
s1.2 5603 1074639 SeuratProject 0 s1.2 H16 WT 1 H16 0 0.9927172 2
s1.3 2064 49544 SeuratProject 0 s1.3 H16 WT 1 H16 0 1.1282714 0
s1.4 4680 772399 SeuratProject 1 s1.4 H16 WT 1 H16 1 1.2222062 1
s1.5 3876 272356 SeuratProject 1 s1.5 H16 WT 1 H16 1 2.3811263 1
s1.6 2557 122314 SeuratProject 0 s1.6 H16 WT 1 H16 0 0.7024815 2
>
> immune.combined@meta.data=md
>
> head(immune.combined@meta.data)
nGene nUMI orig.ident res.0.7 CELL STAGE GENO dataset stage.nice celltype var.ratio.pca res.0.6
s1.1 4331 373762 SeuratProject 0 s1.1 H16 WT 1 H16 0 1.0109592 2
s1.2 5603 1074639 SeuratProject 0 s1.2 H16 WT 1 H16 0 0.9927172 2
s1.3 2064 49544 SeuratProject 0 s1.3 H16 WT 1 H16 0 1.1282714 0
s1.4 4680 772399 SeuratProject 1 s1.4 H16 WT 1 H16 1 1.2222062 1
s1.5 3876 272356 SeuratProject 1 s1.5 H16 WT 1 H16 1 2.3811263 1
s1.6 2557 122314 SeuratProject 0 s1.6 H16 WT 1 H16 0 0.7024815 2
>
> metadata <- immune.combined@meta.data
> head(data[,1:4])
_s1.1 _s1.2 _s1.3 _s1.4
DDB_G0267178 0 1 0 1
DDB_G0267180 0 0 0 0
DDB_G0267182 0 0 0 3
DDB_G0267184 0 0 0 0
DDB_G0267188 1 0 0 1
DDB_G0267202 0 0 0 0
> colnames(data) = gsub("^_", "", colnames(data))
> head(data[,1:4])
s1.1 s1.2 s1.3 s1.4
DDB_G0267178 0 1 0 1
DDB_G0267180 0 0 0 0
DDB_G0267182 0 0 0 3
DDB_G0267184 0 0 0 0
DDB_G0267188 1 0 0 1
DDB_G0267202 0 0 0 0
> library('cccd')
> library('proxy')
> cellrouter <- CellRouter(rawdata=as.data.frame(data), min.cells=3,min.genes=0)
[1] "Initializing CellRouter object"
> cellrouter <- addInfo(cellrouter, metadata=metadata, colname = 'res.0.6', metadata.column = 'res.0.6')
Error in rep(colors, times = replicate_row) : invalid 'times' argument
> head(metadata)
nGene nUMI orig.ident res.0.7 CELL STAGE GENO dataset stage.nice celltype var.ratio.pca res.0.6
s1.1 4331 373762 SeuratProject 0 s1.1 H16 WT 1 H16 0 1.0109592 2
s1.2 5603 1074639 SeuratProject 0 s1.2 H16 WT 1 H16 0 0.9927172 2
s1.3 2064 49544 SeuratProject 0 s1.3 H16 WT 1 H16 0 1.1282714 0
s1.4 4680 772399 SeuratProject 1 s1.4 H16 WT 1 H16 1 1.2222062 1
s1.5 3876 272356 SeuratProject 1 s1.5 H16 WT 1 H16 1 2.3811263 1
s1.6 2557 122314 SeuratProject 0 s1.6 H16 WT 1 H16 0 0.7024815 2
>
But as you are considering CellRouter returns the same error
> cellrouter <- CellRouter(rawdata=as.data.frame(data), min.cells=3,min.genes=0)
[1] "Initializing CellRouter object"
> cellrouter <- addInfo(cellrouter, metadata=metadata, colname = 'res.0.6', metadata.column = 'res.0.6')
Error in rep(colors, times = replicate_row) : invalid 'times' argument