The expression set should be a matrix.
I am interested in analyzing the enrichment of immune cell types in my RNA-seq data (human bulk biopsy samples) by using gene set variation analysis (GVSA). However, I am pretty lost with GSVA and GSEABase packages for R and do not know the structure of files that need to be prepared for GVSA (e.g. the gene set collection object).
I would like to use some pre-defined gene sets that identify immune cells which I retrieved from table S1A here: https://clincancerres.aacrjournals.org/content/suppl/2018/04/17/1078-0432.CCR-17-3509.DC1 to follow the GSVA molecular signature identification guide (4.1 in the GSVA guide here: https://www.bioconductor.org/packages/release/bioc/vignettes/GSVA/inst/doc/GSVA.pdf)
Could you give me a clue on how to prepare this gene set collection???
Thank you so much in advance!!!
2 answers
For GSVA, gene sets can be provided either as a list object or as a GeneSetCollection object. It's easier to use a list. Each component is a gene set. The name is the name of the gene set and the value is a vector of genes. For example:
my_gene_sets <- list(gene_set_1 = c("geneA", "geneB", "geneC"))
Thank you so much, Igor!!! I also found how to import the gene list here: https://stackoverflow.com/questions/6602881/text-file-to-list-in-r
Now I do not know how to solve this other problem when using GSVA...
GSVA_ES <- gsva(ExprSet, GeneSetCol, mx.diff=FALSE, verbose=FALSE, parallel.sz=1)
Error in (function (classes, fdef, mtable): unable to find an inherited method for function ‘gsva’ for signature ‘"data.frame", "list"’
Could it be due to the input files? The expression set is a data frame that contains genes (rows) and samples (columns) in log2 of normalized counts from RNA-seq. I have fixed this file so gene names will be only displayed as row names and not as an additional variable (column 1 for example).
Thank you!!!
Log in to answer this question.