# BatchQC Examples

# Example 1: Protein Data

This data set is from protein expression data captured for 39 proteins. It has two batches and two conditions corresponding to case and control.

    library(BatchQC)
    data(protein_data)
    data(protein_sample_info)
    se_object <- BatchQC::summarized_experiment(protein_data, protein_sample_info)

# Example 2: Signature Data

This data set is from signature data captured when activating different growth pathway genes in human mammary epithelial cells (GEO accession: GSE73628). This data consists of three batches and ten different conditions corresponding to control and nine different pathways

    data(signature_data)
    data(batch_indicator)
    se_object <- BatchQC::summarized_experiment(signature_data, batch_indicator)

# Example 3: Bladderbatch Data

This data set is from bladder cancer data. This dataset has 57 bladder samples with 5 batches and 3 covariate levels (cancer, biopsy, control). Batch 1 contains only cancer, 2 has cancer and controls, 3 has only controls, 4 contains only biopsy, and 5 contains cancer and biopsy. This data set is from the bladderbatch package which must be installed to use this data example set (Leek JT (2023). bladderbatch: Bladder gene expression data illustrating batch effects. R package version 1.38.0).

    if (!requireNamespace("bladderbatch", quietly = TRUE))
        BiocManager::install("bladderbatch")
    se_object <- BatchQC::bladder_data_upload()

# Example 4: TB Data

This is a whole blood gene expression profiling from well and malnourished Indian individuals with TB and severely malnourished household contacts with latent TB infection (LTBI). Severe malnutrition was defined as body mass index <16. kg/m2 in adults and based on weight-for-height Z scores in children <18 years. Gene expression was measured using RNA-sequencing. (VanValkenburg A, et al. Malnutrition leads to increased inflammation and expression of tuberculosis risk signatures in recently exposed household contacts of pulmonary tuberculosis. Front Immunol. 2022 Sep 28;13:1011166. doi: 10.3389/fimmu.2022.1011166”)

    if (!requireNamespace("curatedTBData", quietly = TRUE))
        BiocManager::install("curatedTBData")
    se_object <- BatchQC::tb_data_upload()

