# 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.70.0      S4Vectors_0.48.0    BiocGenerics_0.56.0
    ## [4] generics_0.1.4      curatedTBData_2.6.0 BatchQC_2.6.1
    ## [7] BiocStyle_2.38.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.1
    ##   [7] XML_3.99-0.22               lifecycle_1.0.5
    ##   [9] httr2_1.2.2                 edgeR_4.8.2
    ##  [11] lattice_0.22-9              MASS_7.3-65
    ##  [13] crosstalk_1.2.2             MultiAssayExperiment_1.36.1
    ##  [15] magrittr_2.0.4              limma_3.66.0
    ##  [17] plotly_4.12.0               sass_0.4.10
    ##  [19] rmarkdown_2.30              jquerylib_0.1.4
    ##  [21] yaml_2.3.12                 metapod_1.18.0
    ##  [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.62.1
    ##  [33] purrr_1.2.1                 rappdirs_0.3.4
    ##  [35] sva_3.58.0                  IRanges_2.44.0
    ##  [37] irlba_2.3.7                 maketools_1.3.2
    ##  [39] genefilter_1.92.0           testthat_3.3.2
    ##  [41] pheatmap_1.0.13             umap_0.2.10.0
    ##  [43] RSpectra_0.16-2             annotate_1.88.0
    ##  [45] dqrng_0.4.1                 codetools_0.2-20
    ##  [47] DelayedArray_0.36.0         scuttle_1.20.0
    ##  [49] tidyselect_1.2.1            farver_2.1.2
    ##  [51] ScaledMatrix_1.18.0         matrixStats_1.5.0
    ##  [53] BiocFileCache_3.0.0         Seqinfo_1.0.0
    ##  [55] jsonlite_2.0.0              BiocNeighbors_2.4.0
    ##  [57] survival_3.8-6              tools_4.5.2
    ##  [59] ggnewscale_0.5.2            Rcpp_1.1.1
    ##  [61] glue_1.8.0                  SparseArray_1.10.8
    ##  [63] BiocBaseUtils_1.12.0        xfun_0.56
    ##  [65] mgcv_1.9-4                  DESeq2_1.50.2
    ##  [67] MatrixGenerics_1.22.0       dplyr_1.2.0
    ##  [69] withr_3.0.2                 BiocManager_1.30.27
    ##  [71] fastmap_1.2.0               bluster_1.20.0
    ##  [73] shinyjs_2.1.1               openssl_2.3.4
    ##  [75] caTools_1.18.3              digest_0.6.39
    ##  [77] rsvd_1.0.5                  R6_2.6.1
    ##  [79] mime_0.13                   gtools_3.9.5
    ##  [81] RSQLite_2.4.6               utf8_1.2.6
    ##  [83] tidyr_1.3.2                 data.table_1.18.2.1
    ##  [85] FNN_1.1.4.1                 httr_1.4.7
    ##  [87] htmlwidgets_1.6.4           S4Arrays_1.10.1
    ##  [89] pkgconfig_2.0.3             gtable_0.3.6
    ##  [91] NCmisc_1.2.0                blob_1.3.0
    ##  [93] S7_0.2.1                    SingleCellExperiment_1.32.0
    ##  [95] XVector_0.50.0              sys_3.4.3
    ##  [97] brio_1.1.5                  htmltools_0.5.9
    ##  [99] scales_1.4.0                tidyverse_2.0.0
    ## [101] blockmodeling_1.1.8         png_0.1-8
    ## [103] scran_1.38.0                EBSeq_2.8.0
    ## [105] ggdendro_0.2.0              knitr_1.51
    ## [107] reshape2_1.4.5              nlme_3.1-168
    ## [109] curl_7.0.0                  cachem_1.1.0
    ## [111] stringr_1.6.0               BiocVersion_3.22.0
    ## [113] KernSmooth_2.23-26          parallel_4.5.2
    ## [115] AnnotationDbi_1.72.0        pillar_1.11.1
    ## [117] grid_4.5.2                  vctrs_0.7.1
    ## [119] gplots_3.3.0                promises_1.5.0
    ## [121] BiocSingular_1.26.1         dbplyr_2.5.1
    ## [123] beachmat_2.26.0             xtable_1.8-4
    ## [125] cluster_2.1.8.2             evaluate_1.0.5
    ## [127] cli_3.6.5                   locfit_1.5-9.12
    ## [129] compiler_4.5.2              rlang_1.1.7
    ## [131] crayon_1.5.3                labeling_0.4.3
    ## [133] plyr_1.8.9                  stringi_1.8.7
    ## [135] viridisLite_0.4.3           BiocParallel_1.44.0
    ## [137] Biostrings_2.78.0           lazyeval_0.2.2
    ## [139] Matrix_1.7-4                ExperimentHub_3.0.0
    ## [141] RcppEigen_0.3.4.0.2         bit64_4.6.0-1
    ## [143] ggplot2_4.0.2               KEGGREST_1.50.0
    ## [145] statmod_1.5.1               shiny_1.12.1
    ## [147] SummarizedExperiment_1.40.0 AnnotationHub_4.0.0
    ## [149] igraph_2.2.2                memoise_2.0.1
    ## [151] bslib_0.10.0                bit_4.6.0