# 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.4 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.3
    ## [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.8                 filelock_1.0.3
    ##   [5] bitops_1.0-9                tibble_3.3.1
    ##   [7] XML_3.99-0.22               httr2_1.2.2
    ##   [9] Ckmeans.1d.dp_4.3.5         lifecycle_1.0.5
    ##  [11] Rdpack_2.6.6                rstatix_0.7.3
    ##  [13] edgeR_4.9.4                 lattice_0.22-9
    ##  [15] MASS_7.3-65                 crosstalk_1.2.2
    ##  [17] MultiAssayExperiment_1.37.2 backports_1.5.0
    ##  [19] magrittr_2.0.4              plotly_4.12.0
    ##  [21] limma_3.67.0                sass_0.4.10
    ##  [23] rmarkdown_2.30              jquerylib_0.1.4
    ##  [25] yaml_2.3.12                 metapod_1.19.2
    ##  [27] httpuv_1.6.16               otel_0.2.0
    ##  [29] askpass_1.2.1               reticulate_1.45.0
    ##  [31] reader_1.1.0                DBI_1.3.0
    ##  [33] buildtools_1.0.0            RColorBrewer_1.1-3
    ##  [35] abind_1.4-8                 GenomicRanges_1.63.1
    ##  [37] purrr_1.2.1                 rappdirs_0.3.4
    ##  [39] sva_3.59.0                  IRanges_2.45.0
    ##  [41] irlba_2.3.7                 maketools_1.3.2
    ##  [43] genefilter_1.93.0           testthat_3.3.2
    ##  [45] pheatmap_1.0.13             umap_0.2.10.0
    ##  [47] RSpectra_0.16-2             annotate_1.89.0
    ##  [49] dqrng_0.4.1                 codetools_0.2-20
    ##  [51] DelayedArray_0.37.0         scuttle_1.21.0
    ##  [53] tidyselect_1.2.1            farver_2.1.2
    ##  [55] ScaledMatrix_1.19.0         matrixStats_1.5.0
    ##  [57] BiocFileCache_3.1.0         Seqinfo_1.1.0
    ##  [59] jsonlite_2.0.0              BiocNeighbors_2.5.4
    ##  [61] Formula_1.2-5               survival_3.8-6
    ##  [63] tools_4.5.2                 ggnewscale_0.5.2
    ##  [65] Rcpp_1.1.1                  glue_1.8.0
    ##  [67] SparseArray_1.11.11         xfun_0.56
    ##  [69] mgcv_1.9-4                  DESeq2_1.51.7
    ##  [71] MatrixGenerics_1.23.0       dplyr_1.2.0
    ##  [73] withr_3.0.2                 BiocManager_1.30.27
    ##  [75] fastmap_1.2.0               bluster_1.21.1
    ##  [77] shinyjs_2.1.1               openssl_2.3.5
    ##  [79] caTools_1.18.3              digest_0.6.39
    ##  [81] rsvd_1.0.5                  R6_2.6.1
    ##  [83] mime_0.13                   gtools_3.9.5
    ##  [85] RSQLite_2.4.6               utf8_1.2.6
    ##  [87] tidyr_1.3.2                 data.table_1.18.2.1
    ##  [89] FNN_1.1.4.1                 htmlwidgets_1.6.4
    ##  [91] httr_1.4.8                  S4Arrays_1.11.1
    ##  [93] pkgconfig_2.0.3             gtable_0.3.6
    ##  [95] NCmisc_1.3.1                blob_1.3.0
    ##  [97] S7_0.2.1                    SingleCellExperiment_1.33.1
    ##  [99] XVector_0.51.0              sys_3.4.3
    ## [101] brio_1.1.5                  htmltools_0.5.9
    ## [103] carData_3.0-6               scales_1.4.0
    ## [105] tidyverse_2.0.0             blockmodeling_1.1.8
    ## [107] png_0.1-9                   scran_1.39.1
    ## [109] EBSeq_2.9.0                 ggdendro_0.2.0
    ## [111] knitr_1.51                  reshape2_1.4.5
    ## [113] curl_7.0.0                  nlme_3.1-168
    ## [115] cachem_1.1.0                stringr_1.6.0
    ## [117] BiocVersion_3.23.1          KernSmooth_2.23-26
    ## [119] parallel_4.5.2              Harman_1.39.0
    ## [121] AnnotationDbi_1.73.0        pillar_1.11.1
    ## [123] grid_4.5.2                  vctrs_0.7.1
    ## [125] gplots_3.3.0                promises_1.5.0
    ## [127] ggpubr_0.6.3                car_3.1-5
    ## [129] BiocSingular_1.27.1         dbplyr_2.5.2
    ## [131] beachmat_2.27.3             xtable_1.8-8
    ## [133] cluster_2.1.8.2             evaluate_1.0.5
    ## [135] cli_3.6.5                   locfit_1.5-9.12
    ## [137] compiler_4.5.2              rlang_1.1.7
    ## [139] crayon_1.5.3                ggsignif_0.6.4
    ## [141] labeling_0.4.3              plyr_1.8.9
    ## [143] stringi_1.8.7               viridisLite_0.4.3
    ## [145] BiocParallel_1.45.0         Biostrings_2.79.5
    ## [147] lazyeval_0.2.2              Matrix_1.7-4
    ## [149] ExperimentHub_3.1.0         RcppEigen_0.3.4.0.2
    ## [151] bit64_4.6.0-1               ggplot2_4.0.2
    ## [153] KEGGREST_1.51.1             statmod_1.5.1
    ## [155] shiny_1.13.0                SummarizedExperiment_1.41.1
    ## [157] AnnotationHub_4.1.0         rbibutils_2.4.1
    ## [159] igraph_2.2.2                broom_1.0.12
    ## [161] memoise_2.0.1               bslib_0.10.0
    ## [163] bit_4.6.0