Thank you so much Kevin. It worked well. :)
Hi all,
I am using DESeq2 for DE analysis and I want to normalize my read counts on the basis of two calibrator set (their counts) that were used. I am using estimateSizeFactors to give the read counts of calibrators as "controlGenes" so that I can run DESeq2 but when I execute my codes (which are as follows-)
calidata<-read.csv("/Users/pg2597/Desktop/combined/caliisocounts_xyz.csv", header=TRUE, row.names = 1)
mat_data <- data.matrix(calidata)
calibrators <- grepl('cali', rownames(mat_data))
cal <- calibrators
dds_norm <- estimateSizeFactors(mat_data,controlGenes=cal)
I get following error:
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘estimateSizeFactors’ for signature ‘"matrix"’
Can someone help me with this?
Thanks in advance!
1 answer
The estimateSizeFactors() function expects a DESeq data object, not a data matrix.
You should do this:
calidata<-read.csv("/Users/pg2597/Desktop/combined/caliisocounts_xyz.csv", header=TRUE, row.names = 1)
mat_data <- data.matrix(calidata)
calibrators <- grepl('cali', rownames(mat_data))
cal <- calibrators
dds <- DESeqDataSetFromMatrix(countData = countData, colData = colData, design = ~ condition)
dds_norm <- estimateSizeFactors(dds, controlGenes=cal)
For further information on this, including what the contents of colData should be and how to set the design parameter, see Quick start and Count matrix input.
Note that people usually use the wrapper function, DESeq(dds), which will do the entire normalisation process for you, including calling estimateSizeFactors(). Your normalised counts could then be accessed with:
counts(dds, normalized=TRUE)
In this case, you are aiming to use control genes though.
Kevin
Log in to answer this question.

Please use the formatting bar (especially the

codeoption) to present your post better. I've done it for you this time.Thank you!
Point noted ! Sorry for this time. Thanks
No problem. Formatting
codemakes it easy to read.