Entering edit mode
6.2 years ago
Za
▴
140
Hi,
My Seurat metadata looks so
> 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.8560791 1
_s1.2 5603 1074639 SeuratProject 0 s1.2 H16 WT 1 H16 0 1.1616687 0
_s1.3 2064 49544 SeuratProject 0 s1.3 H16 WT 1 H16 0 1.1566137 1
_s1.4 4680 772399 SeuratProject 1 s1.4 H16 WT 1 H16 1 0.5947263 0
_s1.5 3876 272356 SeuratProject 1 s1.5 H16 WT 1 H16 1 1.4148602 0
_s1.6 2557 122314 SeuratProject 0 s1.6 H16 WT 1 H16 0 1.2174034 1
>
I tried to feed my Seurat to CellRouter R package but CellRouter return
Error in rep(colors, times = replicate_row) : invalid 'times' argument
I think because of _ in row names of my metadata
I tried to edit my metadata manually but after adding edited version to Seurat that looks so :(
> cc <- AddMetaData(object = immune.combined, metadata = rrrrr)
> cc <- SetAllIdent(object = cc, id = "rownames(rrrrr")
> head(cc@meta.data)
nGene nUMI orig.ident res.0.7 CELL STAGE GENO dataset stage.nice celltype var.ratio.pca res.0.6
_s1.1 NA NA <NA> NA <NA> <NA> <NA> NA <NA> NA NA NA
_s1.2 NA NA <NA> NA <NA> <NA> <NA> NA <NA> NA NA NA
_s1.3 NA NA <NA> NA <NA> <NA> <NA> NA <NA> NA NA NA
_s1.4 NA NA <NA> NA <NA> <NA> <NA> NA <NA> NA NA NA
_s1.5 NA NA <NA> NA <NA> <NA> <NA> NA <NA> NA NA NA
_s1.6 NA NA <NA> NA <NA> <NA> <NA> NA <NA> NA NA NA
Who knows how I can edit metadata in seurat?
I did as you kindly suggested as below
But as you are considering CellRouter returns the same error
I don't use Cellrouter, but can confidently say that this is not an issue due to row.names. The code from https://github.com/edroaldo/cellrouter/blob/master/CellRouter_Class.R
The replicate_row is coming from sampTab and probably you need to explicitly pass a sampleTable somewhere.