This is a test version of Biostars. For the public version, visit https://www.biostars.org.
DESeq2: before differential analysis

I was doing RNA seq data process, and I would like to normalize the raw count and +0.1 to avoid the zero log2 fold change. But if I +1 to normalize counts data, it becomes a matric and how can I continue the pipeline.

library(DESeq2)
L3Ddata = FG_20141202_TF_20160315_aspFumA1163_RNA_seq[,13:18]
L3Ddata<-as.data.frame(L3Ddata)
colnames(L3Ddata)=test$samplename# rows - genes, columns - samples
L3Dcolname=test[,2:4]
rownames(L3Dcolname)=test$samplename##adapt the name 

L3D_dds = DESeqDataSetFromMatrix(L3Ddata,colData = L3Dcolname, design=~condition)
all(rownames(L3Dcolname)%in%colnames(L3Ddata))##test if the colname of count data equals to rowname of description
L3D_dds<-counts(L3D_dds,normalize=TRUE)
L3D_dds=L3D_dds+0.1  #here it becomes a matrix
#normalize counts +0.1 to avid zero counts
L3D_dds<- DESeq(L3D_dds)# takes quite some time
rna-seq r

1 answer

There is absolutely no reason to add a pseudocount to your actual counts. A log2 fold change of 0 occurs when there's no change and has nothing to do with there being 0s in the data. If you're worried about extreme fold-changes due to having zeros, then that's what the lfcShrink() command is for.

Log in to answer this question.