assign conditions in DESeq2
0
0
Entering edit mode
9.1 years ago
yjliu1127 • 0

Hi everyone,

I have one question about the command line for assigning conditions in DESeq2. The following are the count table I got. I want to assign WT6A, WT6B and WT6C as controls (3 replicates) and KO6A, KO6B and KO6C (3 replicates) as treated samples. column 1 is the gene name. column2-4 will be controls and column5-7 will be the treated samples.

  • WT6A WT6B WT6C KO6A KO6B KO6C
  • dnaA 6594 7412 3401 9067 7344 3803
  • dnaN 4274 5048 3680 7368 7300 6571

How should I write the command line for this?

Thanks, Yong

RNA-Seq R DESeq2 • 3.9k views
ADD COMMENT
0
Entering edit mode

Do you already have everything in a single file or data.frame? If so, see help(DESeqDataSetFromMatrix).

ADD REPLY
0
Entering edit mode

Thanks Ryan! I'm really bad at coding. I checked the website. I still cannot figure out. My experiment is pretty straight forward. It's two-group comparison between control and treatment. Each group has 3 replicates. This is the code I typed in R:

coldata=data.frame(row.names=c('WT6A', 'WT6B', 'WT6C','KO6A','KO6B','KO6C'),
                   group=rep(c("WT6","KO6"),3,each=3),
                   treatment=rep(c("control","treated"),each=3)).

However, there is an error: Error in data.frame(row.names = c("WT6A", "WT6B", "WT6C", "KO6A", "KO6B", : row names supplied are of the wrong length.

Could you please let me know how to fix this problem?

ADD REPLY
0
Entering edit mode
coldata=data.frame(row.names=c('WT6A', 'WT6B', 'WT6C','KO6A','KO6B','KO6C'),
               treatment=rep(c("control","treated"),each=3))

The "group" part is redundant and was producing a vector of length 18 (rather than 6) anyway, due to having an extra 3 in there.

ADD REPLY
0
Entering edit mode

Thanks! I have another mistake in the code.

> library("DESeq2")
> countMatrix <- read.table ("file.txt", header=TRUE, row.names=1)
> coldata=data.frame(row.names=c('WT6A', 'WT6B', 'WT6C','KO6A','KO6B','KO6C'),treatment=rep(c("control","treated"),each=3))
> coldata
     treatment
WT6A   control
WT6B   control
WT6C   control
KO6A   treated
KO6B   treated
KO6C   treated
> dds=DESeqDataSetFromMatrix(countData=countMatrix,colData=coldata,design=~treatment)
**Error** in DESeqDataSet(se, design = design, ignoreRank) : 
  some values in assay are not integers.

How can I fix this? and How can I set the control group as the basal level if I want to compare treated samples with control samples? Is the following code right?

> coldata$treatment<-relevel(coldata$treatment,ref='control')

Thanks a lot!

ADD REPLY
0
Entering edit mode

The control group is already the base level, "control" is lexicographically before "treated".

The error is due to there being non-integer values in countMatrix. Figure out what that is and fix it.

ADD REPLY
0
Entering edit mode

Thank you very much! Yong

ADD REPLY

Login before adding your answer.

Traffic: 2989 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