DESeq2 calculate mean for each genotype
0
0
Entering edit mode
2.1 years ago
liyong ▴ 80

Hello all,

I have a rather silly question.

I am using DESeq2 to analyze raw counts data from RNAseq data (totally 150 samples; 50 genotypes; 3 replicates for each genotype).

I create the DESeqDataSet object in R through
dds = DESeqDataSetFromMatrix(countData = counts_m, colData = samples_info, design = ~1)

In the samples_info file, I have information of which sample belongs to which genotype.

Now I want to calculate a mean value of all 3 replicates for each genotype, how could I do that? Does DESeq2 have a function to do this easily? I have googled around, but didn't find the answer.

Thanks a lot.

mean DESeq2 • 1.2k views
ADD COMMENT
1
Entering edit mode

Most likely you are looking for something which can be obtained with the function collapseReplicates in DESeq2.

However, before eventually collapsing technical replicates of the same sample group, perform some exploratory analysis (as PCA) to assess variation among the replicates.

ADD REPLY
0
Entering edit mode

Thanks Marco. I will take a look this function.

For sure, thanks for the tips.

ADD REPLY
0
Entering edit mode

The mean value of the raw counts?

ADD REPLY
0
Entering edit mode

Thanks for the comment. Actually, it's the mean of normalized reads. I thought they are the same way to get. Sorry about the confusion.

ADD REPLY
0
Entering edit mode

Sure no worries :). Using the following function:

colMeans(counts(dds, normalized=T))

you can extract the normalized counts and calculate the mean ( with colMeans) for each sample.

ADD REPLY
0
Entering edit mode

Thank you Iraun. This one seems not what I am looking for. I end up outputing the DESeqDataSet object to pandas in python. Use pandas' groupby to calculate the mean for each genotype.

ADD REPLY

Login before adding your answer.

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