Use the Data in this Data Package

Introduction

This data package contains code to generate various filtered forms of a normalised dataset based on downloading the accessions in inst/hsapiens_colData_transitions_v3.5.csv for species “hsapiens” from DEE2, and it also has a way (for reproducibility and also ease of use) to use AnnotationHub (as the data files were too large to fit inside of the data package itself) to fetch data pregenerated at the initial package development time.

Installation

We assume you already have R installed and configured. If you do not have Bioconductor installed, you can install it like so:

if (!requireNamespace("BiocManager", quietly=TRUE))
    install.packages("BiocManager")
BiocManager::install()

Then, if you have not installed this package and the dependencies from Bioconductor, you can install them like so:

BiocManager::install(c("CellScore", "homosapienDEE2CellScore", "devtools", "getDEE2", "SummarizedExperiment"))

Setup

In order to make the needed libraries accessible, you will need the following setup:

library(DESeq2)
#> Loading required package: S4Vectors
#> Loading required package: stats4
#> Loading required package: BiocGenerics
#> 
#> Attaching package: 'BiocGenerics'
#> The following objects are masked from 'package:stats':
#> 
#>     IQR, mad, sd, var, xtabs
#> The following objects are masked from 'package:base':
#> 
#>     Filter, Find, Map, Position, Reduce, anyDuplicated, aperm, append,
#>     as.data.frame, basename, cbind, colnames, dirname, do.call,
#>     duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
#>     lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin,
#>     pmin.int, rank, rbind, rownames, sapply, saveRDS, setdiff, table,
#>     tapply, union, unique, unsplit, which.max, which.min
#> 
#> Attaching package: 'S4Vectors'
#> The following object is masked from 'package:utils':
#> 
#>     findMatches
#> The following objects are masked from 'package:base':
#> 
#>     I, expand.grid, unname
#> Loading required package: IRanges
#> Loading required package: GenomicRanges
#> Loading required package: GenomeInfoDb
#> Loading required package: SummarizedExperiment
#> Loading required package: MatrixGenerics
#> Loading required package: matrixStats
#> 
#> Attaching package: 'MatrixGenerics'
#> The following objects are masked from 'package:matrixStats':
#> 
#>     colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse,
#>     colCounts, colCummaxs, colCummins, colCumprods, colCumsums,
#>     colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs,
#>     colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats,
#>     colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds,
#>     colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads,
#>     colWeightedMeans, colWeightedMedians, colWeightedSds,
#>     colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet,
#>     rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods,
#>     rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps,
#>     rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins,
#>     rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks,
#>     rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars,
#>     rowWeightedMads, rowWeightedMeans, rowWeightedMedians,
#>     rowWeightedSds, rowWeightedVars
#> Loading required package: Biobase
#> Welcome to Bioconductor
#> 
#>     Vignettes contain introductory material; view with
#>     'browseVignettes()'. To cite Bioconductor, see
#>     'citation("Biobase")', and for packages 'citation("pkgname")'.
#> 
#> Attaching package: 'Biobase'
#> The following object is masked from 'package:MatrixGenerics':
#> 
#>     rowMedians
#> The following objects are masked from 'package:matrixStats':
#> 
#>     anyMissing, rowMedians
library(S4Vectors)
library(Biobase)
library(SummarizedExperiment)
library(getDEE2)
library(devtools)
#> Loading required package: usethis
library(CellScore)
library(homosapienDEE2CellScore)

Getting and using the data

All of the permutations of filtering and normalising the data can be downloaded in a labeled list like so:

the_data<-downloadAllTheData()
#> see ?homosapienDEE2CellScore and browseVignettes('homosapienDEE2CellScore') for documentation
#> loading from cache
#> see ?homosapienDEE2CellScore and browseVignettes('homosapienDEE2CellScore') for documentation
#> loading from cache
#> see ?homosapienDEE2CellScore and browseVignettes('homosapienDEE2CellScore') for documentation
#> loading from cache
#> see ?homosapienDEE2CellScore and browseVignettes('homosapienDEE2CellScore') for documentation
#> loading from cache
#> see ?homosapienDEE2CellScore and browseVignettes('homosapienDEE2CellScore') for documentation
#> loading from cache
#> see ?homosapienDEE2CellScore and browseVignettes('homosapienDEE2CellScore') for documentation
#> loading from cache
#> see ?homosapienDEE2CellScore and browseVignettes('homosapienDEE2CellScore') for documentation
#> loading from cache
#> see ?homosapienDEE2CellScore and browseVignettes('homosapienDEE2CellScore') for documentation
#> loading from cache

We can then get the data we are after - non-normalised data including samples with quality control warnings - and use it in CellScore to calculate the on/off score for cell transitions from fibroblast to embryonic stem cells:

sm <- the_data$HomosapienDEE2_QC_WARN_Raw
## We could have just run `sm <- homosapienDEE2CellScore::readInSEZip(homosapienDEE2CellScore::HomosapienDEE2_QC_PASS_Raw())`
## instead of downloading all the data.

