Hi thanks for the information! I believe I have made good progress using your help. I have the results from my run using that code, but I'd still like to add which values correspond to which sample. So basically, what would be the best method to add another column that categorizes which sample goes with which value? Also I'm not sure why its comparing OE3 with Control1 as the default? Any suggestions figuring this out I would really appreciate! Thank you!
> (resOrdered <- res[order(res$padj), ])
log2 fold change (MLE): group OE3 vs Control1
Wald test p-value: group OE3 vs Control1
DataFrame with 229551 rows and 6 columns
baseMean log2FoldChange lfcSE stat pvalue padj
<numeric> <numeric> <numeric> <numeric> <numeric> <numeric>
ENST00000462898 801.1637 -13.050030 3.351083 -3.894273 9.849388e-05 0.09158196
ENST00000397492 1374.4390 8.500578 2.211868 3.843166 1.214570e-04 0.09158196
ENST00000482918 655.4429 -12.720482 3.310872 -3.842033 1.220194e-04 0.09158196
MSTRG.2890.8 691.0694 -12.466736 3.322664 -3.752030 1.754083e-04 0.09158196
ENST00000543146 877.2129 -12.163227 3.207941 -3.791599 1.496802e-04 0.09158196
#create deseq DataSet from count matrix and labels
dds <- DESeqDataSetFromMatrix(countData = countData, colData = colData, design = ~ type)
#----- Comparisons #Run the default analysis for DESeq2 and generate results table
dds$group <- factor(paste0(dds$type))
design(dds) <- ~ group
dds <- DESeq(dds)
resultsNames(dds)
#______
#dds <- DESeq(dds)
res <- results(dds)
#Sort by adjusted p-value and display
(resOrdered <- res[order(res$padj), ])
write.table(resOrdered, file = "genes.txt", sep ="\t")