# Session info

    ## R version 4.5.2 (2025-10-31)
    ## Platform: x86_64-pc-linux-gnu
    ## Running under: Ubuntu 24.04.3 LTS
    ##
    ## Matrix products: default
    ## BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
    ## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so;  LAPACK version 3.12.0
    ##
    ## locale:
    ##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
    ##  [3] LC_TIME=en_US.UTF-8        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: Etc/UTC
    ## tzcode source: system (glibc)
    ##
    ## attached base packages:
    ## [1] stats4    stats     graphics  grDevices utils     datasets  methods
    ## [8] base
    ##
    ## other attached packages:
    ## [1] Biobase_2.71.0      S4Vectors_0.49.0    BiocGenerics_0.57.0
    ## [4] generics_0.1.4      curatedTBData_2.7.0 BatchQC_2.7.0
    ## [7] BiocStyle_2.39.0
    ##
    ## loaded via a namespace (and not attached):
    ##   [1] shinythemes_1.2.0           splines_4.5.2
    ##   [3] later_1.4.5                 bitops_1.0-9
    ##   [5] filelock_1.0.3              tibble_3.3.0
    ##   [7] XML_3.99-0.20               lifecycle_1.0.5
    ##   [9] httr2_1.2.2                 edgeR_4.9.2
    ##  [11] lattice_0.22-7              MASS_7.3-65
    ##  [13] crosstalk_1.2.2             MultiAssayExperiment_1.37.2
    ##  [15] magrittr_2.0.4              limma_3.67.0
    ##  [17] plotly_4.11.0               sass_0.4.10
    ##  [19] rmarkdown_2.30              jquerylib_0.1.4
    ##  [21] yaml_2.3.12                 metapod_1.19.1
    ##  [23] httpuv_1.6.16               otel_0.2.0
    ##  [25] askpass_1.2.1               reticulate_1.44.1
    ##  [27] reader_1.0.6                DBI_1.2.3
    ##  [29] buildtools_1.0.0            RColorBrewer_1.1-3
    ##  [31] abind_1.4-8                 GenomicRanges_1.63.1
    ##  [33] purrr_1.2.1                 rappdirs_0.3.3
    ##  [35] sva_3.59.0                  IRanges_2.45.0
    ##  [37] irlba_2.3.5.1               maketools_1.3.2
    ##  [39] genefilter_1.93.0           testthat_3.3.1
    ##  [41] pheatmap_1.0.13             umap_0.2.10.0
    ##  [43] RSpectra_0.16-2             annotate_1.89.0
    ##  [45] dqrng_0.4.1                 codetools_0.2-20
    ##  [47] DelayedArray_0.37.0         scuttle_1.21.0
    ##  [49] tidyselect_1.2.1            farver_2.1.2
    ##  [51] ScaledMatrix_1.19.0         matrixStats_1.5.0
    ##  [53] BiocFileCache_3.1.0         Seqinfo_1.1.0
    ##  [55] jsonlite_2.0.0              BiocNeighbors_2.5.0
    ##  [57] survival_3.8-3              tools_4.5.2
    ##  [59] ggnewscale_0.5.2            Rcpp_1.1.0.8.2
    ##  [61] glue_1.8.0                  SparseArray_1.11.10
    ##  [63] xfun_0.55                   mgcv_1.9-4
    ##  [65] DESeq2_1.51.6               MatrixGenerics_1.23.0
    ##  [67] dplyr_1.1.4                 withr_3.0.2
    ##  [69] BiocManager_1.30.27         fastmap_1.2.0
    ##  [71] bluster_1.21.0              shinyjs_2.1.0
    ##  [73] openssl_2.3.4               caTools_1.18.3
    ##  [75] digest_0.6.39               rsvd_1.0.5
    ##  [77] R6_2.6.1                    mime_0.13
    ##  [79] gtools_3.9.5                RSQLite_2.4.5
    ##  [81] utf8_1.2.6                  tidyr_1.3.2
    ##  [83] data.table_1.18.0           FNN_1.1.4.1
    ##  [85] httr_1.4.7                  htmlwidgets_1.6.4
    ##  [87] S4Arrays_1.11.1             pkgconfig_2.0.3
    ##  [89] gtable_0.3.6                NCmisc_1.2.0
    ##  [91] blob_1.2.4                  S7_0.2.1
    ##  [93] SingleCellExperiment_1.33.0 XVector_0.51.0
    ##  [95] sys_3.4.3                   brio_1.1.5
    ##  [97] htmltools_0.5.9             scales_1.4.0
    ##  [99] tidyverse_2.0.0             blockmodeling_1.1.8
    ## [101] png_0.1-8                   scran_1.39.0
    ## [103] EBSeq_2.9.0                 ggdendro_0.2.0
    ## [105] knitr_1.51                  reshape2_1.4.5
    ## [107] nlme_3.1-168                curl_7.0.0
    ## [109] cachem_1.1.0                stringr_1.6.0
    ## [111] BiocVersion_3.23.1          KernSmooth_2.23-26
    ## [113] parallel_4.5.2              AnnotationDbi_1.73.0
    ## [115] pillar_1.11.1               grid_4.5.2
    ## [117] vctrs_0.6.5                 gplots_3.3.0
    ## [119] promises_1.5.0              BiocSingular_1.27.1
    ## [121] dbplyr_2.5.1                beachmat_2.27.1
    ## [123] xtable_1.8-4                cluster_2.1.8.1
    ## [125] evaluate_1.0.5              cli_3.6.5
    ## [127] locfit_1.5-9.12             compiler_4.5.2
    ## [129] rlang_1.1.7                 crayon_1.5.3
    ## [131] labeling_0.4.3              plyr_1.8.9
    ## [133] stringi_1.8.7               viridisLite_0.4.2
    ## [135] BiocParallel_1.45.0         Biostrings_2.79.4
    ## [137] lazyeval_0.2.2              Matrix_1.7-4
    ## [139] ExperimentHub_3.1.0         RcppEigen_0.3.4.0.2
    ## [141] bit64_4.6.0-1               ggplot2_4.0.1
    ## [143] KEGGREST_1.51.1             statmod_1.5.1
    ## [145] shiny_1.12.1                SummarizedExperiment_1.41.0
    ## [147] AnnotationHub_4.1.0         igraph_2.2.1
    ## [149] memoise_2.0.1               bslib_0.9.0
    ## [151] bit_4.6.0