normalize count data from htseq
2
0
Entering edit mode
Peter • 0
@peter-6856
Last seen 4.5 years ago
China

Dear expert,


I have got count data with htseq-count. In my study, there is no groups. Only one group, I do not want do deferential analsyis.
How can I normalize my count data?
I use code as follow, but get error.

workdir <- "~/projects/all/analysis/rnaseq/deseq2/results"
setwd(workdir)
library('DESeq2')
dat.dir<-"~/projects/all/analysis/rnaseq/count/gene/"
countFiles <- list.files(dat.dir,pattern =".txt")
library(stringr)
sampleName <- str_replace(countFiles, ".txt", "")
sampleCondition <- rep("all",length(sampleName))
sampleTable<-data.frame(sampleName=sampleName, fileName=countFiles,condition=sampleCondition)
ddsHTSeq<-DESeqDataSetFromHTSeqCount(sampleTable=sampleTable, directory=dat.dir, design=~condition)

Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) :
  contrasts can be applied only to factors with 2 or more levels

deseq2 normalization • 4.6k views
ADD COMMENT
1
Entering edit mode
@mikelove
Last seen 13 hours ago
United States

See the function estimateSizeFactorsForMatrix. This will estimate a vector of size factors, normalization is then just dividing each column by its respective size factor, see R's function sweep() for example.

You can also use a design of ~1, meaning there are no factors dividing the samples (I should have the function print this as a nicer message).

ADD COMMENT
0
Entering edit mode
Peter • 0
@peter-6856
Last seen 4.5 years ago
China

Thank you for your reply.

ADD COMMENT

Login before adding your answer.

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