Skip to contents
library(reneeTools)
#> Warning: replacing previous import 'S4Arrays::makeNindexFromArrayViewport' by
#> 'DelayedArray::makeNindexFromArrayViewport' when loading 'SummarizedExperiment'
library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
# replace this line with actual path to your gene counts
gene_counts_tsv <- system.file("extdata", "RSEM.genes.expected_count.all_samples.txt", package = "reneeTools")
metadata_tsv <- system.file("extdata", "sample_metadata.tsv", package = "reneeTools")

# create reneeDataSet object
renee_ds <- create_reneeDataSet_from_files(gene_counts_tsv, metadata_tsv) %>%
  run_deseq2(design = ~condition)
#> Rows: 58929 Columns: 6
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: "\t"
#> chr (2): gene_id, GeneName
#> dbl (4): KO_S3, KO_S4, WT_S1, WT_S2
#> 
#>  Use `spec()` to retrieve the full column specification for this data.
#>  Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> Rows: 4 Columns: 2
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: "\t"
#> chr (2): sample_id, condition
#> 
#>  Use `spec()` to retrieve the full column specification for this data.
#>  Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> Warning in DESeqDataSet(se, design = design, ignoreRank): some variables in
#> design formula are characters, converting to factors
#> estimating size factors
#> estimating dispersions
#> gene-wise dispersion estimates
#> mean-dispersion relationship
#> -- note: fitType='parametric', but the dispersion trend was not well captured by the
#>    function: y = a/x + b, and a local regression fit was automatically substituted.
#>    specify fitType='local' or 'mean' to avoid this message next time.
#> final dispersion estimates
#> fitting model and testing

renee_ds@analyses$deseq2_results %>% head()
#> log2 fold change (MLE): condition wildtype vs knockout 
#> Wald test p-value: condition wildtype vs knockout 
#> DataFrame with 6 rows and 6 columns
#>                     baseMean log2FoldChange     lfcSE       stat      pvalue
#>                    <numeric>      <numeric> <numeric>  <numeric>   <numeric>
#> ENSG00000160179.18   4.23262      0.0527888  1.242584  0.0424831 9.66114e-01
#> ENSG00000154734.15  20.38470      7.3430111  1.475316  4.9772452 6.44956e-07
#> ENSG00000154736.6   10.72677      6.4048010  1.566426  4.0887980 4.33614e-05
#> ENSG00000197381.16   5.36075      0.6802331  0.966972  0.7034673 4.81765e-01
#> ENSG00000235609.7    2.82178     -0.5985472  1.168387 -0.5122848 6.08452e-01
#> ENSG00000160216.19   8.84505     -0.4807875  0.769604 -0.6247206 5.32154e-01
#>                           padj
#>                      <numeric>
#> ENSG00000160179.18 9.66114e-01
#> ENSG00000154734.15 9.39793e-06
#> ENSG00000154736.6  3.68572e-04
#> ENSG00000197381.16 6.46821e-01
#> ENSG00000235609.7  7.30142e-01
#> ENSG00000160216.19 6.53973e-01