Skip to contents

Creates a DE_data object from a tibble or data-frame of differential expression results.

Usage

DE_data(dat, keep_rownames_as = NULL)

Arguments

dat

Tibble, results from a differential expression analysis. See Details.

keep_rownames_as

Character, the name of the column in which to save the rownames of the input data-frame. Default value is NULL, i.e. rownames will be discarded.

Value

A DE_data object, i.e. a tibble.

Details

The input data should have one row per gene or transcript, and at least the following columns:

  • chromosome: character column, chromosome on which the gene/transcript is located.

  • start and end: numeric, starting and end position of the gene/transcript (in bp). A column position will be constructed as the middle value (mean) between start and end.

  • score or padj: numeric, the DE score or adjusted p-value of the gene/transcript. If column score column is missing, will be constructed as -log10(padj).

  • foldChange or log2FoldChange: numeric, the fold-change or log2(fold-change) of the gene/transcript. If column log2FoldChange is missing, will be constructed as log2(foldChange).

Examples

x <- get_example_data()

DE_data(x[["DE"]])
#> # A tibble: 10,671 × 9
#>    gene    chromosome   padj log2FoldChange  start    end label   score position
#>    <chr>   <chr>       <dbl>          <dbl>  <dbl>  <dbl> <chr>   <dbl>    <dbl>
#>  1 PGSC00… ST4.03ch00  0.787       0.0114   4.58e7 4.58e7 Prot…  0.104    4.58e7
#>  2 PGSC00… ST4.03ch01  0.630       0.00529  8.86e7 8.86e7 PhD-…  0.201    8.86e7
#>  3 PGSC00… ST4.03ch02  0.864       0.00362  4.86e7 4.86e7 Acet…  0.0637   4.86e7
#>  4 PGSC00… ST4.03ch03  0.530       0.0320   6.23e7 6.23e7 Phos…  0.276    6.23e7
#>  5 PGSC00… ST4.03ch04  0.975       0.00225  7.22e7 7.22e7 Cons…  0.0109   7.22e7
#>  6 PGSC00… ST4.03ch05 NA          -0.000726 5.20e7 5.20e7 Cons… NA        5.20e7
#>  7 PGSC00… ST4.03ch06  0.844      -0.00323  5.95e7 5.95e7 30S …  0.0739   5.95e7
#>  8 PGSC00… ST4.03ch07  0.944      -0.00337  5.67e7 5.67e7 Ent-…  0.0252   5.67e7
#>  9 PGSC00… ST4.03ch08  0.403       0.0290   5.68e7 5.68e7 B3 d…  0.394    5.68e7
#> 10 PGSC00… ST4.03ch09 NA          -0.000241 6.15e7 6.15e7 Cons… NA        6.15e7
#> # ℹ 10,661 more rows