2
$\begingroup$

I think I have a fairly easy-to-solve problem.

I have an expression table generated from an Affy set. It has one row of gene names (already symbols) and then 180 sample rows. 181 rows total.

So I made another excel file with one row with three different phenotypes I want to compare. That row has a label ("classes") and 180 names. 181 rows total.

In R, I can import each of these

dat <- read.csv("expression.csv")
dat <- data.matrix(dat)
pheno <- read.csv("pheno.csv")
pheno <- data.matrix(pheno)

I can then fit them

fit <- lmFit(dat,pheno)

And ask for an eBayes from limma

fit <- eBayes(fit)

Now, when I view the topTable,

table <- topTable(fit)

My first column has numbers (like "834","1142"), when I'd expect to have gene names there (like "ACTR", "CHRNA1").

What am I doing wrong? Or, rather, am I doing anything right?

Thanks!

$\endgroup$
1
  • $\begingroup$ What are your rownames of pheno? BTW are you sure that pheno has only the phenodata relevant for your differential expression analysis? Which is your model? $\endgroup$
    – llrs
    Nov 3, 2017 at 11:22

1 Answer 1

1
$\begingroup$

What do the first few lines of your lmFit input variables look like (i.e. dat and pheno)? Are the rows numbered, or do they use the actual symbols?

By default, I don't think read.csv expects a file to have row numbers (even though write.csv puts them in by default). Try adding a row.names parameter to the expression matrix read call:

dat <- read.csv("expression.csv", row.names=1)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.