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.
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.
Thanks Marco. I will take a look this function.
For sure, thanks for the tips.
The mean value of the raw counts?
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.
Sure no worries :). Using the following function:
you can extract the normalized counts and calculate the mean ( with
colMeans
) for each sample.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.