Skip to contents

This function is used to add a score for each CN peak (loss or gain) in a Seurat object.

Usage

cnv_add_score(sobj, segments, table_cnv, scoring_fun = stats::median)

Arguments

sobj

A Seurat object (no default)

segments

DATAFRAME : a dataframe containing start, stop and seg_name, to score cells for (no default)

table_cnv

DATAFRAME : dataframe (genes x cells) containing CNV. Genes must be in the transcriptome order. Cells in table_cnv should be in sobj (no default).

scoring_fun

FUNCTION : a function to aggregate table_cnv values for each segment. It could be mean, sum, median, or a custom function (default to stats::median)

Value

The input sobj with new columns in @meta.data, corresponding to score_chrA_B.