Adds new column labeled "pct_diff" to the data.frame output of FindMarkers, FindAllMarkers, or other DE test data.frames.

Add_Pct_Diff(
  marker_dataframe,
  pct.1_name = "pct.1",
  pct.2_name = "pct.2",
  overwrite = FALSE
)

Arguments

marker_dataframe

data.frame containing the results of FindMarkers, FindAllMarkers, or other DE test data.frame.

pct.1_name

the name of data.frame column corresponding to percent expressed in group 1. Default is Seurat default "pct.1".

pct.2_name

the name of data.frame column corresponding to percent expressed in group 2. Default is Seurat default "pct.2".

overwrite

logical. If the marker_dataframe already contains column named "pct_diff" whether to overwrite or return error message. Default is FALSE.

Value

Returns input marker_dataframe with additional "pct_diff" column.

Examples

if (FALSE) {
marker_df <- FindAllMarkers(object = obj_name)
marker_df <- Add_Pct_Diff(marker_dataframe = marker_df)
# or piped with function
marker_df <- FindAllMarkers(object = obj_name) %>%
  Add_Pct_Diff()
}