Problem to execute a rowttest.
1
0
Entering edit mode
@953c4872
Last seen 3 months ago
Mexico

Hi. I want to use the genefilter library to perform simple t-tests for each gene comparing across leukemia and normal samples. And I need the pvalues, so here is the code I have used to prepare the rowttest:


library(leukemiasEset)
library(preprocessCore)
library(genefilter)
library(qvalue)
library(org.Hs.eg.db)
data(leukemiasEset)
table(leukemiasEset$LeukemiaType)
##quantile normalization on the expression data
lenorm = normalize.quantiles(exprs(leukemiasEset))    # quantile normalization
rownames(lenorm) = rownames(exprs(leukemiasEset))    # add row names
colnames(lenorm) = colnames(exprs(leukemiasEset))    # add column names
exprs(leukemiasEset) = lenorm    # overwrite initial exprs
boxplot(exprs(leukemiasEset))
##Subset the leukemiasEset data to include only samples from chronic myeloid leukemia, CML ("CML"), and normal samples ("NoL") into a new ExpressionSet, cml_normal
cml_normal = leukemiasEset[, leukemiasEset$LeukemiaType %in% c("CML", "NoL")]
cml_normal$LeukemiaType = factor(cml_normal$LeukemiaType)
##set the reference level to be our normal samples:
cml_normal$LeukemiaType = relevel(cml_normal$LeukemiaType, "NoL")
factor(cml_normal$LeukemiaType)
##This code maps the ENSEMBL IDs to gene symbols and ENTREZ IDs and adds them to the feature data
library(org.Hs.eg.db)
symbols = mapIds(org.Hs.eg.db, rownames(cml_normal), keytype = "ENSEMBL", column="SYMBOL")
ids = mapIds(org.Hs.eg.db, rownames(cml_normal), keytype = "ENSEMBL", column="ENTREZID")
fData(cml_normal)$symbol = symbols
fData(cml_normal)$gene_id = ids
fData(cml_normal)

Now, I know a rowttests would look like this: rtt=rowttests(exprs(leukemiasEset), factor(cml_normal$LeukemiaType) ). However, I get the following error: Error in rowcoltt(x, fac, tstatOnly, 1L, na.rm) : length(fac)=24, ncol(x)=60, should be the same.

I don't know what could be wrong and how to correct that factor as to obtain the test. Any help would be welcome

rowttests • 143 views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 8 minutes ago
United States

The error points to the problem. The length of your factor is only 24, yet your leukemiaEset has 60 columns.

Login before adding your answer.

Traffic: 527 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6