This function compares two groups or sets of groups to find genes that are differentially expressed based on the fraction of cells with expression above a given thresshold. Because multiple groups can be combined, these are termed "class 1" and "class 2" for this comparison. The comparison is performed in both directions, so will identify genes with preferrential expression for both class 1 and class 2.

get_sparse_pairwise_deg(
  data = v1_data,
  anno = v1_anno,
  group_by = "final",
  class1_groups = 1:23,
  class2_groups = 24:42,
  data_cut_up = 0,
  data_cut_dn = 0,
  frac_cut_up = 0.95,
  frac_cut_dn = 0.05,
  top = NULL,
  give = "genes"
)

Arguments

data

- a data.frame containing the data to be filtered. First column must be "gene", followed by one column per sample.

anno

- a data.frame with annotations for each sample.

group_by

- a character object with the base of the annotation to be used for selecting groups.

class1_groups

- a numeric object with the ids of the groups to be used as class 1

class2_groups

- a numeric object with the ids of the groups to be used as class 2

data_cut_up

- the minimum value cutoff for the "high" expression group. default: 0

data_cut_dn

- the maximum value cutoff for the "low" expression group. default: 0

frac_cut_up

- the minimum fraction of samples in the "high" expression group above data_cut_up. default: 0.95

frac_cut_dn

- the maximum fraction of samples in the "low" expression group above data_cut_dn. default: 0.05

top

- the number of results to keep from each class. default: NULL (returns all results)

give

- either "table" or "genes".

Value

Depends on the give parameter: if "table", a data.frame with details for each gene. if "genes", a character vector of the genes that pass the filters.