This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Is it normal and ok to observe symmetric PCA & heatmap when correcting paired samples for the patient ID?

Hi,

I have some questions about performing DE on paired samples.

I'm analysing a data set that has 28 'paired' samples coming from 7 patients, treated in 4 different ways:

  • patientID: 7 patients A-G
  • context: CTL or KO_siRNA
  • treatment: untreated or treated

The sampleplan also has an extra column SampleGroup which combines the context and treatment columns. The 3 questions are basically the same for different methods/visualization: should we add the patientID column to the model / correct for patientID? the answer is probably yes for all 3 but I'm concerned with the symmetry observed in the plots. Can someone confirm this is correct?

On the PCA:

  • clear difference based on treatment, but not based on context
  • paired samples group together within treatment
  • question1: should we correct for the patientID column?

However, the PCA becomes weirdly symmetrical, but I think this is because of the paired samples. Is this normal/ok?

removeBatchEffect(vst, batch = vst[[patientID]], design = model.matrix(~SampleGroup, data = coldata))

PCA without (left) and with batch effect correction for patientID (right)

enter image description here enter image description here

When performing DE and visualizing the DEGs with a heatmap:

  • comparison: untreated_KO_siRNA vs untreated_CTL (blue vs orange in PCA)
  • question 2: should we add patientID as a covariate in the DE model? according to the DESeq2 manual: yes
dds <- DESeqDataSetFromMatrix(countData = raw_filtered,
                              coldata,
                              design =  ~ 0 + patientID + SampleGroup)

dds <- DESeq(dds)
  • questions 3: should we correct for patientID for visualizing the DEGs? there is symmetry again when correcting for patientID -> is this ok?
removeBatchEffect(vst, batch = vst[[patientID]], design = model.matrix(~SampleGroup, data = coldata))

heatmap on uncorrected data enter image description here

heatmap on corrected data enter image description here

I also tried by first subsetting the data to only include the untreated samples and perform the same DE. However, the symmetry is even more visible and the DESeq2 guidelines recommend to not remove samples (unless one or more groups have a much higher within-group variability than the others). In this case, there n = 2 for each group in patientID. Question 4: is there any caution to be taken when the covariate has only two items per value?

Thanks a lot!

Marieke

differential-expression-analysis paired-deseq2

2 answers

question1: should we correct for the patientID column?

Almost certainly yes. I assume PC2 is the patient effect. You have 7 patients and it seems the 7 points per color and shape stratify along PC2. Meaning, the treatment effect is the strongest (PC1) followed by the (unwanted) patient effect. Why unwanted: because you don't care about the per-patient variation but your treatment and conditions.

question 2: should we add patientID as a covariate in the DE model? according to the DESeq2 manual: yes

Yes, absolutely. That makes the analysis a lot more powerful as it is a paired analysis for your desired effect within patient, so the between-patient noise doesn't interfere.

questions 3: should we correct for patientID for visualizing the DEGs? there is symmetry again when correcting for patientID -> is this ok?

Yes, absolutely ok as it is consistent with the DE analysis.

In both cases, a symetric PCA and heatmap is exactly what you would expect if your experimental variables where the main sources of variation in your experiment.

For the heatmaps, its more or less impossible for a heatmap of DEGs in a simple condition A vs condition B to look any other way than the heatmap you have.

Log in to answer this question.