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]
-> Each of C, A an B have 3 replicates
When I do data.frame it generates an error
## The following is what I would next if I didn't have any error message
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..)
[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
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") ] )
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..)
Comment