I'm performing differential gene expression analysis on my bacterial RNA samples and I'm having some troubles exporting the results. I'm using DESeq2 version 1.30.0 and R 4.0.3.
I've generated my results following the vignette's workflow. Briefly put, this is my last chunk of code:
> dds <- DESeq(dds) > res <- results(dds, alpha = 0.05, lfcThreshold = 1) > summary(res) out of 5546 with nonzero total read count adjusted p-value < 0.05 LFC > 1.00 (up) : 29, 0.52% LFC < -1.00 (down) : 7, 0.13% outliers  : 0, 0% low counts  : 2258, 41% (mean count < 38)  see 'cooksCutoff' argument of ?results  see 'independentFiltering' argument of ?results
So with the filters I've set (padj < 0.05 and lfcThreshold = 1) 36 genes in total are differentially expressed. I want to export in a CSV file the results data frame of only these 36 DE genes, but after running:
> resFilt <- res[which(res$padj < 0.05 & abs(res$log2FoldChange) > 1), ] > write.csv(resFilt, file="DE_results_filtered.csv")
the resulting csv has 202 rows. Is this because creating a subset of the results doesn't account for the independent filtering? How can I export the results of only those 36 DE genes?
Thank you in advance!