Skip to content

Commit

Permalink
Method creation for ssGSEA
Browse files Browse the repository at this point in the history
  • Loading branch information
Jigyasa-G authored Aug 8, 2023
1 parent c2ea40a commit 6fd974a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions R/ssGSEA.R
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
#Perform ssGSEA Analysis

ssgsea <- function(gene_expression, genes, num_gene_sets, genes_per_set) {
gs <- list()
for (i in 1:num_gene_sets) {
sampled_genes <- sample(genes, genes_per_set, replace = FALSE)
gs[[i]] <- sampled_genes
}
names(gs) <- paste0("gs", 1:length(gs))

ssGSEA_scores <- gsva(gene_expression, gs, method = "ssgsea")
return(ssGSEA_scores)
}

# ssgsea(gene_expression, genes, num_gene_sets, genes_per_set)

0 comments on commit 6fd974a

Please sign in to comment.