write_off_md: Save Off Metadata for Velocity Analysis

View source: R/velocity_analysis_functions.R

write_off_mdR Documentation

Save Off Metadata for Velocity Analysis

Description

Save Off Metadata for Velocity Analysis

Usage

write_off_md(
  sobj,
  id_col,
  output_dir,
  vars_to_keep = NULL,
  handle_n_of_1 = TRUE
)

Arguments

sobj

Seurat object; must have a column titled sample_id

output_dir

The directory you wish to save your metadata to

vars_to_keep

Metadata columns you want saved off along with sample_id and UMAP and PCA embeddings

handle_n_of_1

boolean saying whether or not you want to handle the special case when a sample has only one observation

sobj_id

The specific seurat object ID for which you want metadata; required even if only one sample in sobj

Details

This is a helper function for running RNA velocity analysis. While your Seurat object may contain multiple samples, the loom files are constructed for each sample_id present in that object, and the anndata objects created from those loom files are for each individual sample_id. The function assumes that you made the loom files using the shell script "make_loom_files.sh", which changes the row names and appends a unique ID to the end of each sample when saving it off.

Value

A csv for each sample ID containing the sample ID, the reductions, and any user specified columns of metadata in output_dir


kidcancerlab/rrrSingleCellUtils documentation built on April 17, 2025, 5:10 p.m.