Last updated: 2024-12-31

Checks: 7 0

Knit directory: paed-inflammation-CITEseq/

This reproducible R Markdown analysis was created with workflowr (version 1.7.1). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20240216) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version b812210. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/
    Ignored:    analysis/obsolete/
    Ignored:    data/C133_Neeland_batch1/
    Ignored:    data/C133_Neeland_merged/
    Ignored:    output/dge_analysis/obsolete/
    Ignored:    renv/library/
    Ignored:    renv/staging/

Untracked files:
    Untracked:  analysis/14.0_DGE_analysis_T-cells.Rmd
    Untracked:  analysis/15.2_proportions_analysis_ann_level_3_macrophages.Rmd
    Untracked:  analysis/17.0_Figure_3.Rmd
    Untracked:  analysis/17.0_Figure_4.Rmd
    Untracked:  analysis/17.0_Figure_5.Rmd
    Untracked:  analysis/figure/
    Untracked:  broad_markers_seurat.csv
    Untracked:  code/background_job.R
    Untracked:  code/reverse_modifier_severity_comparisons.sh
    Untracked:  data/intermediate_objects/CD4 T cells.CF_samples.fit.rds
    Untracked:  data/intermediate_objects/CD4 T cells.all_samples.fit.rds
    Untracked:  data/intermediate_objects/CD8 T cells.CF_samples.fit.rds
    Untracked:  data/intermediate_objects/CD8 T cells.all_samples.fit.rds
    Untracked:  data/intermediate_objects/DC cells.CF_samples.fit.rds
    Untracked:  data/intermediate_objects/DC cells.all_samples.fit.rds
    Untracked:  data/intermediate_objects/T cells.CF_samples.fit.rds
    Untracked:  data/intermediate_objects/T cells.all_samples.fit.rds
    Untracked:  output/dge_analysis/T cells/

