``` r
padj.cutoff <- 0.05
lfc.cutoff <- 0.58

# Convert results table into tibble
res_table_L.9.0_norm_tb <- res_table_L.9.0_norm %>%
  data.frame() %>%
  rownames_to_column(var="gene") %>%
  as_tibble()

# subset that table to only keep the significant genes using our pre-defined thresholds:
sig_L.9.0_norm_noLFCcutoff <- res_table_L.9.0_norm_tb %>%
  filter(padj < padj.cutoff)

sig_L.9.0_norm <- sig_L.9.0_norm_noLFCcutoff %>% 
  filter(abs(log2FoldChange) > lfc.cutoff)

head(sig_L.9.0_norm_noLFCcutoff)
```

```
# A tibble: 6 × 7
  gene           baseMean log2FoldChange lfcSE   stat   pvalue     padj
  <chr>             <dbl>          <dbl> <dbl>  <dbl>    <dbl>    <dbl>
1 XM_060040253.1   3123.          -0.726 0.178  -4.08 4.41e- 5 3.60e- 4
2 XM_060066729.1    702.           1.00  0.223   4.50 6.79e- 6 6.78e- 5
3 XM_060067663.1    306.          -0.386 0.140  -2.75 5.94e- 3 2.49e- 2
4 XM_060068449.1    174.          -1.70  0.123 -13.8  2.94e-43 1.68e-40
5 XM_060038440.1    289.          -1.42  0.136 -10.4  3.03e-25 3.98e-23
6 XM_060041661.1     23.6         -1.14  0.419  -2.84 4.55e- 3 2.00e- 2
```

``` r
paste("Number of significant DEGs for 9C v 0C:", nrow(sig_L.9.0_norm_noLFCcutoff), "(padj<", padj.cutoff, ")")
```

```
[1] "Number of significant DEGs for 9C v 0C: 5980 (padj< 0.05 )"
```

``` r
head(sig_L.9.0_norm)
```

```
# A tibble: 6 × 7
  gene           baseMean log2FoldChange lfcSE   stat   pvalue     padj
  <chr>             <dbl>          <dbl> <dbl>  <dbl>    <dbl>    <dbl>
1 XM_060040253.1   3123.          -0.726 0.178  -4.08 4.41e- 5 3.60e- 4
2 XM_060066729.1    702.           1.00  0.223   4.50 6.79e- 6 6.78e- 5
3 XM_060068449.1    174.          -1.70  0.123 -13.8  2.94e-43 1.68e-40
4 XM_060038440.1    289.          -1.42  0.136 -10.4  3.03e-25 3.98e-23
5 XM_060041661.1     23.6         -1.14  0.419  -2.84 4.55e- 3 2.00e- 2
6 XM_060071337.1    770.           1.06  0.365   2.90 3.70e- 3 1.69e- 2
```

``` r
paste("Number of significant DEGs for 9C v 0C:", nrow(sig_L.9.0_norm), "(padj<", padj.cutoff, ", log-fold change >", lfc.cutoff, ")")
```

```
[1] "Number of significant DEGs for 9C v 0C: 4703 (padj< 0.05 , log-fold change > 0.58 )"
```

``` r
write.table(sig_L.9.0_norm_noLFCcutoff, file = "../output/07-cod-RNAseq-DESeq2/Gmac_DEGs_sig_L.9.0_norm_noLFCcutoff.tab", sep = "\t",
            row.names = TRUE, col.names = NA)

write.table(sig_L.9.0_norm, file = "../output/07-cod-RNAseq-DESeq2/Gmac_DEGs_sig_L.9.0_norm.tab", sep = "\t",
            row.names = TRUE, col.names = NA)
```