Hello,
I am getting an error when I try to do MA-Plot function in DESeq2. My data input is a simple file of the following headers, "GeneName", "Treat1Rep1_RawCounts", Treat1Rep2_RawCounts"....."Treat4Rep2_RawCounts", "Treat4Rep3_RawCounts". I have 4 conditions, 3 reps each, so 12 different raw counts for each gene ID.
I can import the data in fine and get to the results of the DESeq function. Here is my script below:
> countsTable<-read.delim("merged_raw_counts.txt",header=T)
> rownames(countsTable)<-countsTable$Name
> countsTable<-countsTable[,-1]
> head(countsTable)
T0R1 T0R2 T0R3 T0S1 T0S2 T0S3 T1R1 T1R2 T1R3 T1S1 T1S2 T1S3
gene01g00010 0 5 2 3 4 6 4 1 0 7 1 1
gene01g00020 1 0 12 0 6 2 3 3 1 2 0 0
gene01g00030 0 0 0 0 0 0 0 0 0 1 0 0
gene01g00040 0 0 0 0 0 0 0 0 0 0 0 0
gene01g00050 0 0 0 1 0 0 0 0 0 0 0 0
gene01g00060 13 99 77 109 76 82 82 140 115 157 72 118
>countData<-matrix(countsTable)
>colData<-data.frame(condition=factor(c("T0R","T0R","T0R","T0S","T0S","T0S","T1R","T1R","T1R","T1S","T1S","T1S")))
>dds<-DESeqDataSetFromMatrix(countData=countsTable,colData,formula(~condition))
Usage note: the following factors have 3 or more levels:
condition
For DESeq2 versions < 1.3, if you plan on extracting results for
these factors, we recommend using betaPrior=FALSE as an argument
when calling DESeq().
As currently implemented in version 1.2, the log2 fold changes can
vary if the base level is changed, when extracting results for a
factor with 3 or more levels. A solution will be implemented in
version 1.3 which allows for the use of a beta prior and symmetric
log2 fold change estimates regardless of the selection of base level.
>colData(dds)$condition<-factor(colData(dds)$condition,levels=c("T0R","T0S","T1R","T1S"))
> dds
class: DESeqDataSet
dim: 34903 12
exptData(0):
assays(1): counts
rownames(34903): gene01g00010 gene01g00020 ... gene00g99390 gene00g99400
rowData metadata column names(0):
colnames(12): 1 2 ... 11 12
colData names(1): condition
> dds<-DESeq(dds)
> res<-results(dds)
> res<-res[order(res$padj),]
> head(res)
DataFrame with 6 rows and 6 columns
baseMean log2FoldChange lfcSE stat pvalue padj
<numeric> <numeric> <numeric> <numeric> <numeric> <numeric>
gene00g04520 13076.372 5.050936 0.17241390 29.29541 1.186570e-188 3.046400e-184
gene03g01180 9750.315 3.897496 0.13548892 28.76616 5.687327e-182 7.300822e-178
gene00g09910 4133.619 2.299451 0.08051913 28.55783 2.245862e-179 1.869130e-175
gene00g48700 1329.461 -2.640605 0.09249464 -28.54874 2.912098e-179 1.869130e-175
gene04g12160 12921.588 3.599922 0.12872185 27.96667 4.133827e-172 2.122638e-168
gene00g46890 25040.714 4.235810 0.15466115 27.38768 3.845523e-165 1.645499e-161
Up to this point I don't have any problems. However when I do:
> plotMA(dds,ylim=c(-2,2),main="DESeq2")
I get:
Error in plotMA(dds, ylim = c(-2, 2), main = "DESeq2") :
'x' must be a data frame with columns named 'baseMean', 'log2FoldChange'.
My apologies if I posted too much background info. I'd figured my error is in something I did in early steps.
Thanks for any help on this.
-Will
I am getting an error when I try to do MA-Plot function in DESeq2. My data input is a simple file of the following headers, "GeneName", "Treat1Rep1_RawCounts", Treat1Rep2_RawCounts"....."Treat4Rep2_RawCounts", "Treat4Rep3_RawCounts". I have 4 conditions, 3 reps each, so 12 different raw counts for each gene ID.
I can import the data in fine and get to the results of the DESeq function. Here is my script below:
> countsTable<-read.delim("merged_raw_counts.txt",header=T)
> rownames(countsTable)<-countsTable$Name
> countsTable<-countsTable[,-1]
> head(countsTable)
T0R1 T0R2 T0R3 T0S1 T0S2 T0S3 T1R1 T1R2 T1R3 T1S1 T1S2 T1S3
gene01g00010 0 5 2 3 4 6 4 1 0 7 1 1
gene01g00020 1 0 12 0 6 2 3 3 1 2 0 0
gene01g00030 0 0 0 0 0 0 0 0 0 1 0 0
gene01g00040 0 0 0 0 0 0 0 0 0 0 0 0
gene01g00050 0 0 0 1 0 0 0 0 0 0 0 0
gene01g00060 13 99 77 109 76 82 82 140 115 157 72 118
>countData<-matrix(countsTable)
>colData<-data.frame(condition=factor(c("T0R","T0R","T0R","T0S","T0S","T0S","T1R","T1R","T1R","T1S","T1S","T1S")))
>dds<-DESeqDataSetFromMatrix(countData=countsTable,colData,formula(~condition))
Usage note: the following factors have 3 or more levels:
condition
For DESeq2 versions < 1.3, if you plan on extracting results for
these factors, we recommend using betaPrior=FALSE as an argument
when calling DESeq().
As currently implemented in version 1.2, the log2 fold changes can
vary if the base level is changed, when extracting results for a
factor with 3 or more levels. A solution will be implemented in
version 1.3 which allows for the use of a beta prior and symmetric
log2 fold change estimates regardless of the selection of base level.
>colData(dds)$condition<-factor(colData(dds)$condition,levels=c("T0R","T0S","T1R","T1S"))
> dds
class: DESeqDataSet
dim: 34903 12
exptData(0):
assays(1): counts
rownames(34903): gene01g00010 gene01g00020 ... gene00g99390 gene00g99400
rowData metadata column names(0):
colnames(12): 1 2 ... 11 12
colData names(1): condition
> dds<-DESeq(dds)
> res<-results(dds)
> res<-res[order(res$padj),]
> head(res)
DataFrame with 6 rows and 6 columns
baseMean log2FoldChange lfcSE stat pvalue padj
<numeric> <numeric> <numeric> <numeric> <numeric> <numeric>
gene00g04520 13076.372 5.050936 0.17241390 29.29541 1.186570e-188 3.046400e-184
gene03g01180 9750.315 3.897496 0.13548892 28.76616 5.687327e-182 7.300822e-178
gene00g09910 4133.619 2.299451 0.08051913 28.55783 2.245862e-179 1.869130e-175
gene00g48700 1329.461 -2.640605 0.09249464 -28.54874 2.912098e-179 1.869130e-175
gene04g12160 12921.588 3.599922 0.12872185 27.96667 4.133827e-172 2.122638e-168
gene00g46890 25040.714 4.235810 0.15466115 27.38768 3.845523e-165 1.645499e-161
Up to this point I don't have any problems. However when I do:
> plotMA(dds,ylim=c(-2,2),main="DESeq2")
I get:
Error in plotMA(dds, ylim = c(-2, 2), main = "DESeq2") :
'x' must be a data frame with columns named 'baseMean', 'log2FoldChange'.
My apologies if I posted too much background info. I'd figured my error is in something I did in early steps.
Thanks for any help on this.
-Will
Comment