Unstaged changes:
    Modified:   .gitignore
    Modified:   analysis/06.0_azimuth_annotation.Rmd
    Modified:   analysis/09.0_integrate_cluster_macro_cells.Rmd
    Modified:   analysis/13.1_DGE_analysis_macro-alveolar.Rmd
    Deleted:    analysis/14.0_proportions_analysis_ann_level_1.Rmd
    Deleted:    analysis/14.1_proportions_analysis_ann_level_3_non-macrophages.Rmd
    Deleted:    analysis/14.2_proportions_analysis_ann_level_3_macrophages.Rmd
    Modified:   analysis/15.0_Figure_1.Rmd
    Modified:   analysis/15.0_proportions_analysis_ann_level_1.Rmd
    Modified:   analysis/16.0_Figure_2.Rmd
    Modified:   analysis/17.0_Supplementary_Figure_ADTs.Rmd
    Modified:   code/utility.R
    Modified:   data/cluster_annotations/marker_proteins_TNK_supp.xlsx
    Modified:   data/cluster_annotations/marker_proteins_macrophages_supp.xlsx
    Modified:   data/cluster_annotations/marker_proteins_other_supp.xlsx
    Modified:   data/cluster_annotations/seurat_markers_all_cells.rds
    Modified:   data/intermediate_objects/macro-alveolar.CF_samples.fit.rds
    Modified:   data/intermediate_objects/macro-alveolar.all_samples.fit.rds
    Modified:   output/dge_analysis/macro-alveolar/ORA.FIBROSIS.CF.IVAvCF.NO_MOD.csv
    Modified:   output/dge_analysis/macro-alveolar/ORA.FIBROSIS.CF.IVAvNON_CF.CTRL.csv
    Modified:   output/dge_analysis/macro-alveolar/ORA.FIBROSIS.CF.NO_MOD.SvCF.NO_MOD.M.csv
    Modified:   output/dge_analysis/macro-alveolar/ORA.FIBROSIS.CF.NO_MODvNON_CF.CTRL.csv
    Modified:   output/dge_analysis/macro-alveolar/ORA.GO.CF.IVAvCF.NO_MOD.csv
    Modified:   output/dge_analysis/macro-alveolar/ORA.GO.CF.IVAvNON_CF.CTRL.csv
    Modified:   output/dge_analysis/macro-alveolar/ORA.GO.CF.NO_MOD.SvCF.NO_MOD.M.csv
    Modified:   output/dge_analysis/macro-alveolar/ORA.GO.CF.NO_MODvNON_CF.CTRL.csv
    Modified:   output/dge_analysis/macro-alveolar/ORA.HALLMARK.CF.IVAvCF.NO_MOD.csv
    Modified:   output/dge_analysis/macro-alveolar/ORA.HALLMARK.CF.IVAvNON_CF.CTRL.csv
    Modified:   output/dge_analysis/macro-alveolar/ORA.HALLMARK.CF.NO_MOD.SvCF.NO_MOD.M.csv
    Modified:   output/dge_analysis/macro-alveolar/ORA.HALLMARK.CF.NO_MODvNON_CF.CTRL.csv
    Modified:   output/dge_analysis/macro-alveolar/ORA.REACTOME.CF.IVAvCF.NO_MOD.csv
    Modified:   output/dge_analysis/macro-alveolar/ORA.REACTOME.CF.IVAvNON_CF.CTRL.csv
    Modified:   output/dge_analysis/macro-alveolar/ORA.REACTOME.CF.NO_MOD.SvCF.NO_MOD.M.csv
    Modified:   output/dge_analysis/macro-alveolar/ORA.REACTOME.CF.NO_MODvNON_CF.CTRL.csv
    Modified:   output/dge_analysis/macro-alveolar/ORA.WP.CF.IVAvCF.NO_MOD.csv
    Modified:   output/dge_analysis/macro-alveolar/ORA.WP.CF.IVAvNON_CF.CTRL.csv
    Modified:   output/dge_analysis/macro-alveolar/ORA.WP.CF.NO_MOD.SvCF.NO_MOD.M.csv
    Modified:   output/dge_analysis/macro-alveolar/ORA.WP.CF.NO_MODvNON_CF.CTRL.csv

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/15.1_proportions_analysis_ann_level_3_non-macrophages.Rmd) and HTML (docs/15.1_proportions_analysis_ann_level_3_non-macrophages.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
Rmd b812210 Jovana Maksimovic 2024-12-31 wflow_publish("analysis/15.1_proportions_analysis_ann_level_3_non-macrophages.Rmd")

Load libraries

suppressPackageStartupMessages({
  library(SingleCellExperiment)
  library(edgeR)
  library(tidyverse)
  library(ggplot2)
  library(Seurat)
  library(glmGamPoi)
  library(dittoSeq)
  library(clustree)
  library(AnnotationDbi)
  library(org.Hs.eg.db)
  library(glue)
  library(speckle)
  library(patchwork)
  library(paletteer)
  library(tidyHeatmap)
  library(here)
})

set.seed(42)
options(scipen=999)
options(future.globals.maxSize = 6500 * 1024^2)

Load Data

files <- list.files(here("data/C133_Neeland_merged"),
                    pattern = "C133_Neeland_full_clean.*(t_cells|other_cells)_annotated_diet.SEU.rds",
                    full.names = TRUE)

seuLst <- lapply(files, function(f) readRDS(f))

seu <- merge(seuLst[[1]], 
             y = c(seuLst[[2]]))
seu
An object of class Seurat 
19973 features across 29198 samples within 1 assay 
Active assay: RNA (19973 features, 0 variable features)
            used   (Mb) gc trigger   (Mb)  max used   (Mb)
Ncells  11753109  627.7   20174885 1077.5  14082532  752.1
Vcells 138257994 1054.9  375135597 2862.1 328405239 2505.6

Analyse Cell type proportions

# Differences in cell type proportions
props <- getTransformedProps(clusters = seu$ann_level_3,
                             sample = seu$sample.id, transform="asin")
props$Proportions %>% knitr::kable()
sample_1.1 sample_15.1 sample_16.1 sample_17.1 sample_18.1 sample_19.1 sample_2.1 sample_20.1 sample_21.1 sample_22.1 sample_23.1 sample_24.1 sample_25.1 sample_26.1 sample_27.1 sample_28.1 sample_29.1 sample_3.1 sample_30.1 sample_31.1 sample_32.1 sample_33.1 sample_34.1 sample_34.2 sample_34.3 sample_35.1 sample_35.2 sample_36.1 sample_36.2 sample_37.1 sample_37.2 sample_37.3 sample_38.1 sample_38.2 sample_38.3 sample_39.1 sample_39.2 sample_4.1 sample_40.1 sample_41.1 sample_42.1 sample_43.1 sample_5.1 sample_6.1 sample_7.1
B cells 0.1856061 0.0482375 0.0311111 0.2309942 0.0173077 0.1276596 0.2475845 0.0404984 0.1284635 0.0711111 0.2189219 0.0332005 0.0326531 0.0909091 0.0196850 0.0164474 0.2936345 0.1896552 0.0143198 0.0182927 0.0398010 0.1157703 0.0205128 0.0000000 0.0240964 0.1489002 0.0853175 0.1621622 0.2230392 0.1123596 0.2140351 0.1269036 0.2093023 0.1792453 0.2611276 0.2583170 0.1071429 0.0513532 0.3424487 0.0784857 0.0523504 0.1044341 0.0686695 0.0673077 0.2083994
CD4 T cells 0.0492424 0.1001855 0.1288889 0.0628655 0.0538462 0.0638298 0.0772947 0.1526480 0.1360202 0.1555556 0.1034103 0.1049137 0.1632653 0.1553030 0.0944882 0.0855263 0.0513347 0.0758621 0.3166269 0.2256098 0.1442786 0.1741112 0.0461538 0.0232558 0.0321285 0.0913706 0.0853175 0.0291060 0.1188725 0.1067416 0.1508772 0.1675127 0.1627907 0.1792453 0.1186944 0.0861057 0.1203416 0.0458015 0.1796147 0.1135734 0.1191239 0.0705951 0.1845494 0.1483516 0.1671949
CD4 T-IFN 0.0151515 0.0426716 0.0133333 0.0043860 0.0057692 0.0425532 0.0000000 0.0000000 0.0176322 0.0088889 0.0044004 0.0212483 0.0122449 0.0189394 0.0118110 0.0065789 0.0000000 0.0068966 0.0095465 0.0162602 0.0199005 0.0109389 0.0051282 0.0000000 0.0080321 0.0067682 0.0337302 0.0000000 0.0049020 0.0000000 0.0070175 0.0152284 0.0232558 0.0566038 0.0178042 0.0039139 0.0108696 0.0013879 0.0018645 0.0166205 0.0267094 0.0049592 0.0021459 0.0109890 0.0055468
CD4 T-naïve 0.0037879 0.0204082 0.0044444 0.0073099 0.0173077 0.0212766 0.0072464 0.0186916 0.0226700 0.0177778 0.0341034 0.0073041 0.0122449 0.0378788 0.0078740 0.0131579 0.0164271 0.0068966 0.0588703 0.0345528 0.0049751 0.0218778 0.0051282 0.0000000 0.0000000 0.0135364 0.0059524 0.0000000 0.0171569 0.0168539 0.0105263 0.0050761 0.0000000 0.0094340 0.0089021 0.0039139 0.0326087 0.0034698 0.0298322 0.0092336 0.0106838 0.0099183 0.0407725 0.0096154 0.0657686
CD4 T-NFKB 0.0000000 0.0074212 0.0044444 0.0043860 0.0057692 0.0000000 0.0060386 0.0093458 0.0604534 0.0311111 0.0187019 0.0099602 0.0163265 0.0189394 0.0039370 0.0065789 0.0205339 0.0034483 0.0031822 0.0121951 0.0348259 0.0638104 0.0256410 0.0155039 0.0120482 0.0135364 0.0138889 0.0270270 0.0232843 0.0674157 0.0456140 0.0558376 0.0116279 0.0188679 0.0178042 0.0704501 0.0535714 0.0020819 0.0186451 0.0572484 0.0058761 0.0049592 0.0107296 0.0082418 0.0158479
CD4 T-reg 0.0113636 0.0055659 0.0488889 0.0131579 0.0134615 0.0000000 0.0060386 0.0218069 0.0201511 0.0266667 0.0176018 0.0126162 0.0244898 0.0151515 0.0039370 0.0131579 0.0041068 0.0034483 0.0310263 0.0223577 0.0248756 0.0255242 0.0051282 0.0155039 0.0080321 0.0186125 0.0317460 0.0145530 0.0220588 0.0280899 0.0491228 0.0761421 0.0232558 0.0377358 0.0326409 0.0136986 0.0100932 0.0034698 0.0142946 0.0073869 0.0133547 0.0087515 0.0171674 0.0109890 0.0206022
CD4 T-rm 0.0037879 0.0092764 0.0133333 0.0043860 0.0076923 0.0000000 0.0024155 0.0093458 0.0075567 0.0088889 0.0066007 0.0053121 0.0040816 0.0037879 0.0078740 0.0164474 0.0041068 0.0034483 0.0023866 0.0060976 0.0000000 0.0054695 0.0000000 0.0000000 0.0000000 0.0016920 0.0019841 0.0000000 0.0024510 0.0280899 0.0210526 0.0152284 0.0232558 0.0094340 0.0148368 0.0039139 0.0069876 0.0034698 0.0000000 0.0000000 0.0000000 0.0000000 0.0472103 0.0123626 0.0095087
CD8 T-GZMK 0.0075758 0.0278293 0.0933333 0.0511696 0.0365385 0.0000000 0.0181159 0.0186916 0.0352645 0.0133333 0.0044004 0.0112882 0.0612245 0.0530303 0.0157480 0.0230263 0.0205339 0.0103448 0.0620525 0.0508130 0.0199005 0.0109389 0.0051282 0.0000000 0.0000000 0.0406091 0.0158730 0.0000000 0.0036765 0.0224719 0.0140351 0.0203046 0.0116279 0.0188679 0.0089021 0.0019569 0.0139752 0.0201249 0.0870106 0.0101570 0.0245726 0.0347141 0.0171674 0.0164835 0.0237718
CD8 T-inflammasome 0.0303030 0.0723562 0.0977778 0.0467836 0.1230769 0.0425532 0.0229469 0.1651090 0.0906801 0.1377778 0.0143014 0.0836653 0.0693878 0.0833333 0.0708661 0.1085526 0.0164271 0.0482759 0.1097852 0.1646341 0.0845771 0.1248861 0.0358974 0.0077519 0.0281124 0.0541455 0.0615079 0.0145530 0.0563725 0.0617978 0.0491228 0.0558376 0.0813953 0.0754717 0.0623145 0.0293542 0.0465839 0.0485774 0.0273462 0.0877193 0.2168803 0.1875729 0.1523605 0.2390110 0.1236133
CD8 T-rm 0.0189394 0.0983302 0.2755556 0.0950292 0.0480769 0.0212766 0.0978261 0.0560748 0.1209068 0.1377778 0.1243124 0.0956175 0.0489796 0.1022727 0.1732283 0.2302632 0.1519507 0.0896552 0.0437550 0.2012195 0.1542289 0.1139471 0.0358974 0.0232558 0.0602410 0.0761421 0.0297619 0.0062370 0.0502451 0.1516854 0.0666667 0.1725888 0.0697674 0.0566038 0.1216617 0.0195695 0.2321429 0.0735600 0.0559354 0.1615882 0.1794872 0.2219953 0.1888412 0.1401099 0.1362916
cDC1 0.0075758 0.0018553 0.0044444 0.0043860 0.0019231 0.0000000 0.0000000 0.0186916 0.0125945 0.0133333 0.0044004 0.0073041 0.0040816 0.0151515 0.0000000 0.0000000 0.0020534 0.0000000 0.0302307 0.0020325 0.0049751 0.0118505 0.0000000 0.0000000 0.0120482 0.0050761 0.0079365 0.0000000 0.0134804 0.0000000 0.0105263 0.0000000 0.0000000 0.0000000 0.0059347 0.0039139 0.0054348 0.0062457 0.0012430 0.0036934 0.0053419 0.0110852 0.0107296 0.0082418 0.0095087
cDC2 0.0189394 0.0092764 0.0133333 0.1666667 0.1961538 0.2340426 0.0024155 0.0809969 0.0302267 0.0266667 0.0231023 0.1985392 0.2122449 0.1401515 0.1338583 0.1250000 0.1149897 0.1620690 0.0326173 0.0569106 0.1492537 0.0911577 0.4974359 0.4961240 0.4016064 0.1404399 0.1706349 0.1683992 0.1727941 0.0842697 0.0596491 0.0507614 0.0000000 0.0283019 0.0326409 0.1330724 0.1156832 0.0555170 0.0379117 0.1735919 0.0213675 0.1330222 0.0364807 0.0192308 0.0174326
ciliated epithelial cells 0.3371212 0.0389610 0.0000000 0.0146199 0.0538462 0.0425532 0.3019324 0.0903427 0.1209068 0.0933333 0.1903190 0.0152722 0.0081633 0.0151515 0.1968504 0.0164474 0.1334702 0.0206897 0.0023866 0.0081301 0.0000000 0.0373747 0.0461538 0.0542636 0.0361446 0.0338409 0.0674603 0.0353430 0.0122549 0.0842697 0.0245614 0.0456853 0.0232558 0.0188679 0.0771513 0.0215264 0.0240683 0.0111034 0.0242387 0.0313943 0.0016026 0.0137106 0.0128755 0.0137363 0.0063391
dividing innate cells 0.0000000 0.0018553 0.0044444 0.0131579 0.0076923 0.0212766 0.0253623 0.0062305 0.0000000 0.0000000 0.0121012 0.0079681 0.0081633 0.0000000 0.0000000 0.0032895 0.0102669 0.0103448 0.0007955 0.0000000 0.0049751 0.0063810 0.0102564 0.0000000 0.0040161 0.0016920 0.0019841 0.0103950 0.0036765 0.0000000 0.0000000 0.0050761 0.0000000 0.0094340 0.0089021 0.0254403 0.0069876 0.0034698 0.0074580 0.0092336 0.0016026 0.0067095 0.0000000 0.0000000 0.0007924
gamma delta T cells 0.0000000 0.0037106 0.0133333 0.0043860 0.0038462 0.0000000 0.0000000 0.0093458 0.0100756 0.0000000 0.0000000 0.0019920 0.0081633 0.0037879 0.0118110 0.0032895 0.0000000 0.0000000 0.0493238 0.0284553 0.0049751 0.0027347 0.0000000 0.0000000 0.0000000 0.0016920 0.0000000 0.0020790 0.0000000 0.0168539 0.0000000 0.0000000 0.0000000 0.0094340 0.0296736 0.0019569 0.0108696 0.0000000 0.0292107 0.0101570 0.0133547 0.0037923 0.0021459 0.0000000 0.0071315
HSP+ B cells 0.0000000 0.0000000 0.0000000 0.0000000 0.0019231 0.0000000 0.0000000 0.0031153 0.0000000 0.0000000 0.0429043 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0016920 0.0000000 0.0270270 0.0000000 0.0000000 0.0000000 0.0050761 0.0000000 0.0000000 0.0000000 0.0410959 0.0007764 0.0013879 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
innate lymphocytes 0.0265152 0.2374768 0.0755556 0.0423977 0.0500000 0.1276596 0.0205314 0.0467290 0.0176322 0.1155556 0.0275028 0.0285525 0.0775510 0.0643939 0.0433071 0.0164474 0.0266940 0.0241379 0.0747812 0.0569106 0.0099502 0.0282589 0.0051282 0.0077519 0.0281124 0.0304569 0.0416667 0.0041580 0.0612745 0.0224719 0.0315789 0.0253807 0.0116279 0.0094340 0.0356083 0.0078278 0.0194099 0.0263706 0.0391548 0.0618652 0.1778846 0.0361727 0.0515021 0.1043956 0.0174326
mast cells 0.0000000 0.0000000 0.0000000 0.0029240 0.0019231 0.0000000 0.0024155 0.0000000 0.0000000 0.0000000 0.0110011 0.0006640 0.0163265 0.0113636 0.0078740 0.0000000 0.0205339 0.0000000 0.0015911 0.0101626 0.0000000 0.0218778 0.0000000 0.0000000 0.0080321 0.0033841 0.0039683 0.0062370 0.0000000 0.0000000 0.0000000 0.0050761 0.0116279 0.0000000 0.0059347 0.0019569 0.0007764 0.0117974 0.0000000 0.0000000 0.0000000 0.0000000 0.0021459 0.0000000 0.0000000
migratory DC 0.0000000 0.0018553 0.0000000 0.0263158 0.0057692 0.0425532 0.0000000 0.0186916 0.0000000 0.0000000 0.0055006 0.0086321 0.0448980 0.0151515 0.0157480 0.0263158 0.0143737 0.0103448 0.0143198 0.0060976 0.0149254 0.0227894 0.0974359 0.1860465 0.1004016 0.0253807 0.0079365 0.0166320 0.0404412 0.0000000 0.0035088 0.0000000 0.0000000 0.0000000 0.0000000 0.0234834 0.0147516 0.0055517 0.0012430 0.0258541 0.0000000 0.0256709 0.0000000 0.0000000 0.0023772
monocytes 0.1022727 0.0092764 0.0222222 0.1096491 0.2461538 0.1276596 0.0096618 0.1090343 0.0176322 0.0400000 0.0110011 0.2881806 0.1306122 0.0984848 0.0944882 0.2565789 0.0369610 0.2172414 0.0262530 0.0386179 0.2288557 0.0209663 0.0820513 0.0697674 0.1244980 0.1827411 0.1805556 0.0831601 0.1176471 0.0955056 0.1649123 0.0812183 0.1627907 0.1415094 0.0474777 0.1585127 0.0962733 0.5954198 0.0012430 0.0286242 0.0299145 0.0755543 0.0708155 0.1263736 0.0491284
neutrophil-like 0.0000000 0.0000000 0.0000000 0.0307018 0.0153846 0.0000000 0.0000000 0.0031153 0.0000000 0.0000000 0.0121012 0.0039841 0.0040816 0.0113636 0.0000000 0.0098684 0.0205339 0.0068966 0.0023866 0.0060976 0.0099502 0.0446673 0.0256410 0.0542636 0.0361446 0.0186125 0.0059524 0.3409563 0.0159314 0.0056180 0.0070175 0.0152284 0.0000000 0.0094340 0.0000000 0.0645793 0.0372671 0.0027759 0.0174021 0.0101570 0.0021368 0.0020420 0.0000000 0.0000000 0.0000000
NK cells 0.0416667 0.0575139 0.0844444 0.0321637 0.0461538 0.0000000 0.0072464 0.0342679 0.0277078 0.0355556 0.0176018 0.0099602 0.0204082 0.0113636 0.0078740 0.0000000 0.0143737 0.0241379 0.0588703 0.0264228 0.0248756 0.0154968 0.0153846 0.0000000 0.0040161 0.0169205 0.0119048 0.0062370 0.0147059 0.0056180 0.0070175 0.0152284 0.0581395 0.0188679 0.0089021 0.0000000 0.0077640 0.0111034 0.0298322 0.0350877 0.0320513 0.0157526 0.0257511 0.0082418 0.0736926
NK-T cells 0.0000000 0.0278293 0.0044444 0.0029240 0.0019231 0.0000000 0.0036232 0.0062305 0.0075567 0.0044444 0.0022002 0.0000000 0.0040816 0.0113636 0.0000000 0.0032895 0.0041068 0.0034483 0.0031822 0.0000000 0.0000000 0.0027347 0.0000000 0.0000000 0.0000000 0.0033841 0.0119048 0.0000000 0.0024510 0.0056180 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0031056 0.0000000 0.0043505 0.0009234 0.0021368 0.0023337 0.0021459 0.0013736 0.0071315
plasma B cells 0.0151515 0.0000000 0.0000000 0.0029240 0.0000000 0.0000000 0.0108696 0.0000000 0.0025189 0.0000000 0.0110011 0.0019920 0.0040816 0.0037879 0.0000000 0.0000000 0.0020534 0.0034483 0.0000000 0.0000000 0.0000000 0.0027347 0.0000000 0.0000000 0.0040161 0.0016920 0.0000000 0.0000000 0.0000000 0.0000000 0.0035088 0.0000000 0.0000000 0.0000000 0.0118694 0.0156556 0.0023292 0.0013879 0.0074580 0.0009234 0.0000000 0.0040840 0.0000000 0.0000000 0.0023772
plasmacytoid DC 0.0606061 0.1113173 0.0444444 0.0160819 0.0153846 0.0212766 0.0024155 0.0467290 0.0680101 0.0088889 0.0374037 0.0305445 0.0081633 0.0075758 0.0078740 0.0032895 0.0102669 0.0655172 0.0326173 0.0040650 0.0099502 0.0145852 0.0102564 0.0000000 0.0321285 0.0135364 0.0773810 0.0311850 0.0147059 0.0337079 0.0350877 0.0101523 0.0465116 0.0471698 0.0237389 0.0078278 0.0046584 0.0034698 0.0000000 0.0203139 0.0048077 0.0093349 0.0300429 0.0384615 0.0150555
proliferating T/NK 0.0189394 0.0166976 0.0133333 0.0073099 0.0096154 0.0000000 0.0120773 0.0186916 0.0226700 0.0311111 0.0011001 0.0053121 0.0040816 0.0000000 0.0000000 0.0164474 0.0000000 0.0068966 0.0190931 0.0040650 0.0099502 0.0036463 0.0000000 0.0077519 0.0080321 0.0084602 0.0138889 0.0020790 0.0036765 0.0112360 0.0140351 0.0101523 0.0232558 0.0283019 0.0059347 0.0019569 0.0116460 0.0041638 0.0037290 0.0036934 0.0197650 0.0020420 0.0150215 0.0123626 0.0126783
secretory epithelial cells 0.0454545 0.0500928 0.0088889 0.0029240 0.0134615 0.0638298 0.1159420 0.0155763 0.0226700 0.0222222 0.0440044 0.0059761 0.0000000 0.0113636 0.0708661 0.0000000 0.0102669 0.0068966 0.0000000 0.0000000 0.0000000 0.0054695 0.0256410 0.0387597 0.0281124 0.0456853 0.0317460 0.0124740 0.0049020 0.0393258 0.0105263 0.0203046 0.0465116 0.0377358 0.0415430 0.0000000 0.0038820 0.0069396 0.0385333 0.0424746 0.0389957 0.0107935 0.0107296 0.0041209 0.0023772

Cell type proportions by sample

Create sample meta data table.

seu@meta.data %>%
  dplyr::select(sample.id,
                Participant,
                Disease,
                Treatment,
                Severity,
                Group,
                Group_severity,
                Batch, 
                Age, 
                Sex) %>%
     left_join(props$Counts %>% 
                 data.frame %>%
                 group_by(sample) %>%
                 summarise(ncells = sum(Freq)),
               by = c("sample.id" = "sample")) %>%
    distinct() -> info

head(info) %>% knitr::kable()
sample.id Participant Disease Treatment Severity Group Group_severity Batch Age Sex ncells
sample_33.1 sample_33 CF treated (ivacaftor) severe CF.IVA CF.IVA.S 1 5.950685 M 1097
sample_25.1 sample_25 CF untreated severe CF.NO_MOD CF.NO_MOD.S 1 4.910000 F 245
sample_29.1 sample_29 CF untreated severe CF.NO_MOD CF.NO_MOD.S 1 5.989041 F 487
sample_27.1 sample_27 CF treated (ivacaftor) mild CF.IVA CF.IVA.M 1 4.917808 M 254
sample_32.1 sample_32 CF untreated mild CF.NO_MOD CF.NO_MOD.M 1 5.926027 F 201
sample_26.1 sample_26 CF untreated mild CF.NO_MOD CF.NO_MOD.M 1 5.049315 M 264
props$Proportions %>%
  data.frame %>%
  left_join(info, 
             by = c("sample" = "sample.id")) %>%
ggplot(aes(x = sample, y = Freq, fill = clusters)) +
  geom_bar(stat = "identity", color = "black", size = 0.1) +
  theme(axis.text.x = element_text(angle = 90,
                                   vjust = 0.5,
                                   hjust = 1),
        legend.text = element_text(size = 8),
        legend.position = "bottom") +
  labs(y = "Proportion", fill = "Cell Label") +
  facet_grid(~Group, scales = "free_x", space = "free_x")

No. cells per sample

info %>%
ggplot(aes(x = sample.id, y = ncells, fill = Disease)) +
  geom_bar(stat = "identity") +
  theme(axis.text.x = element_text(angle = 90,
                                   vjust = 0.5,
                                   hjust = 1),
        legend.text = element_text(size = 8),
        legend.position = "bottom") +
  labs(y = "No. cells", fill = "Disease") +
  facet_grid(~Group, scales = "free_x", space = "free_x") +
  geom_hline(yintercept = 100, linetype = "dashed")

Cell proportions by cell type

props$Proportions %>%
  data.frame %>%
  left_join(info, 
             by = c("sample" = "sample.id")) %>%
ggplot(aes(x = clusters, y = Freq, fill = clusters)) +
  geom_boxplot(outlier.size = 0.1, size = 0.25) +
  theme(axis.text.x = element_text(angle = 45,
                                   vjust = 1,
                                   hjust = 1),
        legend.text = element_text(size = 8)) +
  labs(y = "Proportion") +
  NoLegend()

Explore sources of variation

Cell count data

Look at the sources of variation in the raw cell count level data.

dims <- list(c(1,2), c(2:3), c(3,4), c(4,5))
p <- vector("list", length(dims))

for(i in 1:length(dims)){
  mds <- plotMDS(props$Counts,
    gene.selection = "common",
    plot = FALSE, dim.plot = dims[[i]])
  
  data.frame(x = mds$x, 
             y = mds$y,
             sample = rownames(mds$distance.matrix.squared)) %>%
    left_join(info, 
             by = c("sample" = "sample.id")) %>%
    distinct() -> dat
  
  p[[i]] <- ggplot(dat, aes(x = x, y = y, 
                            shape = as.factor(Disease),
                            color = as.factor(Batch))) +
    geom_point(size = 3) +
    labs(x = glue("Principal Component {dims[[i]][1]}"),
         y = glue("Principal Component {dims[[i]][2]}"),
         colour = "Batch",
         shape = "Disease") +
    theme(legend.direction = "horizontal",
          legend.text = element_text(size = 8),
          legend.title = element_text(size = 9),
          axis.text = element_text(size = 8),
          axis.title = element_text(size = 9)) 
}

wrap_plots(p, cols = 2) + plot_layout(guides = "collect") &
  theme(legend.position = "bottom") 

dims <- list(c(1,2), c(2:3), c(3,4), c(4,5))
p <- vector("list", length(dims))

for(i in 1:length(dims)){
  mds <- plotMDS(props$Counts, 
                 gene.selection = "common",
                 plot = FALSE, dim.plot = dims[[i]])
  
  data.frame(x = mds$x, 
             y = mds$y,
             sample = rownames(mds$distance.matrix.squared)) %>%
    left_join(info, 
             by = c("sample" = "sample.id")) %>%
    distinct() -> dat
  
  p[[i]] <- ggplot(dat, aes(x = x, y = y, 
                            colour = log2(ncells)))+
    geom_text(aes(label = str_remove_all(sample, "sample_")), size = 2.5) +
    labs(x = glue("Principal Component {dims[[i]][1]}"),
         y = glue("Principal Component {dims[[i]][2]}"),
         colour = "Log2 No. Cells") +
    theme(legend.direction = "horizontal",
          legend.text = element_text(size = 8),
          legend.title = element_text(size = 9),
          axis.text = element_text(size = 8),
          axis.title = element_text(size = 9)) +
    scale_colour_viridis_c(option = "magma")
}

wrap_plots(p, cols = 2) + plot_layout(guides = "collect") &
  theme(legend.position = "bottom") 

Cell proportion data

Look at the sources of variation in the cell proportions data.

dims <- list(c(1,2), c(2:3), c(3,4), c(4,5))
p <- vector("list", length(dims))

for(i in 1:length(dims)){
  mds <- plotMDS(props$TransformedProps,
    gene.selection = "common",
    plot = FALSE, dim.plot = dims[[i]])
  
  data.frame(x = mds$x, 
             y = mds$y,
             sample = rownames(mds$distance.matrix.squared)) %>%
    left_join(info, 
             by = c("sample" = "sample.id")) %>%
    distinct() -> dat
  
  p[[i]] <- ggplot(dat, aes(x = x, y = y, 
                            shape = as.factor(Disease),
                            color = as.factor(Batch)))+
    geom_point(size = 3) +
    labs(x = glue("Principal Component {dims[[i]][1]}"),
         y = glue("Principal Component {dims[[i]][2]}"),
         colour = "Batch",
         shape = "Disease") +
    theme(legend.direction = "horizontal",
          legend.text = element_text(size = 8),
          legend.title = element_text(size = 9),
          axis.text = element_text(size = 8),
          axis.title = element_text(size = 9))
}

wrap_plots(p, cols = 2) + plot_layout(guides = "collect") &
  theme(legend.position = "bottom") 

dims <- list(c(1,2), c(2:3), c(3,4), c(4,5))
p <- vector("list", length(dims))

for(i in 1:length(dims)){
  mds <- plotMDS(props$TransformedProps,
    gene.selection = "common",
    plot = FALSE, dim.plot = dims[[i]])
  
  data.frame(x = mds$x, 
             y = mds$y,
             sample = rownames(mds$distance.matrix.squared)) %>%
    left_join(info, 
             by = c("sample" = "sample.id")) %>%
    distinct() -> dat
  
  p[[i]] <- ggplot(dat, aes(x = x, y = y, 
                            shape = as.factor(Disease),
                            color = Sex))+
    geom_point(size = 3) +
    labs(x = glue("Principal Component {dims[[i]][1]}"),
         y = glue("Principal Component {dims[[i]][2]}"),
         colour = "Sex",
         shape = "Disease") +
    theme(legend.direction = "horizontal",
          legend.text = element_text(size = 8),
          legend.title = element_text(size = 9),
          axis.text = element_text(size = 8),
          axis.title = element_text(size = 9))
}

wrap_plots(p, cols = 2) + plot_layout(guides = "collect") &
  theme(legend.position = "bottom") 

dims <- list(c(1,2), c(2:3), c(3,4), c(4,5))
p <- vector("list", length(dims))

for(i in 1:length(dims)){
  mds <- plotMDS(props$TransformedProps, 
                 gene.selection = "common",
                 plot = FALSE, dim.plot = dims[[i]])
  
   data.frame(x = mds$x, 
             y = mds$y,
             sample = rownames(mds$distance.matrix.squared)) %>%
    left_join(info, 
             by = c("sample" = "sample.id")) %>%
    distinct() -> dat
  
  p[[i]] <- ggplot(dat, aes(x = x, y = y, 
                            colour = log2(Age)))+
    geom_text(aes(label = str_remove_all(sample, "sample_")), size = 2.5) +
    labs(x = glue("Principal Component {dims[[i]][1]}"),
         y = glue("Principal Component {dims[[i]][2]}"),
         colour = "Log2 Age") +
    theme(legend.direction = "horizontal",
          legend.text = element_text(size = 8),
          legend.title = element_text(size = 9),
          axis.text = element_text(size = 8),
          axis.title = element_text(size = 9)) +
    scale_colour_viridis_c(option = "magma")
}

wrap_plots(p, cols = 2) + plot_layout(guides = "collect") &
  theme(legend.position = "bottom") 

dims <- list(c(1,2), c(2:3), c(3,4), c(4,5))
p <- vector("list", length(dims))

for(i in 1:length(dims)){
  mds <- plotMDS(props$TransformedProps, 
                 gene.selection = "common",
                 plot = FALSE, dim.plot = dims[[i]])
  
  data.frame(x = mds$x, 
             y = mds$y,
             sample = rownames(mds$distance.matrix.squared)) %>%
    left_join(info, 
             by = c("sample" = "sample.id")) %>%
    distinct() -> dat
  
  p[[i]] <- ggplot(dat, aes(x = x, y = y, 
                            colour = log2(ncells)))+
    geom_text(aes(label = str_remove_all(sample, "sample_")), size = 2.5) +
    labs(x = glue("Principal Component {dims[[i]][1]}"),
         y = glue("Principal Component {dims[[i]][2]}"),
         colour = "Log2 No. Cells") +
    theme(legend.direction = "horizontal",
          legend.text = element_text(size = 8),
          legend.title = element_text(size = 9),
          axis.text = element_text(size = 8),
          axis.title = element_text(size = 9)) +
    scale_colour_viridis_c(option = "magma")
}

wrap_plots(p, cols = 2) + plot_layout(guides = "collect") &
  theme(legend.position = "bottom") 

Principal components versus traits

Principal components analysis (PCA) allows us to mathematically determine the sources of variation in the data. We can then investigate whether these correlate with any of the specifed covariates. First, we calculate the principal components. The scree plot belows shows us that most of the variation in this data is captured by the top 7 principal components.

PCs <- prcomp(t(props$TransformedProps), center = TRUE, 
              scale = TRUE, retx = TRUE)
loadings = PCs$x # pc loadings
plot(PCs, type="lines") # scree plot

Collect all of the known sample traits.

nGenes = nrow(props$TransformedProps)
nSamples = ncol(props$TransformedProps)

m <- match(colnames(props$TransformedProps), info$sample.id)
info <- info[m,]

datTraits <- info %>% dplyr::select(Participant, Batch, Disease, Treatment,
                                    Group, Severity, Age, Sex, ncells) %>%
  mutate(Age = log2(Age),
         ncells = log2(ncells),
    Donor = factor(Participant),
         Batch = factor(Batch),
         Disease = factor(Disease, 
                          labels = 1:length(unique(Disease))),
         Group = factor(Group, 
                        labels = 1:length(unique(Group))),
         Treatment = factor(Treatment, 
                            labels = 1:length(unique(Treatment))),
         Sex = factor(Sex, labels = length(unique(Sex))),
         Severity = factor(Severity, labels = length(unique(Severity)))) %>%
  mutate(across(everything(), as.numeric)) %>%
  dplyr::select(-Participant)

datTraits %>% 
  knitr::kable()
Batch Disease Treatment Group Severity Age Sex ncells Donor
19 4 2 1 4 1 -0.2590872 2 8.044394 1
18 4 1 4 3 2 -0.0939001 2 9.074141 2
16 4 1 4 3 2 -0.1151479 1 7.813781 3
24 5 1 4 3 2 -0.0441471 1 9.417853 4
27 5 1 4 3 2 0.1428834 2 9.022368 5
33 6 1 4 3 2 -0.0729608 1 5.554589 6
17 4 2 1 4 1 0.1464588 2 9.693487 7
32 6 1 4 3 3 0.5597097 2 8.326429 8
22 4 1 4 3 3 1.5743836 1 8.632995 9
23 4 1 2 1 2 1.5993830 2 7.813781 10
31 6 1 4 3 3 1.9720631 1 9.828136 11
28 6 1 2 1 2 2.3883594 2 10.556506 12
2 2 1 4 3 3 2.2957230 1 7.936638 13
6 2 1 4 3 2 2.3360877 2 8.044394 14
4 2 1 2 1 2 2.2980155 2 7.988685 15
29 6 1 4 3 2 2.5790214 1 8.247927 16
3 2 1 4 3 3 2.5823250 1 8.927778 17
30 6 2 1 4 1 0.1321035 2 8.179909 18
7 2 1 4 3 3 2.5889097 1 10.295769 19
8 2 1 4 3 2 2.5583683 1 8.942514 20
5 2 1 4 3 2 2.5670653 1 7.651052 21
1 2 1 2 1 3 2.5730557 2 10.099348 22
40 7 1 4 3 2 -0.9343238 1 7.607330 23
41 7 1 4 3 2 0.0918737 1 7.011227 23
34 7 1 4 3 2 1.0409164 1 7.960002 23
35 7 1 4 3 2 0.0807044 2 9.207014 24
39 7 1 4 3 2 0.9940589 2 8.977280 24
38 7 1 4 3 3 -0.0564254 1 8.909893 25
37 7 1 3 2 3 1.1764977 1 9.672425 25
10 3 1 4 3 2 1.5597097 1 7.475733 26
9 3 1 3 2 2 2.1930156 1 8.154818 26
11 3 1 3 2 2 2.2980155 1 7.622052 26
14 3 1 2 1 2 1.5703964 2 6.426265 27
15 3 1 2 1 2 2.0206033 2 6.727920 27
13 3 1 2 1 2 2.3485584 2 8.396605 27
26 5 1 4 3 2 1.9730702 1 8.997179 28
25 5 1 3 2 2 2.6297159 1 10.330917 28
36 7 2 1 4 1 0.2923784 2 10.492855 29
42 1 1 4 3 3 1.5801455 2 10.651949 30
43 1 1 4 3 2 1.5801455 2 10.080818 31
45 1 1 2 1 3 1.5993178 2 10.870365 32
44 1 2 1 4 1 1.5849625 2 11.743151 33
12 3 2 1 4 1 3.0699187 1 8.864186 34
20 4 2 1 4 1 2.4204621 2 9.507795 35
21 4 2 1 4 1 2.2356012 1 10.301496 36

Correlate known sample traits with the top 10 principal components. This can help us determine which traits are potentially contributing to the main sources of variation in the data and should thus be included in our statistical analysis.

moduleTraitCor <- suppressWarnings(cor(loadings[, 1:10], datTraits, use = "p"))
moduleTraitPvalue <- WGCNA::corPvalueStudent(moduleTraitCor, (nSamples - 2))

textMatrix <- paste(signif(moduleTraitCor, 2), "\n(", 
                    signif(moduleTraitPvalue, 1), ")", sep = "")
dim(textMatrix) <- dim(moduleTraitCor)

## Display the correlation values within a heatmap plot
par(cex=0.75, mar = c(6, 8.5, 3, 3))
WGCNA::labeledHeatmap(Matrix = t(moduleTraitCor),
                      xLabels = colnames(loadings)[1:10],
                      yLabels = names(datTraits),
                      colorLabels = FALSE,
                      colors = WGCNA::blueWhiteRed(6),
                      textMatrix = t(textMatrix),
                      setStdMargins = FALSE,
                      cex.text = 1,
                      zlim = c(-1,1),
                      main = paste("PCA-trait relationships: Top 10 PCs"))

Statistical analysis using propeller and limma

Create the design matrix.

group <- factor(info$Group_severity)
participant <- factor(info$Participant)
age <- log2(info$Age)
batch <- factor(info$Batch)
sex <- factor(info$Sex)

design <- model.matrix(~ 0 + group + batch + age + sex)
colnames(design)[1:7] <- levels(group) 
design
   CF.IVA.M CF.IVA.S CF.LUMA_IVA.M CF.LUMA_IVA.S CF.NO_MOD.M CF.NO_MOD.S
1         0        0             0             0           0           0
2         0        0             0             0           1           0
3         0        0             0             0           1           0
4         0        0             0             0           1           0
5         0        0             0             0           1           0
6         0        0             0             0           1           0
7         0        0             0             0           0           0
8         0        0             0             0           0           1
9         0        0             0             0           0           1
10        1        0             0             0           0           0
11        0        0             0             0           0           1
12        1        0             0             0           0           0
13        0        0             0             0           0           1
14        0        0             0             0           1           0
15        1        0             0             0           0           0
16        0        0             0             0           1           0
17        0        0             0             0           0           1
18        0        0             0             0           0           0
19        0        0             0             0           0           1
20        0        0             0             0           1           0
21        0        0             0             0           1           0
22        0        1             0             0           0           0
23        0        0             0             0           1           0
24        0        0             0             0           1           0
25        0        0             0             0           1           0
26        0        0             0             0           1           0
27        0        0             0             0           1           0
28        0        0             0             0           0           1
29        0        0             0             1           0           0
30        0        0             0             0           1           0
31        0        0             1             0           0           0
32        0        0             1             0           0           0
33        1        0             0             0           0           0
34        1        0             0             0           0           0
35        1        0             0             0           0           0
36        0        0             0             0           1           0
37        0        0             1             0           0           0
38        0        0             0             0           0           0
39        0        0             0             0           0           1
40        0        0             0             0           1           0
41        0        1             0             0           0           0
42        0        0             0             0           0           0
43        0        0             0             0           0           0
44        0        0             0             0           0           0
45        0        0             0             0           0           0
   NON_CF.CTRL batch1 batch2 batch3 batch4 batch5 batch6         age sexM
1            1      0      0      1      0      0      0 -0.25908722    1
2            0      0      0      1      0      0      0 -0.09390014    1
3            0      0      0      1      0      0      0 -0.11514787    0
4            0      0      0      0      1      0      0 -0.04414710    0
5            0      0      0      0      1      0      0  0.14288337    1
6            0      0      0      0      0      1      0 -0.07296080    0
7            1      0      0      1      0      0      0  0.14645883    1
8            0      0      0      0      0      1      0  0.55970971    1
9            0      0      0      1      0      0      0  1.57438357    0
10           0      0      0      1      0      0      0  1.59938302    1
11           0      0      0      0      0      1      0  1.97206312    0
12           0      0      0      0      0      1      0  2.38835941    1
13           0      1      0      0      0      0      0  2.29572302    0
14           0      1      0      0      0      0      0  2.33608770    1
15           0      1      0      0      0      0      0  2.29801547    1
16           0      0      0      0      0      1      0  2.57902140    0
17           0      1      0      0      0      0      0  2.58232503    0
18           1      0      0      0      0      1      0  0.13210354    1
19           0      1      0      0      0      0      0  2.58890969    0
20           0      1      0      0      0      0      0  2.55836829    0
21           0      1      0      0      0      0      0  2.56706530    0
22           0      1      0      0      0      0      0  2.57305573    1
23           0      0      0      0      0      0      1 -0.93432383    0
24           0      0      0      0      0      0      1  0.09187369    0
25           0      0      0      0      0      0      1  1.04091644    0
26           0      0      0      0      0      0      1  0.08070438    1
27           0      0      0      0      0      0      1  0.99405890    1
28           0      0      0      0      0      0      1 -0.05642543    0
29           0      0      0      0      0      0      1  1.17649766    0
30           0      0      1      0      0      0      0  1.55970971    0
31           0      0      1      0      0      0      0  2.19301559    0
32           0      0      1      0      0      0      0  2.29801547    0
33           0      0      1      0      0      0      0  1.57039639    1
34           0      0      1      0      0      0      0  2.02060327    1
35           0      0      1      0      0      0      0  2.34855840    1
36           0      0      0      0      1      0      0  1.97307024    0
37           0      0      0      0      1      0      0  2.62971590    0
38           1      0      0      0      0      0      1  0.29237837    1
39           0      0      0      0      0      0      0  1.58014548    1
40           0      0      0      0      0      0      0  1.58014548    1
41           0      0      0      0      0      0      0  1.59931779    1
42           1      0      0      0      0      0      0  1.58496250    1
43           1      0      1      0      0      0      0  3.06991870    0
44           1      0      0      1      0      0      0  2.42046210    1
45           1      0      0      1      0      0      0  2.23560118    0
attr(,"assign")
 [1] 1 1 1 1 1 1 1 2 2 2 2 2 2 3 4
attr(,"contrasts")
attr(,"contrasts")$group
[1] "contr.treatment"

attr(,"contrasts")$batch
[1] "contr.treatment"

attr(,"contrasts")$sex
[1] "contr.treatment"

Create the contrast matrix.

contr <- makeContrasts(CF.NO_MODvNON_CF.CTRL = 0.5*(CF.NO_MOD.M + CF.NO_MOD.S) - NON_CF.CTRL,
                       CF.IVAvCF.NO_MOD = 0.5*(CF.IVA.S + CF.IVA.M) - 0.5*(CF.NO_MOD.S + CF.NO_MOD.M),
                       CF.LUMA_IVAvCF.NO_MOD = 0.5*(CF.LUMA_IVA.S + CF.LUMA_IVA.M) - 0.5*(CF.NO_MOD.S + CF.NO_MOD.M),
                       CF.NO_MOD.SvCF.NO_MOD.M = CF.NO_MOD.S - CF.NO_MOD.M,
                       levels = design)
contr
               Contrasts
Levels          CF.NO_MODvNON_CF.CTRL CF.IVAvCF.NO_MOD CF.LUMA_IVAvCF.NO_MOD
  CF.IVA.M                        0.0              0.5                   0.0
  CF.IVA.S                        0.0              0.5                   0.0
  CF.LUMA_IVA.M                   0.0              0.0                   0.5
  CF.LUMA_IVA.S                   0.0              0.0                   0.5
  CF.NO_MOD.M                     0.5             -0.5                  -0.5
  CF.NO_MOD.S                     0.5             -0.5                  -0.5
  NON_CF.CTRL                    -1.0              0.0                   0.0
  batch1                          0.0              0.0                   0.0
  batch2                          0.0              0.0                   0.0
  batch3                          0.0              0.0                   0.0
  batch4                          0.0              0.0                   0.0
  batch5                          0.0              0.0                   0.0
  batch6                          0.0              0.0                   0.0
  age                             0.0              0.0                   0.0
  sexM                            0.0              0.0                   0.0
               Contrasts
Levels          CF.NO_MOD.SvCF.NO_MOD.M
  CF.IVA.M                            0
  CF.IVA.S                            0
  CF.LUMA_IVA.M                       0
  CF.LUMA_IVA.S                       0
  CF.NO_MOD.M                        -1
  CF.NO_MOD.S                         1
  NON_CF.CTRL                         0
  batch1                              0
  batch2                              0
  batch3                              0
  batch4                              0
  batch5                              0
  batch6                              0
  age                                 0
  sexM                                0

Add random effect for samples from the same individual.

dupcor <- duplicateCorrelation(props$TransformedProps, design=design,
                                block=participant)
dupcor
$consensus.correlation
[1] 0.3277853

$cor
[1] 0.3277853

$atanh.correlations
 [1]  0.7768632  0.9562918  0.3072309 -0.4701327  1.4513133  0.4547148
 [7]  0.3994249  1.0196590  1.1708055 -0.5159576 -0.5360603  0.8789047
[13]  1.2095895 -0.1972817 -0.5360603 -0.1313298  1.4752100 -0.5360603
[19]  0.6293269  0.7180931  0.9682816  0.4294997  0.0973840 -0.3852555
[25] -0.3808671 -0.5360603  0.9117043

Fit the model.

fit <- lmFit(props$TransformedProps, design=design, block=participant, 
                correlation=dupcor$consensus)
fit2 <- contrasts.fit(fit, contr)
fit2 <- eBayes(fit2, robust=TRUE, trend=FALSE)
pvalue <- 0.05
summary(decideTests(fit2, p.value = pvalue))
       CF.NO_MODvNON_CF.CTRL CF.IVAvCF.NO_MOD CF.LUMA_IVAvCF.NO_MOD
Down                       0                0                     0
NotSig                    27               27                    27
Up                         0                0                     0
       CF.NO_MOD.SvCF.NO_MOD.M
Down                         0
NotSig                      27
Up                           0

Results

p <- vector("list", ncol(contr))

for(i in 1:ncol(contr)){
  print(knitr::kable(topTable(fit2, coef = i, number = Inf),
                     caption = colnames(contr)[i]))
  
  props$Proportions %>% data.frame %>%
    left_join(info,
              by = c("sample" = "sample.id")) %>%
    mutate(Group = Group_severity) %>%
    dplyr::filter(Group %in% names(contr[,i])[abs(contr[, i]) > 0]) -> dat
  
  if(length(unique(dat$Group)) > 2) dat$Group <- str_remove(dat$Group, ".(M|S)$")
  ggplot(dat, aes(x = Group,
                  y = Freq,
                  colour = Group,
                  group = Group)) +
    geom_jitter(stat = "identity",
                width = 0.15,
                size = 2) +
    stat_summary(geom = "point",
      fun.y = "mean",
      col = "black",
      shape = "_",
      size = 14) +
    theme_classic() +
    theme(axis.text.x = element_text(angle = 90,
                                     hjust = 1,
                                     vjust = 0.5),
          legend.position = "bottom",
          legend.direction = "horizontal") +
    labs(x = "Group", y = "Proportion",
         colour = "Condition") +
    facet_wrap(~clusters, scales = "free_y", ncol = 4) +
    ggtitle(colnames(contr)[i]) -> p[[i]]
  
  print(p[[i]])
}
CF.NO_MODvNON_CF.CTRL
logFC AveExpr t P.Value adj.P.Val B
CD4 T-NFKB 0.0847007 0.1287793 2.8538852 0.0072978 0.1282161 -2.429406
monocytes -0.1632164 0.3123190 -2.7509825 0.0094975 0.1282161 -2.650007
NK-T cells 0.0486813 0.0408610 2.5379077 0.0158943 0.1303471 -3.081849
CD4 T-reg 0.0554120 0.1286141 2.4558708 0.0193107 0.1303471 -3.243228
gamma delta T cells 0.0494510 0.0577517 1.7135168 0.0957074 0.4464685 -4.523912
plasmacytoid DC 0.0578468 0.1424289 1.5941695 0.1201376 0.4464685 -4.695605
innate lymphocytes 0.0683991 0.1995245 1.5785830 0.1236760 0.4464685 -4.717255
CD4 T cells 0.0545011 0.3376805 1.5421157 0.1322870 0.4464685 -4.767199
CD8 T-GZMK 0.0406035 0.1365863 1.2167195 0.2320758 0.5659647 -5.167206
CD4 T-IFN 0.0339050 0.0956091 1.1903718 0.2421316 0.5659647 -5.195879
secretory epithelial cells 0.0413694 0.1310189 1.1848542 0.2442775 0.5659647 -5.201811
neutrophil-like 0.0503802 0.0939267 1.1664396 0.2515399 0.5659647 -5.221426
proliferating T/NK 0.0250960 0.0884279 1.0865341 0.2848732 0.5701673 -5.303261
CD8 T-rm -0.0517457 0.3172748 -1.0282531 0.3111704 0.5701673 -5.359474
HSP+ B cells 0.0264486 0.0190050 1.0160713 0.3167596 0.5701673 -5.370950
plasma B cells -0.0194721 0.0328307 -0.8142958 0.4211329 0.7106617 -5.541041
cDC1 0.0141421 0.0623532 0.5700950 0.5723552 0.8533862 -5.698464
CD8 T-inflammasome -0.0240626 0.2723283 -0.5456907 0.5888352 0.8533862 -5.711217
NK cells 0.0170900 0.1351729 0.5006215 0.6198575 0.8533862 -5.733327
CD4 T-naïve 0.0130592 0.1115006 0.4518533 0.6542393 0.8533862 -5.755139
ciliated epithelial cells 0.0259043 0.2001168 0.3819383 0.7049101 0.8533862 -5.782535
migratory DC -0.0115279 0.1021530 -0.3601260 0.7209767 0.8533862 -5.790180
cDC2 -0.0190291 0.3135402 -0.3521023 0.7269586 0.8533862 -5.792852
B cells -0.0220155 0.3234933 -0.3089427 0.7592711 0.8541800 -5.806303
dividing innate cells -0.0065947 0.0608827 -0.2649911 0.7926136 0.8560227 -5.818218
CD4 T-rm 0.0026089 0.0701179 0.1505950 0.8811836 0.9150753 -5.840670
mast cells -0.0003023 0.0401931 -0.0138387 0.9890394 0.9890394 -5.851302

CF.IVAvCF.NO_MOD
logFC AveExpr t P.Value adj.P.Val B
NK-T cells -0.0572207 0.0408610 -2.5330118 0.0160815 0.4342005 -3.034135
CD8 T-GZMK -0.0810316 0.1365863 -2.0618275 0.0469210 0.6334341 -3.878364
CD4 T-naïve -0.0451394 0.1115006 -1.3261927 0.1936014 0.9406935 -4.919067
plasmacytoid DC -0.0555689 0.1424289 -1.3003433 0.2022144 0.9406935 -4.948539
CD4 T-IFN 0.0334608 0.0956091 0.9975295 0.3255425 0.9406935 -5.254221
CD8 T-rm 0.0546817 0.3172748 0.9226540 0.3627605 0.9406935 -5.318150
CD8 T-inflammasome 0.0436714 0.2723283 0.8409526 0.4062402 0.9406935 -5.382661
CD4 T cells -0.0337599 0.3376805 -0.8111161 0.4229314 0.9406935 -5.404772
cDC1 -0.0231483 0.0623532 -0.7923597 0.4336358 0.9406935 -5.418281
CD4 T-rm -0.0136891 0.0701179 -0.6709533 0.5067755 0.9406935 -5.498342
gamma delta T cells -0.0227682 0.0577517 -0.6699062 0.5074345 0.9406935 -5.498977
HSP+ B cells -0.0193460 0.0190050 -0.6310791 0.5322015 0.9406935 -5.521826
plasma B cells -0.0148971 0.0328307 -0.5289833 0.6002480 0.9406935 -5.575545
B cells -0.0427921 0.3234933 -0.5098993 0.6134525 0.9406935 -5.584520
CD4 T-NFKB -0.0168516 0.1287793 -0.4821267 0.6328000 0.9406935 -5.597091
ciliated epithelial cells -0.0347923 0.2001168 -0.4355870 0.6659197 0.9406935 -5.616515
CD4 T-reg -0.0110401 0.1286141 -0.4154744 0.6804008 0.9406935 -5.624346
secretory epithelial cells 0.0137575 0.1310189 0.3345764 0.7399964 0.9406935 -5.652043
mast cells 0.0074871 0.0401931 0.2910805 0.7727551 0.9406935 -5.664483
migratory DC 0.0106213 0.1021530 0.2817408 0.7798472 0.9406935 -5.666930
neutrophil-like 0.0137353 0.0939267 0.2700294 0.7887672 0.9406935 -5.669886
NK cells -0.0093315 0.1351729 -0.2321090 0.8178424 0.9406935 -5.678600
cDC2 0.0134292 0.3135402 0.2109942 0.8341652 0.9406935 -5.682876
dividing innate cells 0.0060124 0.0608827 0.2051439 0.8386809 0.9406935 -5.683998
proliferating T/NK 0.0044502 0.0884279 0.1636007 0.8710125 0.9406935 -5.691015
innate lymphocytes -0.0049377 0.1995245 -0.0967643 0.9234808 0.9589993 -5.698991
monocytes 0.0027904 0.3123190 0.0399352 0.9683809 0.9683809 -5.702552

CF.LUMA_IVAvCF.NO_MOD
logFC AveExpr t P.Value adj.P.Val B
neutrophil-like -0.1295546 0.0939267 -2.4343057 0.0203138 0.4226372 -3.207923
HSP+ B cells -0.0720366 0.0190050 -2.2459166 0.0313065 0.4226372 -3.546189
mast cells -0.0427362 0.0401931 -1.5879729 0.1215343 0.6931957 -4.563749
innate lymphocytes 0.0832526 0.1995245 1.5593161 0.1281668 0.6931957 -4.601586
CD4 T cells 0.0639478 0.3376805 1.4684396 0.1511611 0.6931957 -4.717671
gamma delta T cells -0.0518416 0.0577517 -1.4578451 0.1540435 0.6931957 -4.730813
CD4 T-IFN 0.0459208 0.0956091 1.3084190 0.1994928 0.7694721 -4.907252
CD8 T-rm 0.0640722 0.3172748 1.0332722 0.3088506 0.9060566 -5.186823
B cells 0.0799948 0.3234933 0.9110263 0.3687660 0.9060566 -5.291434
CD4 T-naïve 0.0319332 0.1115006 0.8966884 0.3761800 0.9060566 -5.302962
cDC1 0.0255733 0.0623532 0.8366399 0.4086272 0.9060566 -5.349064
plasmacytoid DC -0.0347074 0.1424289 -0.7762404 0.4429647 0.9060566 -5.392353
CD4 T-reg 0.0191841 0.1286141 0.6900214 0.4948562 0.9060566 -5.448734
migratory DC 0.0269655 0.1021530 0.6836450 0.4988245 0.9060566 -5.452649
NK cells 0.0284515 0.1351729 0.6763840 0.5033648 0.9060566 -5.457064
plasma B cells -0.0120072 0.0328307 -0.4075032 0.6861887 0.9971132 -5.588003
CD4 T-NFKB -0.0123239 0.1287793 -0.3369898 0.7381925 0.9971132 -5.611722
ciliated epithelial cells -0.0250460 0.2001168 -0.2996953 0.7662542 0.9971132 -5.622450
proliferating T/NK -0.0075540 0.0884279 -0.2654214 0.7922849 0.9971132 -5.631232
monocytes 0.0144396 0.3123190 0.1975138 0.8446146 0.9971132 -5.645469
dividing innate cells -0.0045144 0.0608827 -0.1472177 0.8838282 0.9971132 -5.653337
secretory epithelial cells -0.0059562 0.1310189 -0.1384436 0.8907052 0.9971132 -5.654474
NK-T cells -0.0032617 0.0408610 -0.1379986 0.8910542 0.9971132 -5.654530
CD8 T-inflammasome 0.0070011 0.2723283 0.1288516 0.8982330 0.9971132 -5.655637
CD4 T-rm -0.0012765 0.0701179 -0.0597979 0.9526661 0.9971132 -5.661548
cDC2 -0.0007636 0.3135402 -0.0114669 0.9909187 0.9971132 -5.663111
CD8 T-GZMK 0.0001499 0.1365863 0.0036448 0.9971132 0.9971132 -5.663165

CF.NO_MOD.SvCF.NO_MOD.M
logFC AveExpr t P.Value adj.P.Val B
CD4 T-IFN -0.0667822 0.0956091 -2.5517560 0.0153756 0.1764439 -3.093739
CD8 T-rm -0.1154065 0.3172748 -2.4958361 0.0176380 0.1764439 -3.208159
cDC2 -0.1215812 0.3135402 -2.4483675 0.0197258 0.1764439 -3.302140
B cells 0.1523514 0.3234933 2.3267852 0.0261398 0.1764439 -3.537235
HSP+ B cells 0.0518879 0.0190050 2.1694357 0.0371204 0.2004500 -3.827852
monocytes -0.1056514 0.3123190 -1.9380249 0.0610535 0.2300316 -4.229961
neutrophil-like 0.0752961 0.0939267 1.8972970 0.0662938 0.2300316 -4.296433
ciliated epithelial cells 0.1174431 0.2001168 1.8845555 0.0681575 0.2300316 -4.317643
migratory DC -0.0495892 0.1021530 -1.6859701 0.1009434 0.2848108 -4.625669
mast cells 0.0333741 0.0401931 1.6630210 0.1054855 0.2848108 -4.659491
CD8 T-inflammasome -0.0572727 0.2723283 -1.4135512 0.1665694 0.4088520 -5.001459
NK cells 0.0394335 0.1351729 1.2571682 0.2172459 0.4784539 -5.190846
plasma B cells 0.0268340 0.0328307 1.2212811 0.2303667 0.4784539 -5.231485
cDC1 0.0250117 0.0623532 1.0973292 0.2801956 0.5403772 -5.363548
innate lymphocytes -0.0415586 0.1995245 -1.0438490 0.3039082 0.5470347 -5.416489
plasmacytoid DC 0.0275118 0.1424289 0.8251518 0.4150278 0.6424480 -5.606979
dividing innate cells 0.0186079 0.0608827 0.8137553 0.4214382 0.6424480 -5.615741
CD4 T cells 0.0254022 0.3376805 0.7822433 0.4394766 0.6424480 -5.639359
gamma delta T cells 0.0201392 0.0577517 0.7594804 0.4527903 0.6424480 -5.655861
CD4 T-naïve 0.0189718 0.1115006 0.7144105 0.4798416 0.6424480 -5.687146
NK-T cells 0.0120250 0.0408610 0.6822712 0.4996818 0.6424480 -5.708323
CD4 T-reg 0.0129865 0.1286141 0.6264053 0.5352254 0.6568676 -5.742878
CD8 T-GZMK 0.0170957 0.1365863 0.5575382 0.5808061 0.6818159 -5.781507
proliferating T/NK 0.0108688 0.0884279 0.5121304 0.6118650 0.6883481 -5.804565
CD4 T-NFKB 0.0114954 0.1287793 0.4215340 0.6760139 0.7300951 -5.844805
secretory epithelial cells 0.0074881 0.1310189 0.2334095 0.8168407 0.8482576 -5.903609
CD4 T-rm 0.0020995 0.0701179 0.1318942 0.8958441 0.8958441 -5.921353

Session info

The analysis and this document were prepared using the following software (click triangle to expand)
sessioninfo::session_info()
─ Session info ───────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.3.3 (2024-02-29)
 os       Ubuntu 22.04.4 LTS
 system   x86_64, linux-gnu
 ui       X11
 language (EN)
 collate  en_AU.UTF-8
 ctype    en_AU.UTF-8
 tz       Etc/UTC
 date     2024-12-31
 pandoc   3.1.1 @ /usr/lib/rstudio-server/bin/quarto/bin/tools/ (via rmarkdown)

─ Packages ───────────────────────────────────────────────────────────────────
 ! package              * version    date (UTC) lib source
 P abind                  1.4-5      2016-07-21 [?] RSPM (R 4.3.0)
 P AnnotationDbi        * 1.64.1     2023-11-03 [?] Bioconductor
 P backports              1.4.1      2021-12-13 [?] RSPM (R 4.3.0)
 P base64enc              0.1-3      2015-07-28 [?] RSPM (R 4.3.0)
 P Biobase              * 2.62.0     2023-10-24 [?] Bioconductor
 P BiocGenerics         * 0.48.1     2023-11-01 [?] Bioconductor
 P BiocManager            1.30.22    2023-08-08 [?] RSPM (R 4.3.0)
 P Biostrings             2.70.2     2024-01-28 [?] Bioconductor 3.18 (R 4.3.3)
 P bit                    4.0.5      2022-11-15 [?] RSPM (R 4.3.0)
 P bit64                  4.0.5      2020-08-30 [?] RSPM (R 4.3.0)
 P bitops                 1.0-7      2021-04-24 [?] RSPM (R 4.3.0)
 P blob                   1.2.4      2023-03-17 [?] RSPM (R 4.3.0)
 P bslib                  0.6.1      2023-11-28 [?] RSPM (R 4.3.0)
 P cachem                 1.0.8      2023-05-01 [?] RSPM (R 4.3.0)
 P callr                  3.7.3      2022-11-02 [?] RSPM (R 4.3.0)
 P checkmate              2.3.1      2023-12-04 [?] RSPM (R 4.3.0)
 P circlize               0.4.15     2022-05-10 [?] RSPM (R 4.3.0)
 P cli                    3.6.2      2023-12-11 [?] RSPM (R 4.3.0)
 P clue                   0.3-65     2023-09-23 [?] RSPM (R 4.3.0)
 P cluster                2.1.6      2023-12-01 [?] CRAN (R 4.3.2)
 P clustree             * 0.5.1      2023-11-05 [?] RSPM (R 4.3.0)
 P codetools              0.2-19     2023-02-01 [?] CRAN (R 4.2.2)
 P colorspace             2.1-0      2023-01-23 [?] RSPM (R 4.3.0)
 P ComplexHeatmap         2.18.0     2023-10-24 [?] Bioconductor
 P cowplot                1.1.3      2024-01-22 [?] RSPM (R 4.3.0)
 P crayon                 1.5.2      2022-09-29 [?] RSPM (R 4.3.0)
 P data.table             1.15.0     2024-01-30 [?] RSPM (R 4.3.0)
 P DBI                    1.2.1      2024-01-12 [?] RSPM (R 4.3.0)
 P DelayedArray           0.28.0     2023-10-24 [?] Bioconductor
 P deldir                 2.0-2      2023-11-23 [?] RSPM (R 4.3.0)
 P dendextend             1.17.1     2023-03-25 [?] RSPM (R 4.3.0)
 P digest                 0.6.34     2024-01-11 [?] RSPM (R 4.3.0)
 P dittoSeq             * 1.14.2     2024-02-09 [?] Bioconductor 3.18 (R 4.3.3)
 P doParallel             1.0.17     2022-02-07 [?] RSPM (R 4.3.0)
 P dplyr                * 1.1.4      2023-11-17 [?] RSPM (R 4.3.0)
 P dynamicTreeCut         1.63-1     2016-03-11 [?] RSPM (R 4.3.0)
 P edgeR                * 4.0.15     2024-02-11 [?] Bioconductor 3.18 (R 4.3.3)
 P ellipsis               0.3.2      2021-04-29 [?] RSPM (R 4.3.0)
 P evaluate               0.23       2023-11-01 [?] RSPM (R 4.3.0)
 P fansi                  1.0.6      2023-12-08 [?] RSPM (R 4.3.0)
 P farver                 2.1.1      2022-07-06 [?] RSPM (R 4.3.0)
 P fastcluster            1.2.6      2024-01-12 [?] RSPM (R 4.3.0)
 P fastmap                1.1.1      2023-02-24 [?] RSPM (R 4.3.0)
 P fitdistrplus           1.1-11     2023-04-25 [?] RSPM (R 4.3.0)
 P forcats              * 1.0.0      2023-01-29 [?] RSPM (R 4.3.0)
 P foreach                1.5.2      2022-02-02 [?] RSPM (R 4.3.0)
 P foreign                0.8-86     2023-11-28 [?] CRAN (R 4.3.2)
 P Formula                1.2-5      2023-02-24 [?] RSPM (R 4.3.0)
 P fs                     1.6.3      2023-07-20 [?] RSPM (R 4.3.0)
 P future                 1.33.1     2023-12-22 [?] RSPM (R 4.3.0)
 P future.apply           1.11.1     2023-12-21 [?] RSPM (R 4.3.0)
 P generics               0.1.3      2022-07-05 [?] RSPM (R 4.3.0)
 P GenomeInfoDb         * 1.38.6     2024-02-08 [?] Bioconductor 3.18 (R 4.3.3)
 P GenomeInfoDbData       1.2.11     2024-04-23 [?] Bioconductor
 P GenomicRanges        * 1.54.1     2023-10-29 [?] Bioconductor
 P GetoptLong             1.0.5      2020-12-15 [?] RSPM (R 4.3.0)
 P getPass                0.2-4      2023-12-10 [?] RSPM (R 4.3.0)
 P ggforce                0.4.2      2024-02-19 [?] RSPM (R 4.3.0)
 P ggplot2              * 3.5.0      2024-02-23 [?] RSPM (R 4.3.0)
 P ggraph               * 2.2.0      2024-02-27 [?] RSPM (R 4.3.0)
 P ggrepel                0.9.5      2024-01-10 [?] RSPM (R 4.3.0)
 P ggridges               0.5.6      2024-01-23 [?] RSPM (R 4.3.0)
 P git2r                  0.33.0     2023-11-26 [?] RSPM (R 4.3.0)
 P glmGamPoi            * 1.14.3     2024-02-11 [?] Bioconductor 3.18 (R 4.3.3)
 P GlobalOptions          0.1.2      2020-06-10 [?] RSPM (R 4.3.0)
 P globals                0.16.2     2022-11-21 [?] RSPM (R 4.3.0)
 P glue                 * 1.7.0      2024-01-09 [?] RSPM (R 4.3.0)
 P GO.db                  3.18.0     2024-04-23 [?] Bioconductor
 P goftest                1.2-3      2021-10-07 [?] RSPM (R 4.3.0)
 P graphlayouts           1.1.0      2024-01-19 [?] RSPM (R 4.3.0)
 P gridExtra              2.3        2017-09-09 [?] RSPM (R 4.3.0)
 P gtable                 0.3.4      2023-08-21 [?] RSPM (R 4.3.0)
 P here                 * 1.0.1      2020-12-13 [?] RSPM (R 4.3.0)
 P highr                  0.10       2022-12-22 [?] RSPM (R 4.3.0)
 P Hmisc                  5.1-1      2023-09-12 [?] RSPM (R 4.3.0)
 P hms                    1.1.3      2023-03-21 [?] RSPM (R 4.3.0)
 P htmlTable              2.4.2      2023-10-29 [?] RSPM (R 4.3.0)
 P htmltools              0.5.7      2023-11-03 [?] RSPM (R 4.3.0)
 P htmlwidgets            1.6.4      2023-12-06 [?] RSPM (R 4.3.0)
 P httpuv                 1.6.14     2024-01-26 [?] RSPM (R 4.3.0)
 P httr                   1.4.7      2023-08-15 [?] RSPM (R 4.3.0)
 P ica                    1.0-3      2022-07-08 [?] RSPM (R 4.3.0)
 P igraph                 2.0.1.1    2024-01-30 [?] RSPM (R 4.3.0)
 P impute                 1.76.0     2023-10-24 [?] Bioconductor
 P IRanges              * 2.36.0     2023-10-24 [?] Bioconductor
 P irlba                  2.3.5.1    2022-10-03 [?] RSPM (R 4.3.0)
 P iterators              1.0.14     2022-02-05 [?] RSPM (R 4.3.0)
 P jquerylib              0.1.4      2021-04-26 [?] RSPM (R 4.3.0)
 P jsonlite               1.8.8      2023-12-04 [?] RSPM (R 4.3.0)
 P KEGGREST               1.42.0     2023-10-24 [?] Bioconductor
 P KernSmooth             2.23-24    2024-05-17 [?] RSPM (R 4.3.0)
 P knitr                  1.45       2023-10-30 [?] RSPM (R 4.3.0)
 P labeling               0.4.3      2023-08-29 [?] RSPM (R 4.3.0)
 P later                  1.3.2      2023-12-06 [?] RSPM (R 4.3.0)
 P lattice                0.22-5     2023-10-24 [?] CRAN (R 4.3.1)
 P lazyeval               0.2.2      2019-03-15 [?] RSPM (R 4.3.0)
 P leiden                 0.4.3.1    2023-11-17 [?] RSPM (R 4.3.0)
 P lifecycle              1.0.4      2023-11-07 [?] RSPM (R 4.3.0)
 P limma                * 3.58.1     2023-10-31 [?] Bioconductor
 P listenv                0.9.1      2024-01-29 [?] RSPM (R 4.3.0)
 P lmtest                 0.9-40     2022-03-21 [?] RSPM (R 4.3.0)
 P locfit                 1.5-9.8    2023-06-11 [?] RSPM (R 4.3.0)
 P lubridate            * 1.9.3      2023-09-27 [?] RSPM (R 4.3.0)
 P magrittr               2.0.3      2022-03-30 [?] RSPM (R 4.3.0)
 P MASS                   7.3-60.0.1 2024-01-13 [?] RSPM (R 4.3.0)
 P Matrix                 1.6-5      2024-01-11 [?] CRAN (R 4.3.3)
 P MatrixGenerics       * 1.14.0     2023-10-24 [?] Bioconductor
 P matrixStats          * 1.2.0      2023-12-11 [?] RSPM (R 4.3.0)
 P memoise                2.0.1      2021-11-26 [?] RSPM (R 4.3.0)
 P mime                   0.12       2021-09-28 [?] RSPM (R 4.3.0)
 P miniUI                 0.1.1.1    2018-05-18 [?] RSPM (R 4.3.0)
 P munsell                0.5.0      2018-06-12 [?] RSPM (R 4.3.0)
 P nlme                   3.1-164    2023-11-27 [?] RSPM (R 4.3.0)
 P nnet                   7.3-19     2023-05-03 [?] CRAN (R 4.3.1)
 P org.Hs.eg.db         * 3.18.0     2024-04-23 [?] Bioconductor
 P paletteer            * 1.6.0      2024-01-21 [?] RSPM (R 4.3.0)
 P parallelly             1.37.0     2024-02-14 [?] RSPM (R 4.3.0)
 P patchwork            * 1.2.0      2024-01-08 [?] RSPM (R 4.3.0)
 P pbapply                1.7-2      2023-06-27 [?] RSPM (R 4.3.0)
 P pheatmap               1.0.12     2019-01-04 [?] RSPM (R 4.3.0)
 P pillar                 1.9.0      2023-03-22 [?] RSPM (R 4.3.0)
 P pkgconfig              2.0.3      2019-09-22 [?] RSPM (R 4.3.0)
 P plotly                 4.10.4     2024-01-13 [?] RSPM (R 4.3.0)
 P plyr                   1.8.9      2023-10-02 [?] RSPM (R 4.3.0)
 P png                    0.1-8      2022-11-29 [?] RSPM (R 4.3.0)
 P polyclip               1.10-6     2023-09-27 [?] RSPM (R 4.3.0)
 P preprocessCore         1.64.0     2023-10-24 [?] Bioconductor
 P processx               3.8.3      2023-12-10 [?] RSPM (R 4.3.0)
 P progressr              0.14.0     2023-08-10 [?] RSPM (R 4.3.0)
 P promises               1.2.1      2023-08-10 [?] RSPM (R 4.3.0)
 P ps                     1.7.6      2024-01-18 [?] RSPM (R 4.3.0)
 P purrr                * 1.0.2      2023-08-10 [?] RSPM (R 4.3.0)
 P R6                     2.5.1      2021-08-19 [?] RSPM (R 4.3.0)
 P RANN                   2.6.1      2019-01-08 [?] RSPM (R 4.3.0)
 P RColorBrewer           1.1-3      2022-04-03 [?] RSPM (R 4.3.0)
 P Rcpp                   1.0.12     2024-01-09 [?] RSPM (R 4.3.0)
 P RcppAnnoy              0.0.22     2024-01-23 [?] RSPM (R 4.3.0)
 P RCurl                  1.98-1.14  2024-01-09 [?] RSPM (R 4.3.0)
 P readr                * 2.1.5      2024-01-10 [?] RSPM (R 4.3.0)
 P rematch2               2.1.2      2020-05-01 [?] RSPM (R 4.3.0)
   renv                   1.0.3      2023-09-19 [1] CRAN (R 4.3.3)
 P reshape2               1.4.4      2020-04-09 [?] RSPM (R 4.3.0)
 P reticulate             1.35.0     2024-01-31 [?] RSPM (R 4.3.0)
 P rjson                  0.2.21     2022-01-09 [?] RSPM (R 4.3.0)
 P rlang                  1.1.3      2024-01-10 [?] RSPM (R 4.3.0)
 P rmarkdown              2.25       2023-09-18 [?] RSPM (R 4.3.0)
 P ROCR                   1.0-11     2020-05-02 [?] RSPM (R 4.3.0)
 P rpart                  4.1.23     2023-12-05 [?] RSPM (R 4.3.0)
 P rprojroot              2.0.4      2023-11-05 [?] RSPM (R 4.3.0)
 P RSQLite                2.3.5      2024-01-21 [?] RSPM (R 4.3.0)
 P rstudioapi             0.15.0     2023-07-07 [?] RSPM (R 4.3.0)
 P Rtsne                  0.17       2023-12-07 [?] RSPM (R 4.3.0)
 P S4Arrays               1.2.0      2023-10-24 [?] Bioconductor
 P S4Vectors            * 0.40.2     2023-11-23 [?] Bioconductor 3.18 (R 4.3.3)
 P sass                   0.4.8      2023-12-06 [?] RSPM (R 4.3.0)
 P scales                 1.3.0      2023-11-28 [?] RSPM (R 4.3.0)
 P scattermore            1.2        2023-06-12 [?] RSPM (R 4.3.0)
   sctransform            0.4.1      2023-10-19 [1] RSPM (R 4.3.0)
 P sessioninfo            1.2.2      2021-12-06 [?] RSPM (R 4.3.0)
   Seurat               * 4.4.0      2024-04-25 [1] https://satijalab.r-universe.dev (R 4.3.3)
   SeuratObject         * 4.1.4      2024-04-25 [1] https://satijalab.r-universe.dev (R 4.3.3)
 P shape                  1.4.6      2021-05-19 [?] RSPM (R 4.3.0)
 P shiny                  1.8.0      2023-11-17 [?] RSPM (R 4.3.0)
 P SingleCellExperiment * 1.24.0     2023-10-24 [?] Bioconductor
 P sp                     2.1-3      2024-01-30 [?] RSPM (R 4.3.0)
 P SparseArray            1.2.4      2024-02-11 [?] Bioconductor 3.18 (R 4.3.3)
 P spatstat.data          3.0-4      2024-01-15 [?] RSPM (R 4.3.0)
 P spatstat.explore       3.2-6      2024-02-01 [?] RSPM (R 4.3.0)
 P spatstat.geom          3.2-8      2024-01-26 [?] RSPM (R 4.3.0)
 P spatstat.random        3.2-2      2023-11-29 [?] RSPM (R 4.3.0)
 P spatstat.sparse        3.0-3      2023-10-24 [?] RSPM (R 4.3.0)
 P spatstat.utils         3.0-4      2023-10-24 [?] RSPM (R 4.3.0)
 P speckle              * 1.2.0      2023-10-24 [?] Bioconductor
 P statmod                1.5.0      2023-01-06 [?] RSPM (R 4.3.0)
 P stringi                1.8.3      2023-12-11 [?] RSPM (R 4.3.0)
 P stringr              * 1.5.1      2023-11-14 [?] RSPM (R 4.3.0)
 P SummarizedExperiment * 1.32.0     2023-10-24 [?] Bioconductor
 P survival               3.7-0      2024-06-05 [?] RSPM (R 4.3.0)
 P tensor                 1.5        2012-05-05 [?] RSPM (R 4.3.0)
 P tibble               * 3.2.1      2023-03-20 [?] RSPM (R 4.3.0)
 P tidygraph              1.3.1      2024-01-30 [?] RSPM (R 4.3.0)
 P tidyHeatmap          * 1.8.1      2022-05-20 [?] RSPM (R 4.3.3)
 P tidyr                * 1.3.1      2024-01-24 [?] RSPM (R 4.3.0)
 P tidyselect             1.2.0      2022-10-10 [?] RSPM (R 4.3.0)
 P tidyverse            * 2.0.0      2023-02-22 [?] RSPM (R 4.3.0)
 P timechange             0.3.0      2024-01-18 [?] RSPM (R 4.3.0)
 P tweenr                 2.0.3      2024-02-26 [?] RSPM (R 4.3.0)
 P tzdb                   0.4.0      2023-05-12 [?] RSPM (R 4.3.0)
 P utf8                   1.2.4      2023-10-22 [?] RSPM (R 4.3.0)
 P uwot                   0.1.16     2023-06-29 [?] RSPM (R 4.3.0)
 P vctrs                  0.6.5      2023-12-01 [?] RSPM (R 4.3.0)
 P viridis                0.6.5      2024-01-29 [?] RSPM (R 4.3.0)
 P viridisLite            0.4.2      2023-05-02 [?] RSPM (R 4.3.0)
 P WGCNA                  1.72-5     2023-12-07 [?] RSPM (R 4.3.3)
 P whisker                0.4.1      2022-12-05 [?] RSPM (R 4.3.0)
 P withr                  3.0.0      2024-01-16 [?] RSPM (R 4.3.0)
 P workflowr            * 1.7.1      2023-08-23 [?] RSPM (R 4.3.0)
 P xfun                   0.42       2024-02-08 [?] RSPM (R 4.3.0)
 P xtable                 1.8-4      2019-04-21 [?] RSPM (R 4.3.0)
 P XVector                0.42.0     2023-10-24 [?] Bioconductor
 P yaml                   2.3.8      2023-12-11 [?] RSPM (R 4.3.0)
 P zlibbioc               1.48.0     2023-10-24 [?] Bioconductor
 P zoo                    1.8-12     2023-04-13 [?] RSPM (R 4.3.0)

 [1] /mnt/allandata/jovana_data/paed-inflammation-CITEseq/renv/library/R-4.3/x86_64-pc-linux-gnu
 [2] /home/jovana/.cache/R/renv/sandbox/R-4.3/x86_64-pc-linux-gnu/9a444a72

 P ── Loaded and on-disk path mismatch.

──────────────────────────────────────────────────────────────────────────────

sessionInfo()
R version 4.3.3 (2024-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.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.20.so;  LAPACK version 3.10.0

locale:
 [1] LC_CTYPE=en_AU.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_AU.UTF-8        LC_COLLATE=en_AU.UTF-8    
 [5] LC_MONETARY=en_AU.UTF-8    LC_MESSAGES=en_AU.UTF-8   
 [7] LC_PAPER=en_AU.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C       

time zone: Etc/UTC
tzcode source: system (glibc)

attached base packages:
[1] stats4    stats     graphics  grDevices datasets  utils     methods  
[8] base     

other attached packages:
 [1] here_1.0.1                  tidyHeatmap_1.8.1          
 [3] paletteer_1.6.0             patchwork_1.2.0            
 [5] speckle_1.2.0               glue_1.7.0                 
 [7] org.Hs.eg.db_3.18.0         AnnotationDbi_1.64.1       
 [9] clustree_0.5.1              ggraph_2.2.0               
[11] dittoSeq_1.14.2             glmGamPoi_1.14.3           
[13] SeuratObject_4.1.4          Seurat_4.4.0               
[15] lubridate_1.9.3             forcats_1.0.0              
[17] stringr_1.5.1               dplyr_1.1.4                
[19] purrr_1.0.2                 readr_2.1.5                
[21] tidyr_1.3.1                 tibble_3.2.1               
[23] ggplot2_3.5.0               tidyverse_2.0.0            
[25] edgeR_4.0.15                limma_3.58.1               
[27] SingleCellExperiment_1.24.0 SummarizedExperiment_1.32.0
[29] Biobase_2.62.0              GenomicRanges_1.54.1       
[31] GenomeInfoDb_1.38.6         IRanges_2.36.0             
[33] S4Vectors_0.40.2            BiocGenerics_0.48.1        
[35] MatrixGenerics_1.14.0       matrixStats_1.2.0          
[37] workflowr_1.7.1            

loaded via a namespace (and not attached):
  [1] fs_1.6.3                spatstat.sparse_3.0-3   bitops_1.0-7           
  [4] httr_1.4.7              RColorBrewer_1.1-3      doParallel_1.0.17      
  [7] dynamicTreeCut_1.63-1   backports_1.4.1         tools_4.3.3            
 [10] sctransform_0.4.1       utf8_1.2.4              R6_2.5.1               
 [13] lazyeval_0.2.2          uwot_0.1.16             GetoptLong_1.0.5       
 [16] withr_3.0.0             sp_2.1-3                gridExtra_2.3          
 [19] preprocessCore_1.64.0   progressr_0.14.0        WGCNA_1.72-5           
 [22] cli_3.6.2               spatstat.explore_3.2-6  labeling_0.4.3         
 [25] sass_0.4.8              spatstat.data_3.0-4     ggridges_0.5.6         
 [28] pbapply_1.7-2           foreign_0.8-86          sessioninfo_1.2.2      
 [31] parallelly_1.37.0       impute_1.76.0           rstudioapi_0.15.0      
 [34] RSQLite_2.3.5           generics_0.1.3          shape_1.4.6            
 [37] ica_1.0-3               spatstat.random_3.2-2   dendextend_1.17.1      
 [40] GO.db_3.18.0            Matrix_1.6-5            fansi_1.0.6            
 [43] abind_1.4-5             lifecycle_1.0.4         whisker_0.4.1          
 [46] yaml_2.3.8              SparseArray_1.2.4       Rtsne_0.17             
 [49] grid_4.3.3              blob_1.2.4              promises_1.2.1         
 [52] crayon_1.5.2            miniUI_0.1.1.1          lattice_0.22-5         
 [55] cowplot_1.1.3           KEGGREST_1.42.0         pillar_1.9.0           
 [58] knitr_1.45              ComplexHeatmap_2.18.0   rjson_0.2.21           
 [61] future.apply_1.11.1     codetools_0.2-19        leiden_0.4.3.1         
 [64] getPass_0.2-4           data.table_1.15.0       vctrs_0.6.5            
 [67] png_0.1-8               gtable_0.3.4            rematch2_2.1.2         
 [70] cachem_1.0.8            xfun_0.42               S4Arrays_1.2.0         
 [73] mime_0.12               tidygraph_1.3.1         survival_3.7-0         
 [76] pheatmap_1.0.12         iterators_1.0.14        statmod_1.5.0          
 [79] ellipsis_0.3.2          fitdistrplus_1.1-11     ROCR_1.0-11            
 [82] nlme_3.1-164            bit64_4.0.5             RcppAnnoy_0.0.22       
 [85] rprojroot_2.0.4         bslib_0.6.1             irlba_2.3.5.1          
 [88] rpart_4.1.23            KernSmooth_2.23-24      Hmisc_5.1-1            
 [91] colorspace_2.1-0        DBI_1.2.1               nnet_7.3-19            
 [94] tidyselect_1.2.0        processx_3.8.3          bit_4.0.5              
 [97] compiler_4.3.3          git2r_0.33.0            htmlTable_2.4.2        
[100] DelayedArray_0.28.0     plotly_4.10.4           checkmate_2.3.1        
[103] scales_1.3.0            lmtest_0.9-40           callr_3.7.3            
[106] digest_0.6.34           goftest_1.2-3           spatstat.utils_3.0-4   
[109] rmarkdown_2.25          XVector_0.42.0          base64enc_0.1-3        
[112] htmltools_0.5.7         pkgconfig_2.0.3         highr_0.10             
[115] fastmap_1.1.1           rlang_1.1.3             GlobalOptions_0.1.2    
[118] htmlwidgets_1.6.4       shiny_1.8.0             farver_2.1.1           
[121] jquerylib_0.1.4         zoo_1.8-12              jsonlite_1.8.8         
[124] RCurl_1.98-1.14         magrittr_2.0.3          Formula_1.2-5          
[127] GenomeInfoDbData_1.2.11 munsell_0.5.0           Rcpp_1.0.12            
[130] viridis_0.6.5           reticulate_1.35.0       stringi_1.8.3          
[133] zlibbioc_1.48.0         MASS_7.3-60.0.1         plyr_1.8.9             
[136] parallel_4.3.3          listenv_0.9.1           ggrepel_0.9.5          
[139] deldir_2.0-2            Biostrings_2.70.2       graphlayouts_1.1.0     
[142] splines_4.3.3           tensor_1.5              hms_1.1.3              
[145] circlize_0.4.15         locfit_1.5-9.8          ps_1.7.6               
[148] fastcluster_1.2.6       igraph_2.0.1.1          spatstat.geom_3.2-8    
[151] reshape2_1.4.4          evaluate_0.23           renv_1.0.3             
[154] BiocManager_1.30.22     tzdb_0.4.0              foreach_1.5.2          
[157] tweenr_2.0.3            httpuv_1.6.14           RANN_2.6.1             
[160] polyclip_1.10-6         future_1.33.1           clue_0.3-65            
[163] scattermore_1.2         ggforce_0.4.2           xtable_1.8-4           
[166] later_1.3.2             viridisLite_0.4.2       memoise_2.0.1          
[169] cluster_2.1.6           timechange_0.3.0        globals_0.16.2