Hello, 
I am new to bioinformatics, and I am trying to do DEG analysis using DESeq2. 
I followed the DESeq2 vignette, and I did this

 `res <- results(dds, lfcThreshold = log2(2), alpha = 0.05)`

    summary(res)

    out of 17813 with nonzero total read count.                                                                                                                      
                            adjusted p-value < 0.05
    LFC > 1.00 (up)    : 78, 0.44%
    LFC < -1.00 (down) : 106, 0.6%
    outliers [1]       : 0, 0%
    low counts [2]     : 2073, 12%
    (mean count < 7)
    [1] see 'cooksCutoff' argument of ?results
    [2] see 'independentFiltering' argument of ?results

So, my question is, how do I get my up-regulated and down-regulated genes from this output? I am setting my log2fc=1 for the cutoff threshold.
I also read [this ][1] thread, but I still could not find the answer I am looking for. 
Thank you very much.


  [1]: https://support.bioconductor.org/p/110866/
You can convert the `res` object to a dataframe by simply calling `res_df <- as.data.frame(res)`. Then apply filtering like these two functions do:

    get_upregulated <- function(df){
    
    	key <- intersect(rownames(df)[which(df$log2FoldChange>=1)], rownames(df)[which(df$pvalue<=0.05)])
      
      	results <- as.data.frame((df)[which(rownames(df) %in% key),])
    	return(results)
    }
    
    get_downregulated <- function(df){
    
      	key <- intersect(rownames(df)[which(df$log2FoldChange<=-1)], rownames(df)[which(df$pvalue<=0.05)])
      
      	results <- as.data.frame((df)[which(rownames(df) %in% key),])
      	return(results)
    }

`up <- get_upregulated(res_df)` 
`down <- get_downregulated(res_df)`