Hello,
I have samples from 20+ patients from disease and normal tissues and would like to analyse the data normal vs disease with patient as a random effect. I have 2 questions:
- Am I doing it correctly- below is my code
- Due to poor QC some samples were removed, can I use incomplete pairs?
Here is my coldata (few rows)
Group Patient Age Sex Smoking Normal 1 57 Male Current Disease 1 57 Male Current Normal 2 64 Female Current Disease 2 64 Female Current Normal 3 65 Female Current Disease 3 65 Female Current
disease vs control
ddsMat <- DESeqDataSetFromMatrix(countData = count_matrix,
colData = coldata,
design = ~ Group)
dds <- DESeq(ddsMat)
adjusted for smoking
ddsMat <- DESeqDataSetFromMatrix(countData = count_matrix,
colData = coldata,
design = ~ Group+Smoking)
dds <- DESeq(ddsMat)
resultsNames(dds)
[1] "Intercept" "Group_Normal_vs_Disease"
[3] "Smoking_Former_vs_Current"
res <- results(dds, name="Group_Normal_vs_Disease")
disease vs normal - patient as a random effect
ddsMat <- DESeqDataSetFromMatrix(countData = count_matrix,
colData = coldata,
design = ~ Patient + Group)
dds <- DESeq(ddsMat)
resultsNames(dds)
[1] "Intercept" "Patient_10_vs_1" "Patient_11_vs_1" .....
"Group_Normal_vs_Disease"
res <- results(dds, name="Group_Normal_vs_Disease")#are these adjusted for patients ?