# Here we want to analyse all of the raw data to calculate the
# on/off score for cell transitions from fibroblast to embryonic stem cells
test1 <- sm[, sm$category == 'test']
standard <- sm[, sm$category == 'standard']
sm1 <- cbind(test1, standard)
cell.change <- data.frame(start=c("FIB"), test=c("nESC"), target=c("ESC"))
group.OnOff <- OnOff(sm1, cell.change, out.put="marker.list")
#> Warning in .calculateGroupOnOff(score.comparisons, calls, pdata, annot, :
#> Multiple array platforms exist in the phenotype data.

Session Info

sessionInfo()
#> R version 4.4.1 (2024-06-14)
#> Platform: x86_64-pc-linux-gnu
#> Running under: Ubuntu 24.04.1 LTS
#> 
#> Matrix products: default
#> BLAS:   /home/biocbuild/bbs-3.20-bioc/R/lib/libRblas.so 
#> LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.12.0
#> 
#> locale:
#>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
#>  [3] LC_TIME=en_GB              LC_COLLATE=C              
#>  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
#>  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
#>  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
#> 
#> time zone: America/New_York
#> tzcode source: system (glibc)
#> 
#> attached base packages:
#> [1] stats4    stats     graphics  grDevices utils     datasets  methods  
#> [8] base     
#> 
#> other attached packages:
#>  [1] homosapienDEE2CellScore_1.2.0 CellScore_1.26.0             
#>  [3] devtools_2.4.5                usethis_3.0.0                
#>  [5] getDEE2_1.16.0                DESeq2_1.46.0                
#>  [7] SummarizedExperiment_1.36.0   Biobase_2.66.0               
#>  [9] MatrixGenerics_1.18.0         matrixStats_1.4.1            
#> [11] GenomicRanges_1.58.0          GenomeInfoDb_1.42.0          
#> [13] IRanges_2.40.0                S4Vectors_0.44.0             
#> [15] BiocGenerics_0.52.0          
#> 
#> loaded via a namespace (and not attached):
#>   [1] DBI_1.2.3               bitops_1.0-9            remotes_2.5.0          
#>   [4] rlang_1.1.4             magrittr_2.0.3          compiler_4.4.1         
#>   [7] RSQLite_2.3.7           png_0.1-8               vctrs_0.6.5            
#>  [10] htm2txt_2.2.2           profvis_0.4.0           pkgconfig_2.0.3        
#>  [13] crayon_1.5.3            fastmap_1.2.0           dbplyr_2.5.0           
#>  [16] XVector_0.46.0          ellipsis_0.3.2          caTools_1.18.3         
#>  [19] utf8_1.2.4              promises_1.3.0          rmarkdown_2.28         
#>  [22] sessioninfo_1.2.2       UCSC.utils_1.2.0        purrr_1.0.2            
#>  [25] bit_4.5.0               xfun_0.48               zlibbioc_1.52.0        
#>  [28] cachem_1.1.0            jsonlite_1.8.9          blob_1.2.4             
#>  [31] SnowballC_0.7.1         later_1.3.2             DelayedArray_0.32.0    
#>  [34] BiocParallel_1.40.0     parallel_4.4.1          R6_2.5.1               
#>  [37] bslib_0.8.0             RColorBrewer_1.1-3      pkgload_1.4.0          
#>  [40] jquerylib_0.1.4         Rcpp_1.0.13             knitr_1.48             
#>  [43] httpuv_1.6.15           Matrix_1.7-1            tidyselect_1.2.1       
#>  [46] abind_1.4-8             yaml_2.3.10             gplots_3.2.0           
#>  [49] codetools_0.2-20        miniUI_0.1.1.1          curl_5.2.3             
#>  [52] pkgbuild_1.4.5          lattice_0.22-6          tibble_3.2.1           
#>  [55] withr_3.0.2             KEGGREST_1.46.0         shiny_1.9.1            
#>  [58] Rtsne_0.17              evaluate_1.0.1          BiocFileCache_2.14.0   
#>  [61] urlchecker_1.0.1        Biostrings_2.74.0       ExperimentHub_2.14.0   
#>  [64] filelock_1.0.3          BiocManager_1.30.25     pillar_1.9.0           
#>  [67] lsa_0.73.3              KernSmooth_2.23-24      generics_0.1.3         
#>  [70] BiocVersion_3.20.0      ggplot2_3.5.1           munsell_0.5.1          
#>  [73] scales_1.3.0            gtools_3.9.5            xtable_1.8-4           
#>  [76] glue_1.8.0              tools_4.4.1             AnnotationHub_3.14.0   
#>  [79] locfit_1.5-9.10         fs_1.6.5                grid_4.4.1             
#>  [82] AnnotationDbi_1.68.0    colorspace_2.1-1        GenomeInfoDbData_1.2.13
#>  [85] cli_3.6.3               rappdirs_0.3.3          fansi_1.0.6            
#>  [88] S4Arrays_1.6.0          dplyr_1.1.4             gtable_0.3.6           
#>  [91] sass_0.4.9              digest_0.6.37           SparseArray_1.6.0      
#>  [94] htmlwidgets_1.6.4       memoise_2.0.1           htmltools_0.5.8.1      
#>  [97] lifecycle_1.0.4         httr_1.4.7              squash_1.0.9           
#> [100] mime_0.12               bit64_4.5.2