# Method to get the significant genes

`significants.Rd`

Function to get the features that are significant according to some thresholds from a DEGSet, DESeq2::DESeqResults and edgeR::topTags.

    significants(object, padj = 0.05, fc = 0, direction = NULL,
      full = FALSE, ...)

    # S4 method for DEGSet
    significants(object, padj = 0.05, fc = 0,
      direction = NULL, full = FALSE, ...)

    # S4 method for DESeqResults
    significants(object, padj = 0.05, fc = 0,
      direction = NULL, full = FALSE, ...)

    # S4 method for TopTags
    significants(object, padj = 0.05, fc = 0,
      direction = NULL, full = FALSE, ...)

    # S4 method for list
    significants(object, padj = 0.05, fc = 0,
      direction = NULL, full = FALSE, newFDR = FALSE, ...)

## Arguments

object | DEGSet
padj | Cutoff for the FDR column.
fc | Cutoff for the log2FC column.
direction | Whether to take down/up/ignore. Valid arguments are down, up and NULL.
full | Whether to return full table or not.
... | Passed to deg. Default: value = NULL. Value can be 'raw', 'shrunken'.
newFDR | Whether to recalculate the FDR or not. See https://support.bioconductor.org/p/104059/#104072. Only used when a list is giving to the method.

## Value

a dplyr::tbl_df data frame. `gene` column has the feature name. In the case of using this method with the results from degComps, `log2FoldChange` has the higher foldChange from the comparisons, and `padj` has the padj associated to the previous column. Then, there is two columns for each comparison, one for the log2FoldChange and another for the padj.

## Examples

    library(DESeq2)
    library(dplyr)
    dds <- makeExampleDESeqDataSet(betaSD=1)
    colData(dds)[["treatment"]] <- sample(colData(dds)[["condition"]], 12)
      design(dds) <-  ~ condition + treatment
    dds <- DESeq(dds)#> estimating size factors#> estimating dispersions#> gene-wise dispersion estimates#> mean-dispersion relationship#> final dispersion estimates#> fitting model and testingres <- degComps(dds, contrast = list("treatment_B_vs_A",
                                         c("condition", "A", "B")))#> Doing 2 element(s).#> Doing results() for each element.#> Doing lcfSrink() for each element.#> using 'normal' for LFC shrinkage, the Normal prior from Love et al (2014).
    #>
    #> Note that type='apeglm' and type='ashr' have shown to have less bias than type='normal'.
    #> See ?lfcShrink for more details on shrinkage type, and the DESeq2 vignette.
    #> Reference: https://doi.org/10.1093/bioinformatics/bty895#> using 'normal' for LFC shrinkage, the Normal prior from Love et al (2014).
    #>
    #> Note that type='apeglm' and type='ashr' have shown to have less bias than type='normal'.
    #> See ?lfcShrink for more details on shrinkage type, and the DESeq2 vignette.
    #> Reference: https://doi.org/10.1093/bioinformatics/bty895significants(res, full = TRUE) %>% head#> # A tibble: 6 x 5
    #>   gene    log2FoldChange      padj log2FoldChange_condition… padj_condition_A_v…
    #>   <chr>            <dbl>     <dbl>                     <dbl>               <dbl>
    #> 1 gene102          0.942   3.93e-2                     0.942          0.0393
    #> 2 gene108         -0.953   2.99e-2                    -0.953          0.0299
    #> 3 gene116         -1.31    2.59e-3                    -1.31           0.00259
    #> 4 gene119         -2.03    1.18e-6                    -2.03           0.00000118
    #> 5 gene120          1.74    1.33e-5                     1.74           0.0000133
    #> 6 gene122          1.09    3.22e-2                     1.09           0.0322    significants(res, full = TRUE, padj = 1) %>% head # all genes#> # A tibble: 6 x 7
    #>   gene  log2FoldChange   padj log2FoldChange_… log2FoldChange_… padj_condition_…
    #>   <chr>          <dbl>  <dbl>            <dbl>            <dbl>            <dbl>
    #> 1 gene1        -0.113  0.952           -0.788           -0.113            0.388
    #> 2 gene…         1.62   0.0931           1.62            -0.0855           0.0931
    #> 3 gene…        -0.310  0.479           -0.310           -0.339            0.479
    #> 4 gene…         0.645  0.448            0.645           -0.528            0.448
    #> 5 gene…         0.0479 0.914            0.0479          -0.550            0.914
    #> 6 gene…         0.942  0.0393           0.942           -0.258            0.0393
    #> # … with 1 more variable: padj_treatment_B_vs_A <dbl>