Here is the code that I tried to add metadata
Addmetadata <- AddMetaData(object=seurat,metadata = transposemeta,col.name = "cell_type__ontology_label")
The following error was given:
"Error in [[<-:
! None of the meta data requested was found in the data frame "
I have transposed my MetaData, which makes it so that the cells are on the columns and the metadata attribute associated with those cells is on the rows. I did this to make the metadata have the same column-row format as the data I used to create the Seurat object. However, the AddMetaData() function only allows us to add metadata column to our Seurat object. So, is there any ways that I can add my metadata rows to my seurat object?
Seurat metadata has one row per cell, and the columns are annotations for the cells. The counts table has one column per cell and the rows are features (genes). So the orientation of the metadata is not the same as the counts table. If you want to add a new attribute to metadata, it should be a new column, and that's what
AddMetadata()does.Adding rows to metadata only makes sense if you are adding more cells into the dataset, in which case you should make your new data into another Seurat object and use
merge()to combine them.