Entering edit mode
4.8 years ago
ivykosater
•
0
I have a matrix of gene expression data for multiple samples from TCGA which I converted into a matrix from a GCT file.
# Convert to R dataype
expr <- read.csv("BRCA_dataset2.gct", sep = "\t", header=FALSE)
# Clean up the data
expr <- expr[-2,]
expr <- expr[-1,]
expr <- janitor::row_to_names(expr, row_number = 1)
Next, I read in a list of genes for my gene set by doing the following
anti.apop <- read.delim(file.path("anti-apop singh.txt"))[, 1]
#Convert to list object
anti <- as.list(anti.apop)
Now when I try to run gsva, I am met with the following error
> gsva.out <- gsva(expr, anti)
Error in .local(expr, gset.idx.list, ...) :
Less than two genes in the input expression data matrix
In addition: There were 50 or more warnings (use warnings() to see the first 50)
Why does it say there are less than two genes in the expression data matrix? I went through and searched for the genes in the gene list in the expression matrix and they are all there. Why isn't GSVA recognizing it?
Is there a reason you're using
read.csvwith tab separated content instead of usingread.table? Also, please show us the first few rows ofexpr.No particular reason. Here are the first few rows and columns of expr
In that case, I'd recommend using
read.table. Code is already difficult to remember and comprehend, and choices such as these will add to the confusion.What does
anti.apoplook like? What isdim(expr)once you're done cleaning upexpr?