This is a test version of Biostars. For the public version, visit https://www.biostars.org.
GSVA analysis in R: How to use my geneset and expression data matrix in GSVA.

Hello All,

I am looking GSVA tool for my data sets, but I have some problem in reading expression data and geneset (.gmt) file in GSVA.

I used following tutorial command and worked:

library(GSVA)
library(GSEABase)
library(GSVAdata)
ata(c2BroadSets)
data(leukemia)

filtered_eset <- nsFilter(leukemia_eset, require.entrez=TRUE, remove.dupEntrez=TRUE, var.func=IQR, var.filter=TRUE, var.cutoff=0.5, filterByQuantile=TRUE, feature.exclude="^AFFX")
leukemia_filtered_eset <- filtered_eset$eset
leukemia_es <- gsva(leukemia_filtered_eset, c2BroadSets, min.sz=10, max.sz=500, verbose=FALSE, parallel.sz=1)$es.obs

but when I used my data:

genesets="new_pathways.gmt"
genesets <- GSA.read.gmt(genesets)

I tried:

leukemia_es <- gsva(leukemia_filtered_eset, genesets, min.sz=10, max.sz=500, verbose=FALSE, parallel.sz=1)$es.obs

Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘gsva’ for signature ‘"ExpressionSet", "GSA.genesets"’

mydata <- read.delim("gene_matrix.txt",Header=T, row.names=1)
mydata= as.matrix(mydata)

so how to read .GMT file and expression data for GSVA.

Thanks in advance..

gene rna-seq

To create your own geneset, make a gmt text file (or add to the bottom of an existing gmt file) a row with the following format:

MY_GENE_SET_NAME na MYGENE1 MYGENE2 MYGENE3 ETC

There should be a tab between each element in the above and a newline at the end. The "na" represents a url giving details about the geneset for other users of the geneset. GSVA doesn't look at it so "na" works just fine.

diff <- gsva(data3, geneSets, annotation, method = "gsva", min.sz=1, max.sz=Inf, parallel.sz=0,mx.diff=TRUE, verbose=TRUE) Mapping identifiers between gene sets and feature names Error in as.vector(x, "character") : cannot coerce type 'closure' to vector of type 'character' geneSets <- getGmt("c7.all.v6.2.symbols.gmt")

I have use the data3(expression matrix) and geneSets(gmt file) to do the gsva , while get above error, what should i do ? Great thanks for the help!

1 answer

The problem is solved.....

just using getGMT function.

geneSets <- getGmt("new_pathways.gmt")

Log in to answer this question.