Skip to contents

# Convert a condor object to se object

Source: `R/differential_testing.R`
`prepInputDiffcyt.Rd`

`prepInputDiffcyt()` converts a fcd object into a SummarizedExperiment object compatible with `diffcyt` functions `calcCounts` and `calcMedians`.

## Usage

    prepInputDiffcyt(
      fcd,
      cluster_slot,
      cluster_var,
      sample_var,
      meta_vars,
      marker_state = NULL,
      marker_type = NULL
    )

## Arguments

fcd

  flow cytometry dataset, that has been subjected to clustering or cell type label prediction with cyCONDOR before

cluster_slot

  string specifying which clustering slot to use to find variable specified in cluster_var

cluster_var

  string specifying variable in cluster_slot that identifies cell population labels to be used (e.g. clusters, metaclusters or predicted labels)

sample_var

  Charlotte

meta_vars

  vector of variables in cell_anno, which contain sample level metadata, which means that each sample ID is associated with exactly one level per variable. All variables that the user wants to use in the test design need to be listed, e.g. group, donor_id. Variables with names "sample_id" and "cluster_id" are not allowed, since these names have designated purposes in diffcyt workflow.

marker_state

  vector of marker names that should get the marker_class "state". If no markers are provided in marker_state and marker_type all available markers and features in expr data will be set as "type".

marker_type

  vector of marker names available in expr data, that should get the marker_class "type". If no markers are provided in marker_state and marker_type all available markers and features in expr data will get the marker_class "type".

## Value

A SummarizedExperiment object suitable to be used as input for `diffcyt` functions `calcCounts` and `calcMedians`. The object contains the following components:

- metadata "experiment_info" : sample-level metadata table, containing all variables provided in meta_vars and sample_var, whereby sample_var is renamed to "sample_id"

- metadata "n_cells" : number of cells per sample_id

- assay "exprs" : contains expression data

- rowData : cell-level information, containing all variables provided in meta_vars, sample_var and cluster_var, whereby sample_var is renamed to "sample_id" and cluster_var tp "cluster_id" to be compatible with diffcyt workflow.

- colData : marker information required for diffcyt differential state analysis.

## Details

prepInputDiffcyt

The function will carry over the original transformed expression. The flexible experimental design of diffcyt's testing functions allows to include batch variables.