View Single Post
Old 07-15-2014, 11:55 PM   #1
KYR
Member
 
Location: Toronto

Join Date: May 2012
Posts: 18
Exclamation DESeq2 error in data.frame (multiple treatments and multiple replicates)

I have a text file, containing read counts per gene for each treatments and control, with the following column

[Gene Symbol] [C1] [C2] [C3] [A1] [A2] [A3] [B1] [B2] [B3]
  • C is Control
  • A is Treatment 1
  • B is Treatment 2
-> Each of C, A an B have 3 replicates

When I do data.frame it generates an error

Code:
library( "DESeq2" )
library("Biobase")
mydata = read.table("matrix.txt", header=TRUE)
col1 <- mydata[,1]

## Error message
ExpDesign = data.frame(row.names=col1, condition=c("C", "C", "C", "A", "A", "A", "B", "B", "B")
Error in data.frame(row.names = col1, condition = c("C", "C", "C", "A",  : 
  row names supplied are of the wrong length
## The following is what I would next if I didn't have any error message
Code:
countdata <- assay( mydata )
head( countdata )
coldata <- colData( mydata )
rownames( coldata ) <- coldata$run
colnames( countdata ) <- coldata$run
head( coldata[ , c("C", "C", "C", "A", "A", "A", "B", "B", "B") ] )
Eventually the goal is to have a heatmap with each replicates in the control, treatment A and B.

I think the problem comes from the fact that I should subset my data, though I have no clue how to do to that. Any suggestions on where is the error message coming from and how to subset data? (If I should ever subset that..)

Last edited by KYR; 07-15-2014 at 11:57 PM. Reason: typo
KYR is offline   Reply With Quote