calculate_pathway_gsea {clustifyr} | R Documentation

## Convert expression matrix to GSEA pathway scores (would take a similar place in workflow before average_clusters/binarize)

### Description

Convert expression matrix to GSEA pathway scores (would take a similar place in workflow before average_clusters/binarize)

### Usage

    calculate_pathway_gsea(
      mat,
      pathway_list,
      n_perm = 1000,
      scale = TRUE,
      no_warnings = TRUE
    )

### Arguments

`mat` | expression matrix
`pathway_list` | a list of vectors, each named for a specific pathway, or dataframe
`n_perm` | Number of permutation for fgsea function. Defaults to 1000.
`scale` | convert expr_mat into zscores prior to running GSEA?, default = FALSE
`no_warnings` | suppress warnings from gsea ties

### Value

matrix of GSEA NES values, cell types as row names, pathways as column names

### Examples

    gl <- list(
        "n" = c("PPBP", "LYZ", "S100A9"),
        "a" = c("IGLL5", "GNLY", "FTL")
    )

    pbmc_avg <- average_clusters(
        mat = pbmc_matrix_small,
        metadata = pbmc_meta,
        cluster_col = "classified"
    )

    calculate_pathway_gsea(
        mat = pbmc_avg,
        pathway_list = gl
    )

[Package clustifyr version 1.0.0 Index]