View source: R/Seurat.Utils.Metadata.R
create.metadata.vector | R Documentation |
This function creates a metadata vector from an input vector and a Seurat object. The resulting vector contains values from 'vec' for the intersecting cell names between 'vec' and 'obj'. It also checks if the intersection between the cell names in 'vec' and 'obj' is more than a minimum intersection size.
create.metadata.vector(
vec,
obj = combined.obj,
fill = NA,
min.intersect = min(length(vec), ncol(obj), 100)
)
vec |
A named vector where the names represent cell IDs. This vector should have partial overlap with the cells in a Seurat object. |
obj |
A Seurat object that contains cell IDs which partially overlap with 'vec'. |
fill |
The value to fill for non-intersecting cell names in 'obj'. Default is NA. |
min.intersect |
The minimum number of cells to find in both 'vec' and 'obj'. The function will stop if the intersection is less than this number. Default is 100. |
A named vector of length equal to the number of cells in 'obj', with names from 'obj' and values from 'vec' for intersecting cell names.
## Not run:
create.metadata.vector(vec = my_vector, obj = my_seurat_object, min.intersect = 50)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.