├── .Rbuildignore ├── .github └── ISSUE_TEMPLATE │ ├── error-encountered.md │ └── general-issue.md ├── .gitignore ├── DESCRIPTION ├── LICENSE.md ├── NAMESPACE ├── NEWS.md ├── R ├── ComparePathways.R ├── CompareSce.R ├── CompareSeurat.R ├── FormatPathways.R ├── GetPaths.R ├── Globals.R ├── PathwayMatrices.R ├── PlotHeatmap.R ├── PlotRank.R ├── RandomCells.R ├── SceExtract.R ├── SeuratExtract.R ├── utils-pipe.R └── zzz.R ├── README.Rmd ├── README.md ├── SCPA.Rproj ├── _pkgdown.yml ├── docs ├── 404.html ├── LICENSE.html ├── apple-touch-icon-120x120.png ├── apple-touch-icon-152x152.png ├── apple-touch-icon-180x180.png ├── apple-touch-icon-60x60.png ├── apple-touch-icon-76x76.png ├── apple-touch-icon.png ├── articles │ ├── SCPA.html │ ├── SCPA_files │ │ └── header-attrs-2.11 │ │ │ └── header-attrs.js │ ├── comparing_two_populations.html │ ├── comparing_two_populations_files │ │ └── header-attrs-2.11 │ │ │ └── header-attrs.js │ ├── disease_comparison.html │ ├── disease_comparison_files │ │ └── header-attrs-2.11 │ │ │ └── header-attrs.js │ ├── index.html │ ├── interpreting_scpa_output.html │ ├── parallel_implementation.html │ ├── pseudotime.html │ ├── pseudotime_files │ │ └── header-attrs-2.11 │ │ │ └── header-attrs.js │ ├── quick_start.html │ ├── quick_start_files │ │ ├── figure-html │ │ │ └── plot_rank-1.png │ │ └── header-attrs-2.11 │ │ │ └── header-attrs.js │ ├── seurat_comparison.html │ ├── seurat_comparison_files │ │ └── header-attrs-2.11 │ │ │ └── header-attrs.js │ ├── systematic_tissue_comparison.html │ ├── systematic_tissue_comparison_files │ │ └── header-attrs-2.11 │ │ │ └── header-attrs.js │ ├── using_gene_sets.html │ ├── using_gene_sets_files │ │ └── header-attrs-2.11 │ │ │ └── header-attrs.js │ ├── visualisation.html │ └── visualisation_files │ │ └── figure-html │ │ ├── unnamed-chunk-4-1.png │ │ ├── unnamed-chunk-5-1.png │ │ └── unnamed-chunk-6-1.png ├── authors.html ├── bootstrap-toc.css ├── bootstrap-toc.js ├── code-color-scheme-dark.css ├── code-color-scheme-light.css ├── darkswitch.js ├── deps │ ├── _Roboto Slab-0.4.0 │ │ ├── BngbUXZYTXPIvIBgJJSb6s3BzlRRfKOFbvjojISWaw.woff │ │ └── font.css │ ├── _Roboto-0.4.0 │ │ ├── KFOmCnqEu92Fr1Me5g.woff │ │ └── font.css │ ├── bootstrap-5.1.0 │ │ ├── bootstrap.bundle.min.js │ │ ├── bootstrap.bundle.min.js.map │ │ ├── bootstrap.min.css │ │ ├── font.css │ │ └── fonts │ │ │ ├── 1Ptxg8zYS_SKggPN4iEgvnHyvveLxVs9pbCIPrc.woff │ │ │ ├── 1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCIPrc.woff │ │ │ ├── 4iCs6KVjbNBYlgo6ew.woff │ │ │ ├── 4iCs6KVjbNBYlgoKfw7w.woff │ │ │ ├── 4iCv6KVjbNBYlgoCxCvTtA.woff │ │ │ ├── 4iCv6KVjbNBYlgoCxCvjsGyL.woff │ │ │ ├── 6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7nsDQ.woff │ │ │ ├── 6xK1dSBYKcSV-LCoeQqfX1RYOo3qPa7j.woff │ │ │ ├── 6xK3dSBYKcSV-LCoeQqfX1RYOo3aPA.woff │ │ │ ├── 6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7j.woff │ │ │ ├── 6xKydSBYKcSV-LCoeQqfX1RYOo3i54rAkw.woff │ │ │ ├── 6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vAkw.woff │ │ │ ├── 6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlxdo.woff │ │ │ ├── 6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zAkw.woff │ │ │ ├── 6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwlxdo.woff │ │ │ ├── CSR54z1Qlv-GDxkbKVQ_dFsvWNRevw.woff │ │ │ ├── CSR54z1Qlv-GDxkbKVQ_dFsvaNA.woff │ │ │ ├── CSR64z1Qlv-GDxkbKVQ_TOQ.woff │ │ │ ├── CSR64z1Qlv-GDxkbKVQ_fOAKSw.woff │ │ │ ├── JTURjIg1_i6t8kCHKm45_ZpC7g0.woff │ │ │ ├── JTURjIg1_i6t8kCHKm45_dJE7g0.woff │ │ │ ├── JTUSjIg1_i6t8kCHKm45xW0.woff │ │ │ ├── KFOlCnqEu92Fr1MmEU9fBBc-.woff │ │ │ ├── KFOlCnqEu92Fr1MmEU9vAA.woff │ │ │ ├── KFOlCnqEu92Fr1MmSU5fBBc-.woff │ │ │ ├── KFOlCnqEu92Fr1MmSU5vAA.woff │ │ │ ├── KFOlCnqEu92Fr1MmWUlfBBc-.woff │ │ │ ├── KFOlCnqEu92Fr1MmWUlvAA.woff │ │ │ ├── KFOmCnqEu92Fr1Me5g.woff │ │ │ ├── KFOmCnqEu92Fr1Mu4mxM.woff │ │ │ ├── QGYpz_kZZAGCONcK2A4bGOj8mNhL.woff │ │ │ ├── S6u8w4BMUTPHjxsAXC-s.woff │ │ │ ├── S6u8w4BMUTPHjxswWA.woff │ │ │ ├── S6u9w4BMUTPHh6UVSwiPHw.woff │ │ │ ├── S6u9w4BMUTPHh6UVeww.woff │ │ │ ├── S6u9w4BMUTPHh7USSwiPHw.woff │ │ │ ├── S6u9w4BMUTPHh7USeww.woff │ │ │ ├── S6uyw4BMUTPHjx4wWA.woff │ │ │ ├── S6uyw4BMUTPHvxo.woff │ │ │ ├── UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuFuYMZs.woff │ │ │ ├── UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuI6fMZs.woff │ │ │ ├── UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfMZs.woff │ │ │ ├── XRXV3I6Li01BKof4MQ.woff │ │ │ ├── XRXW3I6Li01BKofA6sKkZQ.woff │ │ │ ├── XRXW3I6Li01BKofAjsOkZQ.woff │ │ │ ├── memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk5hkWVAexg.woff │ │ │ ├── memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk5hkaVQ.woff │ │ │ ├── memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk8ZkWVAexg.woff │ │ │ ├── memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk8ZkaVQ.woff │ │ │ ├── memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkyFjWVAexg.woff │ │ │ ├── memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkyFjaVQ.woff │ │ │ ├── memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsg-1x4gaVQ.woff │ │ │ ├── memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsg-1y4k.woff │ │ │ ├── memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsiH0B4gaVQ.woff │ │ │ ├── memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsiH0C4k.woff │ │ │ ├── memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0B4gaVQ.woff │ │ │ ├── memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0C4k.woff │ │ │ ├── pe03MImSLYBIv1o4X1M8cc9iB_5p.woff │ │ │ ├── pe0qMImSLYBIv1o4X1M8cfe5.woff │ │ │ └── q5uGsou0JOdh94bfvQlr.woff │ ├── data-deps.txt │ └── jquery-3.6.0 │ │ ├── jquery-3.6.0.js │ │ ├── jquery-3.6.0.min.js │ │ └── jquery-3.6.0.min.map ├── docsearch.css ├── docsearch.js ├── docsearch.json ├── extra.css ├── favicon-16x16.png ├── favicon-32x32.png ├── favicon.ico ├── index.html ├── link.svg ├── logo.png ├── man │ └── figures │ │ ├── aa_metab_rank.png │ │ ├── covid_atlas.png │ │ ├── covid_heatmap.png │ │ ├── defa_expression.png │ │ ├── metabolic_heatmap.png │ │ ├── naive_cd4_milestone.png │ │ ├── naive_cd4_pseudo.png │ │ ├── naive_cd4_umap.png │ │ ├── naive_cd8_umap.png │ │ ├── pathway_screenshot.png │ │ ├── tissue_heatmap.png │ │ ├── tissue_umap.png │ │ ├── tissue_variance.png │ │ └── v_plot_rest_act.png ├── news │ └── index.html ├── pkgdown.css ├── pkgdown.js ├── pkgdown.yml ├── preferably.css ├── reference │ ├── Rplot001.png │ ├── compare_pathways.html │ ├── compare_pathways_parallel.html │ ├── compare_sce.html │ ├── compare_seurat.html │ ├── figures │ │ ├── README-pressure-1.png │ │ ├── aa_metab_rank.png │ │ ├── cd4_cell_types.png │ │ ├── covid_atlas.png │ │ ├── covid_heatmap.png │ │ ├── defa_expression.png │ │ ├── fine_tissue.png │ │ ├── heatmap_1.png │ │ ├── heatmap_2.png │ │ ├── logo.png │ │ ├── metabolic_heatmap.png │ │ ├── mtorc1_rank.png │ │ ├── multisample_time.png │ │ ├── naive_cd4_milestone.png │ │ ├── naive_cd4_pseudo.png │ │ ├── naive_cd4_umap.png │ │ ├── naive_cd8_umap.png │ │ ├── pathway_screenshot.png │ │ ├── pseudotime_rank.png │ │ ├── rank_plot.png │ │ ├── scpa_logo.png │ │ ├── scpa_outline.png │ │ ├── tissue_heatmap.png │ │ ├── tissue_umap.png │ │ ├── tissue_variance.png │ │ ├── two_sample_time.png │ │ ├── two_sample_time_paths.png │ │ └── v_plot_rest_act.png │ ├── format_pathways.html │ ├── get_paths.html │ ├── index.html │ ├── parallel_comparison.html │ ├── pathway_matrices.html │ ├── pipe.html │ ├── plot_heatmap.html │ ├── plot_rank.html │ ├── random_cells.html │ ├── sce_extract.html │ ├── seurat_extract.html │ └── single_comparison.html ├── search.json └── sitemap.xml ├── gene_sets ├── combined_metabolic_pathways.csv └── h_k_r_go_pid_reg_wik.csv ├── inst ├── CITATION ├── WORDLIST └── rds_files │ └── th1_tcm.rds ├── man ├── compare_pathways.Rd ├── compare_sce.Rd ├── compare_seurat.Rd ├── figures │ ├── aa_metab_rank.png │ ├── cd4_cell_types.png │ ├── covid_atlas.png │ ├── covid_heatmap.png │ ├── defa_expression.png │ ├── fine_tissue.png │ ├── heatmap_1.png │ ├── heatmap_2.png │ ├── logo.png │ ├── metabolic_heatmap.png │ ├── mtorc1_rank.png │ ├── multisample_time.png │ ├── naive_cd4_milestone.png │ ├── naive_cd4_pseudo.png │ ├── naive_cd4_umap.png │ ├── naive_cd8_umap.png │ ├── pathway_screenshot.png │ ├── pseudotime_rank.png │ ├── rank_plot.png │ ├── scpa_outline.png │ ├── tissue_heatmap.png │ ├── tissue_umap.png │ ├── tissue_variance.png │ ├── two_sample_time_paths.png │ └── v_plot_rest_act.png ├── format_pathways.Rd ├── get_paths.Rd ├── parallel_comparison.Rd ├── pathway_matrices.Rd ├── pipe.Rd ├── plot_heatmap.Rd ├── plot_rank.Rd ├── random_cells.Rd ├── sce_extract.Rd ├── seurat_extract.Rd └── single_comparison.Rd ├── pkgdown ├── extra.css └── favicon │ ├── apple-touch-icon-120x120.png │ ├── apple-touch-icon-152x152.png │ ├── apple-touch-icon-180x180.png │ ├── apple-touch-icon-60x60.png │ ├── apple-touch-icon-76x76.png │ ├── apple-touch-icon.png │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ └── favicon.ico ├── tests └── spelling.R └── vignettes ├── .gitignore ├── comparing_two_populations.Rmd ├── disease_comparison.Rmd ├── interpreting_scpa_output.Rmd ├── parallel_implementation.Rmd ├── pseudotime.Rmd ├── quick_start.Rmd ├── seurat_comparison.Rmd ├── systematic_tissue_comparison.Rmd ├── using_gene_sets.Rmd └── visualisation.Rmd /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^SCPA\.Rproj$ 2 | ^\.Rproj\.user$ 3 | ^LICENSE\.md$ 4 | ^README\.Rmd$ 5 | ^_pkgdown\.yml$ 6 | ^docs$ 7 | ^pkgdown$ 8 | ^gene_sets$ 9 | ^rds_files$ 10 | ^cran-comments\.md$ 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/error-encountered.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Error encountered 3 | about: Any errors whilst running SCPA 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **The specific error you're running into** 11 | Either copy/paste the error message, or provide a screenshot 12 | 13 | **To Reproduce** 14 | The code to reproduce the error e.g. 15 | 16 | ``` 17 | library(SCPA); library(Seurat); library(msigdbr) 18 | 19 | p1 <- seurat_extract(df, meta1 = "hour", value_meta1 = "0") 20 | p2 <- seurat_extract(df, meta1 = "hour", value_meta1 = "24") 21 | 22 | pathways <- msigdbr("Homo sapiens", "H") %>% format_pathways() 23 | 24 | scpa_out <- compare_pathways(list(p1, p2), pathways) 25 | ``` 26 | 27 | **Expected behavior** 28 | A clear and concise description of what you expected to happen. 29 | 30 | **Screenshots** 31 | If applicable, add screenshots to help explain your problem. 32 | 33 | **Additional context** 34 | Add any other context about the problem here. 35 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/general-issue.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: General issue 3 | about: Any general issue with SCPA 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **What's going on** 11 | Brief description of the issue you're having 12 | 13 | **Code to replicate the issue** 14 | Any code that you're using that's causing an issue. Ideally so the issue can be replicated 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .Rdata 4 | .httr-oauth 5 | .DS_Store 6 | inst/doc 7 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: SCPA 2 | Title: Single Cell Pathway Analysis 3 | Version: 1.6.2 4 | Authors@R: 5 | c(person(given = "Jack", family = "Bibby", email = "jack.bibby@nih.gov", role = c("aut", "cre")), 6 | person(given = "Divyansh", family = "Agarwal", role = c("aut"))) 7 | Description: A package for performing pathway analysis on single cell data. 8 | SCPA relies on understanding changes in multivariate distributions 9 | of pathways between samples as a basis for judging biological 10 | relevance. Two basic arguments are necessary = 1) matrices of data, 11 | and 2) pathways that you want to analyse. See the GitHub page at 12 | for a detailed description and tutorials. 13 | License: GPL (>= 3) 14 | Encoding: UTF-8 15 | Roxygen: list(markdown = TRUE) 16 | RoxygenNote: 7.2.3 17 | URL: https://jackbibby1.github.io/SCPA/, https://github.com/jackbibby1/SCPA/ 18 | BugReports: https://github.com/jackbibby1/SCPA/issues/ 19 | Imports: 20 | circlize (>= 0.4.15), 21 | clustermole (>= 1.1.0), 22 | ComplexHeatmap (>= 2.16.0), 23 | doParallel (>= 1.0.17), 24 | dplyr (>= 1.0.9), 25 | foreach (>= 1.5.2), 26 | ggplot2 (>= 3.3.6), 27 | ggrepel (>= 0.9.1), 28 | magrittr (>= 2.0.3), 29 | multicross (>= 2.1.0), 30 | purrr (>= 0.3.4), 31 | Seurat (>= 4.1.1), 32 | SeuratObject (>= 5.0.1), 33 | stats (>= 4.1.0), 34 | stringr (>= 1.4.0), 35 | SummarizedExperiment (>= 1.30), 36 | tibble (>= 3.1.7), 37 | tidyr (>= 1.2.0), 38 | utils (>= 4.1.0) 39 | Suggests: 40 | rmarkdown, 41 | knitr, 42 | spelling, 43 | msigdbr (>= 7.5.1) 44 | VignetteBuilder: knitr 45 | Depends: 46 | R (>= 2.10) 47 | Language: en-GB 48 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export("%>%") 4 | export(compare_pathways) 5 | export(compare_sce) 6 | export(compare_seurat) 7 | export(format_pathways) 8 | export(get_paths) 9 | export(parallel_comparison) 10 | export(pathway_matrices) 11 | export(plot_heatmap) 12 | export(plot_rank) 13 | export(random_cells) 14 | export(sce_extract) 15 | export(seurat_extract) 16 | export(single_comparison) 17 | importFrom(foreach,"%dopar%") 18 | importFrom(magrittr,"%>%") 19 | -------------------------------------------------------------------------------- /NEWS.md: -------------------------------------------------------------------------------- 1 | ## SCPA v1.6.2 2 | 3 | Default to cores = 3 if parallel = TRUE is supplied with no cores argument 4 | 5 | ## SCPA v1.6.1 6 | 7 | ### Minor changes 8 | 9 | Add compatability for numeric vectors in `compare_seurat()` 10 | 11 | ## SCPA v1.6 12 | 13 | #### Major changes 14 | 15 | Updated compatability with Seurat v5. `compare_seurat()` and `seurat_extract()` automatically detect Seurat object version 16 | 17 | ## SCPA v1.5.4 18 | 19 | ### Minor changes 20 | 21 | Change package dependeny version to improve installation 22 | 23 | ## SCPA v1.5.2 24 | 25 | ### Minor changes 26 | 27 | Ability to specify multiple gmt filepaths in the pathway argument of `compare_pathways()`. For 28 | examples see [here](https://jackbibby1.github.io/SCPA/articles/using_gene_sets.html#using-a-gmt-file) 29 | 30 | ## SCPA v1.5.1 31 | 32 | ### Minor changes 33 | 34 | Fix downsample so it isn't forcing 500 cells [#34](https://github.com/jackbibby1/SCPA/issues/34) 35 | 36 | ## SCPA v1.5.0 37 | 38 | #### Major changes 39 | 40 | - Parallel processing is now built into into the `compare_pathways()`, `compare_seurat()`, 41 | and `compare_sce()` functions. Users just 42 | need to specify `parallel = TRUE` and `cores = x` to use parallel processing instead of calling 43 | `compare_pathways_parallel()` 44 | 45 | #### Minor changes 46 | 47 | - Fix downsample [#31](https://github.com/jackbibby1/SCPA/pull/31/commits/da5b7bf3a11abbf071ca5e2a9c5743a3a9f320fb) 48 | 49 | ## SCPA v1.4.0 50 | 51 | #### Major changes 52 | 53 | - Parallel implementation for `compare_pathways()` via `compare_pathways_parallel()`. 54 | Users can specify number of cores to run in the pathway comparison 55 | 56 | ## SCPA v1.3.0 57 | 58 | #### Major changes 59 | 60 | - The main function of SCPA has been rewritten to be much more efficient with memory usage. 61 | This means that RAM availability is likely not going to be limiting on a typical computer 62 | i.e. 8GB RAM, even with a huge number of comparisons. 63 | - The speed of the pathway comparisons is also slightly improved 64 | 65 | #### Minor changes 66 | - Added the option to filter gene set size in `compare_seurat()` 67 | 68 | ## SCPA v1.2.1 69 | 70 | #### Minor changes 71 | 72 | - Add functionality to choose assay in Seurat object 73 | 74 | ## SCPA v1.2 75 | 76 | #### Major changes 77 | 78 | - Add functionality to deal with SingleCellExperiment objects 79 | - `sce_extract` can now extract data from SCE objects based on colData 80 | - `compare_sce` can now compare pathways directly within an SCE object 81 | 82 | ## SCPA v1.1 83 | 84 | #### Major changes 85 | 86 | - Add functionality to visualise results from SCPA with 87 | `plot_rank()` and `plot_heatmap()` 88 | 89 | #### Minor changes 90 | - Improve messaging with `compare_pathways()` 91 | 92 | ## SCPA v1.0.0 93 | 94 | #### Minor changes 95 | 96 | - Allow usage of multiple file types for pathways e.g. gmt, csv 97 | - Fix CRAN archive with multicross and crossmatch 98 | 99 | ## SCPA v0.0.0.9000 100 | 101 | - Release SCPA for multivariate testing of pathways in scRNA-seq data 102 | -------------------------------------------------------------------------------- /R/CompareSce.R: -------------------------------------------------------------------------------- 1 | #' Use SCPA to compare pathways within a SingleCellExperiment object 2 | #' 3 | #' This function takes a SingleCellExperiment object as an input, and 4 | #' compares gene sets over specified conditions/populations. 5 | #' 6 | #' @param sce_object SingleCellExperiment object with populations defined in the column data 7 | #' @param assay_name Assay name to extract expression values from. Defaults to logcounts 8 | #' @param group1 First comparison group as defined by `colData()` columns 9 | #' of SingleCellExperiment object e.g. cell_type 10 | #' @param group1_population Populations within group1 to compare 11 | #' e.g. c("t_cell", "b_cell") 12 | #' @param group2 Second comparison group as defined by `colData()` columns 13 | #' of SingleCellExperiment object e.g. hour 14 | #' @param group2_population Population within group2 to compare 15 | #' e.g. 24 16 | #' @param pathways Pathway gene sets with each pathway in a separate list. For formatting of 17 | #' gene lists, see documentation at https://jackbibby1.github.io/SCPA/articles/using_gene_sets.html 18 | #' @param downsample Option to downsample cell numbers. Defaults to 500 cells per condition. If a population 19 | #' has < 500 cells, all cells from that condition are used. 20 | #' @param min_genes Gene sets with fewer than this number of genes will be excluded 21 | #' @param max_genes Gene sets with more than this number of genes will be excluded 22 | #' @param parallel Should parallel processing be used? 23 | #' @param cores The number of cores used for parallel processing 24 | #' 25 | #' @examples \dontrun{ 26 | #' scpa_out <- compare_sce( 27 | #' group1 = "cell", 28 | #' group1_population = c("t_cell", "b_cell"), 29 | #' group2 = "hour", 30 | #' group2_population = c("24"), 31 | #' pathways = pathways) 32 | #' } 33 | #' 34 | #' @return Statistical results from the SCPA analysis. The qval should be the 35 | #' primary metric that is used to interpret pathway differences i.e. a higher 36 | #' qval translates to larger pathway differences between conditions. 37 | #' If only two samples are provided, a fold change (FC) enrichment score will also be 38 | #' calculated. The FC output is generated from a running sum of mean changes in gene 39 | #' expression from all genes of the pathway. It's calculated from average pathway 40 | #' expression in population1 - population2, so a negative FC means the pathway is 41 | #' higher in population2. 42 | #' 43 | #' @export 44 | 45 | compare_sce <- function(sce_object, 46 | assay_name = "logcounts", 47 | group1 = NULL, 48 | group1_population = NULL, 49 | group2 = NULL, 50 | group2_population = NULL, 51 | pathways, 52 | min_genes = 15, 53 | max_genes = 500, 54 | downsample = 500, 55 | parallel = FALSE, 56 | cores = NULL) { 57 | 58 | ## Pathways 59 | if (class(pathways)[1] == "character") { 60 | pathways <- get_paths(pathways) 61 | } 62 | path_names <- sapply(pathways, function(x) unique(x$Pathway)) 63 | 64 | ## Seurat extract 65 | if (is.null(group2)) { 66 | samples <- list() 67 | for (i in group1_population) { 68 | samples[[i]] <- sce_extract(sce_object, 69 | assay_name = assay_name, 70 | meta1 = group1, 71 | value_meta1 = i) 72 | } 73 | } 74 | 75 | if (!is.null(group2)) { 76 | samples <- list() 77 | for (i in group1_population) { 78 | samples[[i]] <- sce_extract(sce_object, 79 | assay_name = assay_name, 80 | meta1 = group1, 81 | value_meta1 = i, 82 | meta2 = group2, 83 | value_meta2 = group2_population) 84 | } 85 | } 86 | 87 | 88 | if (parallel == FALSE) { 89 | 90 | mcm_output <- compare_pathways(samples = samples, 91 | pathways = pathways, 92 | downsample = downsample, 93 | min_genes = min_genes, 94 | max_genes = max_genes) 95 | 96 | } else { 97 | 98 | mcm_output <- compare_pathways(samples = samples, 99 | pathways = pathways, 100 | downsample = downsample, 101 | min_genes = min_genes, 102 | max_genes = max_genes, 103 | parallel = TRUE, 104 | cores = cores) 105 | 106 | } 107 | 108 | 109 | return(mcm_output) 110 | 111 | } 112 | 113 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /R/CompareSeurat.R: -------------------------------------------------------------------------------- 1 | #' Use SCPA to compare pathways within a Seurat object 2 | #' 3 | #' This function takes a Seurat object as an input, and 4 | #' compares gene sets over specified conditions/populations. 5 | #' 6 | #' @param seurat_object Seurat object with populations defined in the meta data 7 | #' @param assay Assay to pull expression data from 8 | #' @param group1 First comparison group as defined by meta data in 9 | #' Seurat object e.g. cell_type 10 | #' @param group1_population Populations within group1 to compare 11 | #' e.g. c("t_cell", "b_cell") 12 | #' @param group2 Second comparison group as defined by column names in 13 | #' Seurat object e.g. hour 14 | #' @param group2_population Population within group2 to compare 15 | #' e.g. 24 16 | #' @param pathways Pathway gene sets with each pathway in a separate list. For formatting of 17 | #' gene lists, see documentation at https://jackbibby1.github.io/SCPA/articles/using_gene_sets.html 18 | #' @param downsample Option to downsample cell numbers. Defaults to 500 cells per condition. If a population 19 | #' has < 500 cells, all cells from that condition are used. 20 | #' @param min_genes Gene sets with fewer than this number of genes will be excluded 21 | #' @param max_genes Gene sets with more than this number of genes will be excluded 22 | #' @param parallel Should parallel processing be used? 23 | #' @param cores The number of cores used for parallel processing 24 | #' 25 | #' @examples \dontrun{ 26 | #' scpa_out <- compare_sce( 27 | #' group1 = "cell", 28 | #' group1_population = c("t_cell", "b_cell"), 29 | #' group2 = "hour", 30 | #' group2_population = c("24"), 31 | #' pathways = pathways) 32 | #' } 33 | #' 34 | #' @return Statistical results from the SCPA analysis. The qval should be the 35 | #' primary metric that is used to interpret pathway differences i.e. a higher 36 | #' qval translates to larger pathway differences between conditions. 37 | #' If only two samples are provided, a fold change (FC) enrichment score will also be 38 | #' calculated. The FC output is generated from a running sum of mean changes in gene 39 | #' expression from all genes of the pathway. It's calculated from average pathway 40 | #' expression in population1 - population2, so a negative FC means the pathway is 41 | #' higher in population2. 42 | #' 43 | #' @export 44 | 45 | compare_seurat <- function(seurat_object, 46 | assay = "RNA", 47 | group1 = NULL, 48 | group1_population = NULL, 49 | group2 = NULL, 50 | group2_population = NULL, 51 | pathways, 52 | downsample = 500, 53 | min_genes = 15, 54 | max_genes = 500, 55 | parallel = FALSE, 56 | cores = NULL) { 57 | 58 | ## Pathways 59 | if (class(pathways)[1] == "character") { 60 | pathways <- get_paths(pathways) 61 | } 62 | path_names <- sapply(pathways, function(x) unique(x$Pathway)) 63 | 64 | ## Convert population to character vector 65 | group1_population <- as.character(group1_population) 66 | 67 | ## Seurat extract 68 | if (is.null(group2)) { 69 | samples <- list() 70 | for (i in group1_population) { 71 | samples[[i]] <- seurat_extract(seurat_object, 72 | assay = assay, 73 | meta1 = group1, 74 | value_meta1 = i) 75 | } 76 | } 77 | 78 | if (!is.null(group2)) { 79 | samples <- list() 80 | for (i in group1_population) { 81 | samples[[i]] <- seurat_extract(seurat_object, 82 | assay = assay, 83 | meta1 = group1, 84 | value_meta1 = i, 85 | meta2 = group2, 86 | value_meta2 = group2_population) 87 | } 88 | } 89 | 90 | if (parallel == FALSE) { 91 | 92 | mcm_output <- compare_pathways(samples = samples, 93 | pathways = pathways, 94 | downsample = downsample, 95 | min_genes = min_genes, 96 | max_genes = max_genes) 97 | 98 | } else { 99 | 100 | mcm_output <- compare_pathways(samples = samples, 101 | pathways = pathways, 102 | downsample = downsample, 103 | min_genes = min_genes, 104 | max_genes = max_genes, 105 | parallel = TRUE, 106 | cores = cores) 107 | 108 | } 109 | 110 | 111 | return(mcm_output) 112 | 113 | } 114 | 115 | 116 | 117 | 118 | 119 | -------------------------------------------------------------------------------- /R/FormatPathways.R: -------------------------------------------------------------------------------- 1 | #' Format the output of msigdbr to use with SCPA 2 | #' 3 | #' This function takes the output of msigdbr 4 | #' and formats the pathways into something that 5 | #' can be used within SCPA 6 | #' 7 | #' @param msigdbr_output output from msigdbr 8 | #' 9 | #' @examples \dontrun{ 10 | #' pathways <- format_pathways( 11 | #' pathways 12 | #' ) 13 | #' } 14 | #' 15 | #' @return list of pathways with corresponding genes 16 | #' @export 17 | 18 | format_pathways <- function(msigdbr_output) { 19 | msigdbr_output <- msigdbr_output[, c("gs_name", "gene_symbol")] 20 | colnames(msigdbr_output) <- c("Pathway", "Genes") 21 | msigdbr_output <- dplyr::group_split(msigdbr_output, Pathway) 22 | return(msigdbr_output) 23 | } 24 | 25 | -------------------------------------------------------------------------------- /R/GetPaths.R: -------------------------------------------------------------------------------- 1 | #' Convert gene sets to filtered pathway list 2 | #' 3 | #' This function takes one of three inputs: 4 | #' 1) csv file where pathway title is in the first column 5 | #' and subsequent columns contain genes of that pathway 6 | #' 2) A gmt file 7 | #' 3) A tidy formatted list where pathway name is contained in the first column 8 | #' and the genes of that pathway are in the second column 9 | #' 10 | #' @param pathway_filepath filepath to csv or gmt file 11 | #' 12 | #' @examples \dontrun{ 13 | #' pathways <- get_paths( 14 | #' "Documents/gene_list.csv" 15 | #' ) 16 | #' } 17 | #' 18 | #' @return list of pathways with corresponding genes 19 | #' @export 20 | 21 | 22 | get_paths <- function(pathway_filepath) { 23 | 24 | filepath_test <- as.character(pathway_filepath) 25 | number_of_files <- length(pathway_filepath) 26 | 27 | message("Generating gene sets from: \n", paste(filepath_test, collapse = "\n"), "\n") 28 | 29 | if (all(stringr::str_ends(filepath_test, "gmt"))) { 30 | 31 | pathways <- lapply(pathway_filepath, function(x) { 32 | 33 | clustermole::read_gmt(x, geneset_label = "Pathway", gene_label = "Genes") %>% 34 | dplyr::group_split(Pathway) %>% 35 | lapply(function(x) x[x$Genes != "", ]) 36 | 37 | }) 38 | 39 | pathways <- purrr::list_c(pathways) 40 | 41 | } else if (all(stringr::str_ends(filepath_test, "csv"))) { 42 | 43 | pathways <- utils::read.csv(pathway_filepath, row.names = 1, header = F) 44 | pathways <- as.data.frame(t(pathways)) 45 | pathways <- tidyr::pivot_longer(pathways, cols = 1:length(pathways), names_to = "Pathway", values_to = "Genes") 46 | pathways <- dplyr::group_split(pathways, Pathway) 47 | pathways <- lapply(pathways, function(x) x[x$Genes != "",]) 48 | 49 | } else { 50 | 51 | stop("Gene set file extension needs to be .csv or .gmt") 52 | 53 | } 54 | 55 | } 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /R/Globals.R: -------------------------------------------------------------------------------- 1 | utils::globalVariables(c("Pathway", "path_rank", "X1", "X2", "Pval", "adjPval", "qval", "FC", ".data", "pathway", ".")) 2 | -------------------------------------------------------------------------------- /R/PathwayMatrices.R: -------------------------------------------------------------------------------- 1 | #' Create pathway matrices from gene sets 2 | #' 3 | #' This function takes a matrix and pathway csv/gmt files 4 | #' and input and creates expression matrices for each 5 | #' pathway. The resulting output is a nested list of expression 6 | #' matrices for each pathway by each sample. 7 | #' 8 | #' @param samples Expression matrix for each population, with each population 9 | #' as a separate list. These matrices can be generated with e.g. `SCPA::seurat_extract()` 10 | #' @param pathways Either a gene set gmt file, csv file, or output from `SCPA::format_pathways()` 11 | #' that contains your gene sets of interest. Information on formatting gene sets can be found 12 | #' at https://jackbibby1.github.io/SCPA/articles/using_gene_sets.html. 13 | #' @param sample_names Names of the samples to be used in the output 14 | #' 15 | #'@examples \dontrun{ 16 | #' pathway_expression <- pathway_matrices( 17 | #' list(sample1, sample2), 18 | #' pathways = "your/path_to_gmt", 19 | #' sample_names = c("population1", "population2")) 20 | #' } 21 | #' 22 | #' @export 23 | #' 24 | #' 25 | 26 | pathway_matrices <- function(samples, 27 | pathways, 28 | sample_names = NULL) { 29 | 30 | if (class(pathways)[1] == "character") { 31 | pathways <- get_paths(pathways) 32 | } 33 | 34 | pop_paths <- vector(mode = "list", length = length(samples)) 35 | for (i in 1:length(pop_paths)) { 36 | for (c in 1:length(pathways)) { 37 | pop_paths[[i]][[c]] <- samples[[i]][rownames(samples[[i]]) %in% pathways[[c]]$Genes, ] 38 | } 39 | } 40 | 41 | if (!is.null(sample_names)) { 42 | names(pop_paths) <- sample_names 43 | } 44 | 45 | path_names <- sapply(pathways, function(x) unique(x$Pathway)) 46 | pop_paths <- lapply(pop_paths, function(x) magrittr::set_names(x, path_names)) 47 | 48 | return(pop_paths) 49 | } 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /R/PlotHeatmap.R: -------------------------------------------------------------------------------- 1 | #' Plot a heatmap of qvals from SCPA 2 | #' 3 | #' This function takes the output from SCPA and plots a 4 | #' heatmap of the qvals 5 | #' 6 | #' @param scpa_out Data frame that contains a "Pathway" column, and a column or multiple columns 7 | #' containing qvals. This can be the direct output from `compare_pathways()`, 8 | #' or a custom data frame. 9 | #' @param highlight_pathways Pathway or pathways to annotate on the heatmap, 10 | #' supplied as character vector. If no argument is given, all pathways are 11 | #' shown 12 | #' @param row_fontsize Font size of pathway names 13 | #' @param column_fontsize Font size of the sample names 14 | #' @param column_names Option to supply names of the heatmap 15 | #' columns if more than one populations is present 16 | #' @param show_row_names Should row names be shown in the heatmap? 17 | #' @param cluster_columns Should columns in the heatmap be clustered? 18 | #' @param hm_colors Colors to be used in the heatmap 19 | #' @param scale_breaks Breaks to be used in the colors of the heatmap. 20 | #' Length must be equal to the number of colors. 21 | #' 22 | #' @importFrom magrittr "%>%" 23 | #' 24 | #' @examples \dontrun{ 25 | #' plot_heatmap( 26 | #' scpa_out = scpa_result, 27 | #' pathway = "mtorc" 28 | #' ) 29 | #' } 30 | #' 31 | #' @return list of pathways with corresponding genes 32 | #' @export 33 | 34 | plot_heatmap <- function(scpa_out, 35 | highlight_pathways = NULL, 36 | row_fontsize = 6, 37 | column_fontsize = 10, 38 | column_names = colnames(scpa_out), 39 | show_row_names = TRUE, 40 | cluster_columns = TRUE, 41 | hm_colors = NULL, 42 | scale_breaks = NULL) { 43 | 44 | if (!is.null(hm_colors)) { 45 | heatmap_colors <- hm_colors 46 | } else { 47 | heatmap_colors <- c("cornflowerblue", "white", "red") 48 | } 49 | 50 | scale <- scpa_out %>% 51 | dplyr::select(grep(pattern = "qval", x = colnames(scpa_out), ignore.case = T, value = T)) %>% 52 | as.matrix() 53 | scale_breaks <- c(min(scale), mean(scale), max(scale)) 54 | 55 | hm_col <- circlize::colorRamp2(colors = heatmap_colors, breaks = scale_breaks) 56 | 57 | if (is.null(highlight_pathways) == F) { 58 | 59 | pathways <- scpa_out %>% 60 | dplyr::filter(grepl(paste(highlight_pathways, collapse = "|"), Pathway, ignore.case = T)) %>% 61 | dplyr::pull(Pathway) 62 | 63 | pathways <- gsub(pattern = "_", replacement = " ", x = pathways) 64 | 65 | scpa_out <- scpa_out %>% 66 | dplyr::mutate(Pathway = gsub(pattern = "_", replacement = " ", x = Pathway)) 67 | 68 | position <- scpa_out %>% 69 | dplyr::mutate(position = 1:nrow(.)) %>% 70 | dplyr::filter(grepl(paste(pathways, collapse = "|"), Pathway, ignore.case = T)) %>% 71 | dplyr::pull(position) 72 | 73 | scpa_out <- scpa_out %>% 74 | tibble::remove_rownames() %>% 75 | tibble::column_to_rownames("Pathway") %>% 76 | dplyr::select(grep(pattern = "qval", x = colnames(scpa_out), ignore.case = T, value = T)) 77 | 78 | row_an <- ComplexHeatmap::rowAnnotation(Genes = ComplexHeatmap::anno_mark(at = which(rownames(scpa_out) %in% pathways), 79 | labels = rownames(scpa_out)[position], 80 | labels_gp = grid::gpar(fontsize = 7), 81 | link_width = grid::unit(2.5, "mm"), 82 | padding = grid::unit(1, "mm"), 83 | link_gp = grid::gpar(lwd = 0.5))) 84 | 85 | ComplexHeatmap::Heatmap(scpa_out, 86 | name = "Qval", 87 | border = T, 88 | rect_gp = grid::gpar(col = "white", lwd = 0.1), 89 | row_names_gp = grid::gpar(fontsize = row_fontsize), 90 | column_names_gp = grid::gpar(fontsize = column_fontsize), 91 | right_annotation = row_an, 92 | column_labels = column_names, 93 | col = hm_col, 94 | show_row_names = show_row_names, 95 | row_dend_width = grid::unit(6, "mm"), 96 | cluster_columns = cluster_columns) 97 | 98 | } else { 99 | 100 | scpa_out <- scpa_out %>% 101 | dplyr::mutate(Pathway = gsub(pattern = "_", replacement = " ", x = Pathway)) %>% 102 | tibble::remove_rownames() %>% 103 | tibble::column_to_rownames("Pathway") %>% 104 | dplyr::select(grep(pattern = "qval", x = colnames(scpa_out), ignore.case = T, value = T)) 105 | 106 | ComplexHeatmap::Heatmap(scpa_out, 107 | name = "Qval", 108 | border = T, 109 | rect_gp = grid::gpar(col = "white", lwd = 0.1), 110 | row_names_gp = grid::gpar(fontsize = row_fontsize), 111 | column_names_gp = grid::gpar(fontsize = column_fontsize), 112 | show_row_names = show_row_names, 113 | column_labels = column_names, 114 | col = hm_col, 115 | row_dend_width = grid::unit(6, "mm"), 116 | cluster_columns = cluster_columns) 117 | 118 | } 119 | 120 | } 121 | -------------------------------------------------------------------------------- /R/PlotRank.R: -------------------------------------------------------------------------------- 1 | #' Plot the rank of specific pathways from SCPA output 2 | #' 3 | #' This function takes the output from SCPA and plots the 4 | #' rank of a user defined pathway. 5 | #' 6 | #' @param scpa_out Data frame containing Pathways and qvals generated from 7 | #' compare_pathways 8 | #' @param pathway Chosen pathway or pathways to plot the rank of. This can 9 | #' be specific e.g. HALLMARK_GLYCOLYSIS to plot a specific result, or 10 | #' generic e.g. glycolysis to plot all glycolysis pathways 11 | #' @param population_name Column name of the population to plot, if more 12 | #' than one population present in the data frame 13 | #' @param base_point_size Size of the base points to plot on the graph 14 | #' @param base_point_color Color of the base points to plot on the graph 15 | #' @param highlight_point_size Size of the highlighted points to plot on the graph 16 | #' @param highlight_point_color Color of the highlighted points to plot on the graph 17 | #' @param label_pathway Should the selected pathway be labelled? 18 | #' @param label_size Text size of the pathway label 19 | #' 20 | #' @examples \dontrun{ 21 | #' plot_rank( 22 | #' scpa_out = scpa_result, 23 | #' pathway = "interferon", 24 | #' population_name = cd4_qval, 25 | #' ) 26 | #' } 27 | #' 28 | #' @return list of pathways with corresponding genes 29 | #' @export 30 | 31 | plot_rank <- function(scpa_out, 32 | pathway, 33 | population_name = "qval", 34 | base_point_size = 2, 35 | base_point_color = "gray70", 36 | highlight_point_size = 3, 37 | highlight_point_color = "cornflowerblue", 38 | label_pathway = T, 39 | label_size = 4) { 40 | 41 | selected_paths <- grep(pattern = paste(pathway, collapse = "|"), x = scpa_out$Pathway, ignore.case = T, value = T) 42 | 43 | path_ranking <- dplyr::arrange(scpa_out, dplyr::desc(population_name)) 44 | path_ranking$path_rank <- dplyr::percent_rank(path_ranking[[population_name]])*100 45 | 46 | df_sub <- subset(path_ranking, path_ranking$Pathway %in% selected_paths) 47 | 48 | if (label_pathway == T) { 49 | path_lab <- grep(pattern = paste(pathway, collapse = "|"), path_ranking$Pathway, value = T, ignore.case = T) 50 | path_lab <- path_ranking[path_ranking$Pathway %in% path_lab, ] 51 | path_lab$Pathway <- gsub(x = path_lab$Pathway, pattern = "_", replacement = " ") 52 | path_lab$Pathway <- stringr::str_to_title(path_lab$Pathway) 53 | 54 | ggplot2::ggplot(path_ranking, ggplot2::aes(.data[[population_name]], path_rank)) + 55 | ggplot2::geom_hline(yintercept = c(0, 25, 50, 75, 100), linetype = 'dotted', lwd = 0.3, color = 'gray40') + 56 | ggplot2::geom_point(shape = 21, cex = base_point_size, color = 'black', fill = base_point_color, stroke = 0.05) + 57 | ggrepel::geom_label_repel(data = path_lab, label = path_lab$Pathway, 58 | size = label_size, label.padding = ggplot2::unit(0.7, "mm"), 59 | label.r = ggplot2::unit(0.3, "mm"), nudge_x = -30) + 60 | ggplot2::geom_point(data = df_sub, shape = 21, cex = highlight_point_size, color = 'black', fill = highlight_point_color) + 61 | ggplot2::xlab("Qval") + 62 | ggplot2::ylab("Pathway rank") + 63 | ggplot2::scale_y_continuous(expand = c(0.03, 0.03), breaks = c(0, 25, 50, 75, 100)) + 64 | ggplot2::scale_x_continuous(expand = c(0.2, 0.2)) + 65 | ggplot2::theme(panel.border = ggplot2::element_rect(fill = NA), 66 | panel.background = ggplot2::element_blank(), 67 | title = ggplot2::element_text(size = 9), 68 | axis.title = ggplot2::element_text(size = 11)) 69 | 70 | } else { 71 | 72 | ggplot2::ggplot(path_ranking, ggplot2::aes(.data[[population_name]], path_rank)) + 73 | ggplot2::geom_hline(yintercept = c(0, 25, 50, 75, 100), linetype = 'dotted', lwd = 0.3, color = 'gray40') + 74 | ggplot2::geom_point(shape = 21, cex = base_point_size, color = 'black', fill = base_point_color, stroke = 0.05) + 75 | ggplot2::geom_point(data = df_sub, shape = 21, cex = highlight_point_size, color = 'black', fill = highlight_point_color) + 76 | ggplot2::xlab("Qval") + 77 | ggplot2::ylab("Pathway rank") + 78 | ggplot2::scale_y_continuous(expand = c(0.03, 0.03), breaks = c(0, 25, 50, 75, 100)) + 79 | ggplot2::scale_x_continuous(expand = c(0.2, 0.2)) + 80 | ggplot2::theme(panel.border = ggplot2::element_rect(fill = NA), 81 | panel.background = ggplot2::element_blank(), 82 | title = ggplot2::element_text(size = 9), 83 | axis.title = ggplot2::element_text(size = 11)) 84 | 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /R/RandomCells.R: -------------------------------------------------------------------------------- 1 | #' Randomly sample cells (columns) 2 | #' 3 | #' This function takes a matrix or data frame as 4 | #' input and randomly samples columns 5 | #' 6 | #' @param df Data frame or matrix. 7 | #' @param n Number of cells to sample. 8 | #' 9 | #' @return Matrix or data frame of n randomly sampled rows 10 | #' 11 | #' @export 12 | #' 13 | #' @examples \dontrun{ 14 | #' df <- matrix(1:1000, 500, 20) 15 | #' sub_df <- random_cells( 16 | #' df = df, 17 | #' n = 20 18 | #') 19 | #'} 20 | 21 | random_cells <- function(df, n){ 22 | return(df[, sample(ncol(df), n)]) 23 | } 24 | -------------------------------------------------------------------------------- /R/SceExtract.R: -------------------------------------------------------------------------------- 1 | #' Extract data from a SingleCellExperiment object 2 | #' 3 | #' This function takes a SingleCellExperiment object as an input, and returns 4 | #' an expression matrix based on subsetting parameters. Either none, one, or 5 | #' two metadata features can be selected for a given input. 6 | #' 7 | #' @param sce_object SingleCellExperiment object containing expression data 8 | #' @param assay_name Name of assay to pull from. Defaults to "logcounts" 9 | #' @param meta1 Metadata column to subset 10 | #' @param value_meta1 Value to select within `meta1` column 11 | #' @param meta2 Metadata column to subset 12 | #' @param value_meta2 Value to select within `meta2` column 13 | #' @param pseudocount Pseudocount to add to data. Defaults to 0.001 14 | #' 15 | #' @examples \dontrun{ 16 | #' cd4 <- sce_extract( 17 | #' sce_object, 18 | #' meta1 = "Hour", 19 | #' value_meta1 = 12, 20 | #' meta2 = "Cell_Type", 21 | #' value_meta2 = "CD4" 22 | #' ) 23 | #' } 24 | #' 25 | #' @return Matrix containing count values of selected populations 26 | #' @export 27 | 28 | sce_extract <- function(sce_object, 29 | assay_name = "logcounts", 30 | meta1 = NULL, value_meta1 = NULL, 31 | meta2 = NULL, value_meta2 = NULL, 32 | pseudocount = 0.001) { 33 | 34 | if (is.null(meta1) && is.null(meta2)) { 35 | message("No metadata selected. Converting whole SCE object to matrix") 36 | sub_sce <- SummarizedExperiment::assay(sce_object, assay_name) 37 | sub_sce <- as.matrix(sub_sce) + pseudocount 38 | return(sub_sce) 39 | } 40 | 41 | if (!is.null(meta1) && is.null(meta2)) { 42 | message(paste0("Extracting cells where ", meta1, " == ", value_meta1)) 43 | sub_sce <- sce_object[, sce_object[[meta1]] == value_meta1] 44 | sub_sce <- SummarizedExperiment::assay(sub_sce, assay_name) 45 | sub_sce <- as.matrix(sub_sce) + pseudocount 46 | return(sub_sce) 47 | } 48 | 49 | if(!is.null(meta1) && !is.null(meta2)) { 50 | message(paste0("Extracting cells where ", meta1, " == ", value_meta1, 51 | " AND ", meta2, " == ", value_meta2)) 52 | sub_sce <- sce_object[, sce_object[[meta1]] == value_meta1 & 53 | sce_object[[meta2]] == value_meta2] 54 | sub_sce <- SummarizedExperiment::assay(sub_sce, assay_name) 55 | sub_sce <- as.matrix(sub_sce) + pseudocount 56 | return(sub_sce) 57 | } 58 | } 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /R/SeuratExtract.R: -------------------------------------------------------------------------------- 1 | #' Extract Data From A Seurat Object 2 | #' 3 | #' This function takes a Seurat object as an input, and returns 4 | #' an expression matrix based on subsetting parameters. Either none, one, or 5 | #' two metadata features can be selected for a given input. 6 | #' 7 | #' @param seu_obj Seurat object 8 | #' @param assay Seurat assay to extract. Defaults to RNA 9 | #' @param meta1 Metadata column to subset 10 | #' @param meta2 Metadata column to subset 11 | #' @param value_meta1 Value to select within `meta1` column 12 | #' @param value_meta2 Value to select within `meta2` column 13 | #' @param pseudocount Pseudocount to add to data. Defaults to 0.001 14 | #' 15 | #' @examples \dontrun{ 16 | #' cd4 <- seurat_extract( 17 | #' Seurat_Object, 18 | #' meta1 = "Hour", 19 | #' value_meta1 = 12, 20 | #' meta2 = "Cell_Type", 21 | #' value_meta2 = "CD4" 22 | #' ) 23 | #' } 24 | #' 25 | #' @return Matrix containing count values of selected populations 26 | #' @export 27 | 28 | seurat_extract <- function(seu_obj, 29 | assay = "RNA", 30 | meta1 = NULL, 31 | value_meta1 = NULL, 32 | meta2 = NULL, 33 | value_meta2 = NULL, 34 | pseudocount = 0.001) { 35 | 36 | seurat_version <- SeuratObject::Version(seu_obj) 37 | seurat_version <- unlist(seurat_version)[1] 38 | 39 | if (is.null(meta1) && is.null(meta2)) { 40 | message("No metadata selected. Will convert whole Seurat object to matrix") 41 | if (seurat_version < 5) { 42 | seu_obj <- as.matrix(Seurat::GetAssay(seu_obj, assay)@data) + pseudocount 43 | } else { 44 | seu_obj <- as.matrix(SeuratObject::LayerData(seu_obj, assay = assay, layer = "data")) + pseudocount 45 | } 46 | message("Extracting data from the ", assay, " assay") 47 | return(seu_obj) 48 | } 49 | 50 | if (!is.null(meta1) && is.null(meta2)) { 51 | message(paste0("Extracting cells where ", meta1, " == ", value_meta1)) 52 | met_1 <- Seurat::FetchData(object = seu_obj, vars = meta1) 53 | seu_obj <- seu_obj[, which(met_1 == value_meta1)] 54 | if (seurat_version < 5) { 55 | seu_obj <- as.matrix(Seurat::GetAssay(seu_obj, assay)@data) + pseudocount 56 | } else { 57 | seu_obj <- as.matrix(SeuratObject::LayerData(seu_obj, assay = assay, layer = "data")) + pseudocount 58 | } 59 | message("Extracting data from the ", assay, " assay") 60 | return(seu_obj) 61 | } 62 | 63 | if(!is.null(meta1) && !is.null(meta2)) { 64 | message(paste0("Extracting cells where ", meta1, " == ", value_meta1, 65 | " AND ", meta2, " == ", value_meta2)) 66 | met_1 <- Seurat::FetchData(object = seu_obj, vars = meta1) 67 | met_2 <- Seurat::FetchData(object = seu_obj, vars = meta2) 68 | seu_obj <- seu_obj[, which(met_1 == value_meta1 & met_2 == value_meta2)] 69 | if (seurat_version < 5) { 70 | seu_obj <- as.matrix(Seurat::GetAssay(seu_obj, assay)@data) + pseudocount 71 | } else { 72 | seu_obj <- as.matrix(SeuratObject::LayerData(seu_obj, assay = assay, layer = "data")) + pseudocount 73 | } 74 | message("Extracting data from the ", assay, " assay") 75 | return(seu_obj) 76 | } 77 | 78 | } 79 | 80 | 81 | -------------------------------------------------------------------------------- /R/utils-pipe.R: -------------------------------------------------------------------------------- 1 | #' Pipe operator 2 | #' 3 | #' See \code{magrittr::\link[magrittr:pipe]{\%>\%}} for details. 4 | #' 5 | #' @name %>% 6 | #' @rdname pipe 7 | #' @keywords internal 8 | #' @export 9 | #' @importFrom magrittr %>% 10 | #' @usage lhs \%>\% rhs 11 | #' @param lhs A value or the magrittr placeholder. 12 | #' @param rhs A function call using the magrittr semantics. 13 | #' @return The result of calling `rhs(lhs)`. 14 | NULL 15 | -------------------------------------------------------------------------------- /R/zzz.R: -------------------------------------------------------------------------------- 1 | .onAttach <- function(libname, pkgname) { 2 | version <- utils::packageDescription(pkgname, fields = "Version") 3 | msg <- paste0("==================== 4 | ", "This is ", "version ", version, " of ", pkgname, " 5 | For SCPA tutorials and latest version: https://jackbibby1.github.io/SCPA/ 6 | For the SCPA GitHub page: https://github.com/jackbibby1/SCPA 7 | If you use SCPA, please cite: Bibby JA. et al. Cell Rep. 2022 8 | ==================== 9 | ") 10 | 11 | packageStartupMessage(msg) 12 | 13 | } 14 | -------------------------------------------------------------------------------- /README.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: github_document 3 | --- 4 | 5 | 6 | 7 | ```{r, include = FALSE} 8 | knitr::opts_chunk$set( 9 | collapse = TRUE, 10 | comment = "#>", 11 | fig.path = "man/figures/", 12 | out.width = "100%" 13 | ) 14 | ``` 15 | 16 | 17 | 18 | 19 | # Single Cell Pathway Analysis 20 | ![](man/figures/scpa_outline.png) 21 | 22 | ### On this page 23 | 1. Recent updates to SCPA 24 | 1. A brief [overview](https://jackbibby1.github.io/SCPA/#about-scpa) of SCPA 25 | 1. Package [installation](https://jackbibby1.github.io/SCPA/#installation) 26 | 1. Links to [tutorials](https://jackbibby1.github.io/SCPA/#tutorials) 27 | 1. Submitting [issues/comments](https://jackbibby1.github.io/SCPA/#issues) 28 | 1. [Improvements/changes/updates](https://jackbibby1.github.io/SCPA/news/index.html) to SCPA 29 | 30 | ### Recent updates 31 | - Compatability with Seurat v5 objects to use the layer system in `seurat_extract()` and `compare_seurat()` (v1.6). SCPA automatically detects Seurat object version 32 | - Ability to specify [multiple gmt files](https://jackbibby1.github.io/SCPA/articles/using_gene_sets.html#using-a-gmt-file) as your pathway input (v1.5.2) 33 | - [Parallel processing](https://jackbibby1.github.io/SCPA/articles/parallel_implementation.html) implemented to speed up analyses (v1.5.0) 34 | - Much more efficient usage of memory, so this shouldn't be limiting (v1.3.0) 35 | 36 | ### About SCPA 37 | SCPA is a method for pathway analysis in single cell RNA-seq data. It's a different approach to pathway analysis that defines pathway activity as a change in multivariate distribution of a given pathway across conditions, rather than enrichment or over representation of genes. 38 | 39 | This approach allows for a number of benefits over current methods: 40 | 41 | 1. Multivariate distribution testing allows for the identification of pathways that show enrichment in a given population AND also pathways that show transcriptional change independent of enrichment. You essentially get the best of both worlds, as pathways with changes in multivariate distribution (high qval) but no overall enrichment (low fold change) are still interestingly different pathways, as we show in [our paper](https://www.cell.com/cell-reports/fulltext/S2211-1247(22)01571-6). For more on this, see our [SCPA interpretation page](https://jackbibby1.github.io/SCPA/articles/interpreting_scpa_output.html) 42 | 43 | 1. SCPA allows for multisample testing, so you can compare multiple conditions simultaneously e.g. compare across 3 time points, or across multiple phases of a [pseuodotime trajectory](https://jackbibby1.github.io/SCPA/articles/pseudotime.html). This means you can assess pathway activity through multiple stimulation phases, or across cell differentiation 44 | 45 | SCPA can be applied directly on Seurat and SCE objects, as well as manually subsetted expression matrices. You just need to 46 | supply this along with your pathways that you want to analyse. 47 | 48 | To see the stats behind SCPA, you can see our paper in JASA [here](https://www.tandfonline.com/doi/full/10.1080/01621459.2020.1791131) 49 | 50 | Our paper introducing SCPA and demonstrating its use on a T cell scRNA-seq dataset 51 | is published in Cell Reports [here](https://www.cell.com/cell-reports/fulltext/S2211-1247(22)01571-6) 52 | 53 | ### Installation 54 | 55 | You can install SCPA by running: 56 | 57 | ``` r 58 | # install.packages("devtools") 59 | devtools::install_version("crossmatch", version = "1.3.1", repos = "http://cran.us.r-project.org") 60 | devtools::install_version("multicross", version = "2.1.0", repos = "http://cran.us.r-project.org") 61 | devtools::install_github("jackbibby1/SCPA") 62 | ``` 63 | 64 | ### Installation problems 65 | 66 | If you're running into installation errors, you'll likely need to manually install the dependencies that are mentioned in the error. For example, see these issues [here](https://github.com/jackbibby1/SCPA/issues/54) and [here](https://github.com/jackbibby1/SCPA/issues/56) 67 | 68 | ### Tutorials 69 | 70 | If you're viewing this page on GitHub, the SCPA webpage with all the documentation and tutorials is [here](https://jackbibby1.github.io/SCPA/) 71 | 72 | We have various examples and walkthroughs, including: 73 | 74 | - A generic quick start [tutorial](https://jackbibby1.github.io/SCPA/articles/quick_start.html) on a basic scRNA-seq dataset 75 | - A [tutorial](https://jackbibby1.github.io/SCPA/articles/using_gene_sets.html) on how to get and use gene sets with SCPA 76 | - [An outline](https://jackbibby1.github.io/SCPA/articles/parallel_implementation.html) for speeding up SCPA with parallel processing 77 | - A [tutorial](https://jackbibby1.github.io/SCPA/articles/comparing_two_populations.html) for more detailed two group comparison with a specific scRNA-seq data set 78 | - A [tutorial](https://jackbibby1.github.io/SCPA/articles/seurat_comparison.html) on how to use SCPA directly within a Seurat or SingleCellExperiment object 79 | - A [tutorial](https://jackbibby1.github.io/SCPA/articles/visualisation.html) on visualising SCPA output 80 | - A [tutorial](https://jackbibby1.github.io/SCPA/articles/pseudotime.html) for multisample SCPA, comparing pathways across a scRNA-seq T cell pseudotime trajectory 81 | - A [tutorial](https://jackbibby1.github.io/SCPA/articles/systematic_tissue_comparison.html) of a systematic analysis of many cell types across multiple tissues 82 | - A [tutorial](https://jackbibby1.github.io/SCPA/articles/disease_comparison.html) for a systems level analysis of many cells types in disease (COVID-19) 83 | 84 | ### Issues 85 | 86 | To report any issues or submit comments please use: https://github.com/jackbibby1/SCPA/issues 87 | 88 | ### Changelog 89 | 90 | Any new features or alterations to SCPA can be found [here](https://jackbibby1.github.io/SCPA/news/index.html) 91 | 92 | 93 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | # Single Cell Pathway Analysis 7 | 8 | ![](man/figures/scpa_outline.png) 9 | 10 | ### On this page 11 | 12 | 1. Recent updates to SCPA 13 | 2. A brief [overview](https://jackbibby1.github.io/SCPA/#about-scpa) of 14 | SCPA 15 | 3. Package 16 | [installation](https://jackbibby1.github.io/SCPA/#installation) 17 | 4. Links to [tutorials](https://jackbibby1.github.io/SCPA/#tutorials) 18 | 5. Submitting 19 | [issues/comments](https://jackbibby1.github.io/SCPA/#issues) 20 | 6. [Improvements/changes/updates](https://jackbibby1.github.io/SCPA/news/index.html) 21 | to SCPA 22 | 23 | ### Recent updates 24 | 25 | - Compatability with Seurat v5 objects to use the layer system in 26 | `seurat_extract()` and `compare_seurat()` (v1.6). SCPA automatically 27 | detects Seurat object version 28 | - Ability to specify [multiple gmt 29 | files](https://jackbibby1.github.io/SCPA/articles/using_gene_sets.html#using-a-gmt-file) 30 | as your pathway input (v1.5.2) 31 | - [Parallel 32 | processing](https://jackbibby1.github.io/SCPA/articles/parallel_implementation.html) 33 | implemented to speed up analyses (v1.5.0) 34 | - Much more efficient usage of memory, so this shouldn’t be limiting 35 | (v1.3.0) 36 | 37 | ### About SCPA 38 | 39 | SCPA is a method for pathway analysis in single cell RNA-seq data. It’s 40 | a different approach to pathway analysis that defines pathway activity 41 | as a change in multivariate distribution of a given pathway across 42 | conditions, rather than enrichment or over representation of genes. 43 | 44 | This approach allows for a number of benefits over current methods: 45 | 46 | 1. Multivariate distribution testing allows for the identification of 47 | pathways that show enrichment in a given population AND also 48 | pathways that show transcriptional change independent of enrichment. 49 | You essentially get the best of both worlds, as pathways with 50 | changes in multivariate distribution (high qval) but no overall 51 | enrichment (low fold change) are still interestingly different 52 | pathways, as we show in [our 53 | paper](https://www.cell.com/cell-reports/fulltext/S2211-1247(22)01571-6). 54 | For more on this, see our [SCPA interpretation 55 | page](https://jackbibby1.github.io/SCPA/articles/interpreting_scpa_output.html) 56 | 57 | 2. SCPA allows for multisample testing, so you can compare multiple 58 | conditions simultaneously e.g. compare across 3 time points, or 59 | across multiple phases of a [pseuodotime 60 | trajectory](https://jackbibby1.github.io/SCPA/articles/pseudotime.html). 61 | This means you can assess pathway activity through multiple 62 | stimulation phases, or across cell differentiation 63 | 64 | SCPA can be applied directly on Seurat and SCE objects, as well as 65 | manually subsetted expression matrices. You just need to supply this 66 | along with your pathways that you want to analyse. 67 | 68 | To see the stats behind SCPA, you can see our paper in JASA 69 | [here](https://www.tandfonline.com/doi/full/10.1080/01621459.2020.1791131) 70 | 71 | Our paper introducing SCPA and demonstrating its use on a T cell 72 | scRNA-seq dataset is published in Cell Reports 73 | [here](https://www.cell.com/cell-reports/fulltext/S2211-1247(22)01571-6) 74 | 75 | ### Installation 76 | 77 | You can install SCPA by running: 78 | 79 | ``` r 80 | # install.packages("devtools") 81 | devtools::install_version("crossmatch", version = "1.3.1", repos = "http://cran.us.r-project.org") 82 | devtools::install_version("multicross", version = "2.1.0", repos = "http://cran.us.r-project.org") 83 | devtools::install_github("jackbibby1/SCPA") 84 | ``` 85 | 86 | ### Installation problems 87 | 88 | If you’re running into installation errors, you’ll likely need to 89 | manually install the dependencies that are mentioned in the error. For 90 | example, see these issues 91 | [here](https://github.com/jackbibby1/SCPA/issues/54) and 92 | [here](https://github.com/jackbibby1/SCPA/issues/56) 93 | 94 | ### Tutorials 95 | 96 | If you’re viewing this page on GitHub, the SCPA webpage with all the 97 | documentation and tutorials is 98 | [here](https://jackbibby1.github.io/SCPA/) 99 | 100 | We have various examples and walkthroughs, including: 101 | 102 | - A generic quick start 103 | [tutorial](https://jackbibby1.github.io/SCPA/articles/quick_start.html) 104 | on a basic scRNA-seq dataset 105 | - A 106 | [tutorial](https://jackbibby1.github.io/SCPA/articles/using_gene_sets.html) 107 | on how to get and use gene sets with SCPA 108 | - [An 109 | outline](https://jackbibby1.github.io/SCPA/articles/parallel_implementation.html) 110 | for speeding up SCPA with parallel processing 111 | - A 112 | [tutorial](https://jackbibby1.github.io/SCPA/articles/comparing_two_populations.html) 113 | for more detailed two group comparison with a specific scRNA-seq data 114 | set 115 | - A 116 | [tutorial](https://jackbibby1.github.io/SCPA/articles/seurat_comparison.html) 117 | on how to use SCPA directly within a Seurat or SingleCellExperiment 118 | object 119 | - A 120 | [tutorial](https://jackbibby1.github.io/SCPA/articles/visualisation.html) 121 | on visualising SCPA output 122 | - A 123 | [tutorial](https://jackbibby1.github.io/SCPA/articles/pseudotime.html) 124 | for multisample SCPA, comparing pathways across a scRNA-seq T cell 125 | pseudotime trajectory 126 | - A 127 | [tutorial](https://jackbibby1.github.io/SCPA/articles/systematic_tissue_comparison.html) 128 | of a systematic analysis of many cell types across multiple tissues 129 | - A 130 | [tutorial](https://jackbibby1.github.io/SCPA/articles/disease_comparison.html) 131 | for a systems level analysis of many cells types in disease (COVID-19) 132 | 133 | ### Issues 134 | 135 | To report any issues or submit comments please use: 136 | 137 | 138 | ### Changelog 139 | 140 | Any new features or alterations to SCPA can be found 141 | [here](https://jackbibby1.github.io/SCPA/news/index.html) 142 | -------------------------------------------------------------------------------- /SCPA.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: No 4 | SaveWorkspace: No 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | LineEndingConversion: Posix 18 | 19 | BuildType: Package 20 | PackageUseDevtools: Yes 21 | PackageInstallArgs: --no-multiarch --with-keep.source 22 | PackageRoxygenize: rd,collate,namespace 23 | -------------------------------------------------------------------------------- /_pkgdown.yml: -------------------------------------------------------------------------------- 1 | url: jackbibby1.github.io/SCPA 2 | 3 | title: Single Cell Pathway Analysis (SCPA) 4 | 5 | template: 6 | params: 7 | bootswatch: flatly 8 | ganalytics: G-W1XR84YEPZ 9 | docsearch: 10 | api_key: 707823119dd85fca87c488f81a2086dd 11 | index_name: single-cell-pathway-analysis 12 | 13 | navbar: 14 | structure: 15 | left: [home, tutorials, reference, news] 16 | right: [github] 17 | components: 18 | tutorials: 19 | text: Tutorials 20 | menu: 21 | - text: General information 22 | - text: Interpreting the SCPA output 23 | href: articles/interpreting_scpa_output.html 24 | - text: ------------ 25 | - text: Generic example 26 | - text: Quick start 27 | href: articles/quick_start.html 28 | - text: ------------ 29 | - text: Speeding up SCPA 30 | - text: Parallel processing for faster analysis 31 | href: articles/parallel_implementation.html 32 | - text: ------------ 33 | - text: Interacting with gene sets 34 | - text: Using gene sets 35 | href: articles/using_gene_sets.html 36 | - text: ------------ 37 | - text: Specific examples 38 | - text: Comparing two populations 39 | href: articles/comparing_two_populations.html 40 | - text: Seurat/SingleCellExperiment comparison 41 | href: articles/seurat_comparison.html 42 | - text: Comparing across pseudotime 43 | href: articles/pseudotime.html 44 | - text: Systematic comparisons of cells across tissue 45 | href: articles/systematic_tissue_comparison.html 46 | - text: Systems level pathway analysis in disease 47 | href: articles/disease_comparison.html 48 | - text: ------------ 49 | - text: Visualisation 50 | - text: Visualising SCPA output 51 | href: articles/visualisation.html 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /docs/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /docs/apple-touch-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/apple-touch-icon-152x152.png -------------------------------------------------------------------------------- /docs/apple-touch-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/apple-touch-icon-180x180.png -------------------------------------------------------------------------------- /docs/apple-touch-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/apple-touch-icon-60x60.png -------------------------------------------------------------------------------- /docs/apple-touch-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/apple-touch-icon-76x76.png -------------------------------------------------------------------------------- /docs/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/apple-touch-icon.png -------------------------------------------------------------------------------- /docs/articles/SCPA.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | SCPA • Single Cell Pathway Analysis (SCPA) 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 20 | 21 | 22 |
23 |
90 | 91 | 92 | 93 | 94 |
95 |
96 | 104 | 105 | 106 | 107 |
108 | library(SCPA)
109 |
110 | 111 | 114 | 115 |
116 | 117 | 118 | 119 |
122 | 123 |
124 |

Site built with pkgdown 1.6.1.

125 |
126 | 127 |
128 |
129 | 130 | 131 | 132 | 133 | 134 | 135 | -------------------------------------------------------------------------------- /docs/articles/SCPA_files/header-attrs-2.11/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /docs/articles/comparing_two_populations_files/header-attrs-2.11/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /docs/articles/disease_comparison_files/header-attrs-2.11/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /docs/articles/pseudotime_files/header-attrs-2.11/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /docs/articles/quick_start_files/figure-html/plot_rank-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/articles/quick_start_files/figure-html/plot_rank-1.png -------------------------------------------------------------------------------- /docs/articles/quick_start_files/header-attrs-2.11/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /docs/articles/seurat_comparison_files/header-attrs-2.11/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /docs/articles/systematic_tissue_comparison_files/header-attrs-2.11/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /docs/articles/using_gene_sets_files/header-attrs-2.11/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /docs/articles/visualisation_files/figure-html/unnamed-chunk-4-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/articles/visualisation_files/figure-html/unnamed-chunk-4-1.png -------------------------------------------------------------------------------- /docs/articles/visualisation_files/figure-html/unnamed-chunk-5-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/articles/visualisation_files/figure-html/unnamed-chunk-5-1.png -------------------------------------------------------------------------------- /docs/articles/visualisation_files/figure-html/unnamed-chunk-6-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/articles/visualisation_files/figure-html/unnamed-chunk-6-1.png -------------------------------------------------------------------------------- /docs/bootstrap-toc.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) 3 | * Copyright 2015 Aidan Feldman 4 | * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ 5 | 6 | /* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ 7 | 8 | /* All levels of nav */ 9 | nav[data-toggle='toc'] .nav > li > a { 10 | display: block; 11 | padding: 4px 20px; 12 | font-size: 13px; 13 | font-weight: 500; 14 | color: #767676; 15 | } 16 | nav[data-toggle='toc'] .nav > li > a:hover, 17 | nav[data-toggle='toc'] .nav > li > a:focus { 18 | padding-left: 19px; 19 | color: #563d7c; 20 | text-decoration: none; 21 | background-color: transparent; 22 | border-left: 1px solid #563d7c; 23 | } 24 | nav[data-toggle='toc'] .nav > .active > a, 25 | nav[data-toggle='toc'] .nav > .active:hover > a, 26 | nav[data-toggle='toc'] .nav > .active:focus > a { 27 | padding-left: 18px; 28 | font-weight: bold; 29 | color: #563d7c; 30 | background-color: transparent; 31 | border-left: 2px solid #563d7c; 32 | } 33 | 34 | /* Nav: second level (shown on .active) */ 35 | nav[data-toggle='toc'] .nav .nav { 36 | display: none; /* Hide by default, but at >768px, show it */ 37 | padding-bottom: 10px; 38 | } 39 | nav[data-toggle='toc'] .nav .nav > li > a { 40 | padding-top: 1px; 41 | padding-bottom: 1px; 42 | padding-left: 30px; 43 | font-size: 12px; 44 | font-weight: normal; 45 | } 46 | nav[data-toggle='toc'] .nav .nav > li > a:hover, 47 | nav[data-toggle='toc'] .nav .nav > li > a:focus { 48 | padding-left: 29px; 49 | } 50 | nav[data-toggle='toc'] .nav .nav > .active > a, 51 | nav[data-toggle='toc'] .nav .nav > .active:hover > a, 52 | nav[data-toggle='toc'] .nav .nav > .active:focus > a { 53 | padding-left: 28px; 54 | font-weight: 500; 55 | } 56 | 57 | /* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ 58 | nav[data-toggle='toc'] .nav > .active > ul { 59 | display: block; 60 | } 61 | -------------------------------------------------------------------------------- /docs/bootstrap-toc.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) 3 | * Copyright 2015 Aidan Feldman 4 | * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ 5 | (function() { 6 | 'use strict'; 7 | 8 | window.Toc = { 9 | helpers: { 10 | // return all matching elements in the set, or their descendants 11 | findOrFilter: function($el, selector) { 12 | // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ 13 | // http://stackoverflow.com/a/12731439/358804 14 | var $descendants = $el.find(selector); 15 | return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])'); 16 | }, 17 | 18 | generateUniqueIdBase: function(el) { 19 | var text = $(el).text(); 20 | var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-'); 21 | return anchor || el.tagName.toLowerCase(); 22 | }, 23 | 24 | generateUniqueId: function(el) { 25 | var anchorBase = this.generateUniqueIdBase(el); 26 | for (var i = 0; ; i++) { 27 | var anchor = anchorBase; 28 | if (i > 0) { 29 | // add suffix 30 | anchor += '-' + i; 31 | } 32 | // check if ID already exists 33 | if (!document.getElementById(anchor)) { 34 | return anchor; 35 | } 36 | } 37 | }, 38 | 39 | generateAnchor: function(el) { 40 | if (el.id) { 41 | return el.id; 42 | } else { 43 | var anchor = this.generateUniqueId(el); 44 | el.id = anchor; 45 | return anchor; 46 | } 47 | }, 48 | 49 | createNavList: function() { 50 | return $(''); 51 | }, 52 | 53 | createChildNavList: function($parent) { 54 | var $childList = this.createNavList(); 55 | $parent.append($childList); 56 | return $childList; 57 | }, 58 | 59 | generateNavEl: function(anchor, text) { 60 | var $a = $(''); 61 | $a.attr('href', '#' + anchor); 62 | $a.text(text); 63 | var $li = $('
  • '); 64 | $li.append($a); 65 | return $li; 66 | }, 67 | 68 | generateNavItem: function(headingEl) { 69 | var anchor = this.generateAnchor(headingEl); 70 | var $heading = $(headingEl); 71 | var text = $heading.data('toc-text') || $heading.text(); 72 | return this.generateNavEl(anchor, text); 73 | }, 74 | 75 | // Find the first heading level (`

    `, then `

    `, etc.) that has more than one element. Defaults to 1 (for `

    `). 76 | getTopLevel: function($scope) { 77 | for (var i = 1; i <= 6; i++) { 78 | var $headings = this.findOrFilter($scope, 'h' + i); 79 | if ($headings.length > 1) { 80 | return i; 81 | } 82 | } 83 | 84 | return 1; 85 | }, 86 | 87 | // returns the elements for the top level, and the next below it 88 | getHeadings: function($scope, topLevel) { 89 | var topSelector = 'h' + topLevel; 90 | 91 | var secondaryLevel = topLevel + 1; 92 | var secondarySelector = 'h' + secondaryLevel; 93 | 94 | return this.findOrFilter($scope, topSelector + ',' + secondarySelector); 95 | }, 96 | 97 | getNavLevel: function(el) { 98 | return parseInt(el.tagName.charAt(1), 10); 99 | }, 100 | 101 | populateNav: function($topContext, topLevel, $headings) { 102 | var $context = $topContext; 103 | var $prevNav; 104 | 105 | var helpers = this; 106 | $headings.each(function(i, el) { 107 | var $newNav = helpers.generateNavItem(el); 108 | var navLevel = helpers.getNavLevel(el); 109 | 110 | // determine the proper $context 111 | if (navLevel === topLevel) { 112 | // use top level 113 | $context = $topContext; 114 | } else if ($prevNav && $context === $topContext) { 115 | // create a new level of the tree and switch to it 116 | $context = helpers.createChildNavList($prevNav); 117 | } // else use the current $context 118 | 119 | $context.append($newNav); 120 | 121 | $prevNav = $newNav; 122 | }); 123 | }, 124 | 125 | parseOps: function(arg) { 126 | var opts; 127 | if (arg.jquery) { 128 | opts = { 129 | $nav: arg 130 | }; 131 | } else { 132 | opts = arg; 133 | } 134 | opts.$scope = opts.$scope || $(document.body); 135 | return opts; 136 | } 137 | }, 138 | 139 | // accepts a jQuery object, or an options object 140 | init: function(opts) { 141 | opts = this.helpers.parseOps(opts); 142 | 143 | // ensure that the data attribute is in place for styling 144 | opts.$nav.attr('data-toggle', 'toc'); 145 | 146 | var $topContext = this.helpers.createChildNavList(opts.$nav); 147 | var topLevel = this.helpers.getTopLevel(opts.$scope); 148 | var $headings = this.helpers.getHeadings(opts.$scope, topLevel); 149 | this.helpers.populateNav($topContext, topLevel, $headings); 150 | } 151 | }; 152 | 153 | $(function() { 154 | $('nav[data-toggle="toc"]').each(function(i, el) { 155 | var $nav = $(el); 156 | Toc.init($nav); 157 | }); 158 | }); 159 | })(); 160 | -------------------------------------------------------------------------------- /docs/code-color-scheme-dark.css: -------------------------------------------------------------------------------- 1 | pre { 2 | word-wrap: normal; 3 | word-break: normal; 4 | /*border: 1px solid #eee;*/ 5 | border: 0px !important; 6 | } 7 | 8 | pre, code { 9 | background-color: #1c1c1c; 10 | color: #ccc; 11 | } 12 | 13 | pre code { 14 | overflow: auto; 15 | word-wrap: normal; 16 | white-space: pre; 17 | } 18 | 19 | pre .img { 20 | margin: 5px 0; 21 | } 22 | 23 | pre .img img { 24 | background-color: #aaa; 25 | display: block; 26 | height: auto; 27 | } 28 | 29 | code a, pre a { 30 | font-family: ui-monospace, SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace; 31 | color: #85AACC; 32 | text-decoration: underline; 33 | } 34 | 35 | a.sourceLine:hover { 36 | text-decoration: none; 37 | } 38 | 39 | pre code span.fl {color: #ae81ff;} 40 | pre code span.fu {color: #ade837;} /* function */ 41 | pre code span.ch, pre code span.st {color: #e7db74;} /* string */ 42 | pre code span.kw {color: #f92672;} /* keyword */ 43 | pre code span.co {color: #696d70;} /* comment */ 44 | pre code span.va {color: #fd971f;} /* values */ 45 | 46 | pre code span.message { color: black; font-weight: bolder;} 47 | pre code span.error { color: orange; font-weight: bolder;} 48 | pre code span.warning { color: #6A0366; font-weight: bolder;} 49 | -------------------------------------------------------------------------------- /docs/code-color-scheme-light.css: -------------------------------------------------------------------------------- 1 | pre { 2 | word-wrap: normal; 3 | word-break: normal; 4 | /*border: 1px solid #eee;*/ 5 | border: 0px !important; 6 | } 7 | 8 | pre, code { 9 | background-color: #f8f8f8; 10 | color: #333; 11 | } 12 | 13 | pre code { 14 | overflow: auto; 15 | word-wrap: normal; 16 | white-space: pre; 17 | } 18 | 19 | pre .img { 20 | margin: 5px 0; 21 | } 22 | 23 | pre .img img { 24 | background-color: #fff; 25 | display: block; 26 | height: auto; 27 | } 28 | 29 | code a, pre a { 30 | font-family: ui-monospace, SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace; 31 | color: #375f84; 32 | text-decoration: underline; 33 | } 34 | 35 | a.sourceLine:hover { 36 | text-decoration: none; 37 | } 38 | 39 | pre code span.fl {color: #1514b5;} 40 | pre code span.fu {color: #8c60bf;} /* function */ 41 | pre code span.ch, pre code span.st {color: #036a07;} /* string */ 42 | pre code span.kw {color: #264D66;} /* keyword */ 43 | pre code span.co {color: #888888;} /* comment */ 44 | pre code span.va {color: #3032da;} /* values */ 45 | 46 | pre code span.message { color: black; font-weight: bolder;} 47 | pre code span.error { color: orange; font-weight: bolder;} 48 | pre code span.warning { color: #6A0366; font-weight: bolder;} -------------------------------------------------------------------------------- /docs/darkswitch.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | 3 | prefersDarkScheme = window.matchMedia("(prefers-color-scheme: dark)"); 4 | 5 | currentTheme = localStorage.getItem("theme"); 6 | if (currentTheme) { 7 | init_color_scheme_css("css", currentTheme); 8 | init_color_scheme_css("css-code", currentTheme); 9 | } else if (prefersDarkScheme) { 10 | if (typeof $mode === 'undefined') { 11 | $mode = 'light'; 12 | if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) $mode = 'dark'; 13 | init_color_scheme_css("css", $mode); 14 | init_color_scheme_css("css-code", $mode); 15 | } 16 | toggle_color_scheme_css("css", $mode); 17 | toggle_color_scheme_css("css-code", $mode); 18 | } 19 | 20 | // function to initialise the css 21 | function init_color_scheme_css($id, $mode) { 22 | if ($("#"+$id)) $("#"+$id).remove(); // remove existing id 23 | $("#"+$id+"-"+$mode).attr( { 24 | "data-href-light": $("#"+$id+"-light").attr("href"), // store the light CSS url 25 | "data-href-dark": $("#"+$id+"-dark").attr("href"), // store the dark CSS url 26 | "data-color-scheme": $mode, // store the mode, so that we don't re-initalise 27 | "media": "all", // drop the media filter 28 | "id": $id // rename the id (drop the `-{mode}` bit) 29 | } ); 30 | $other = ($mode == 'dark') ? 'light' : 'dark'; 31 | $("#"+$id+"-"+$other).remove(); 32 | } 33 | 34 | // function to toggle the CSS 35 | function toggle_color_scheme_css($id, $mode) { 36 | // grab the new mode css href 37 | $href = $("#"+$id).data("href-"+$mode); // use `.data()` here, leverage the cache 38 | // set the CSS to the mode preference. 39 | $("#"+$id).attr( { 40 | "href": $href, 41 | "data-color-scheme": $mode, 42 | }); 43 | } 44 | 45 | // toggle button click code 46 | $("#css-toggle-btn").bind("click", function() { 47 | // get current mode 48 | // don't use `.data("color-scheme")`, it doesn't refresh 49 | $mode = $("#css").attr("data-color-scheme"); 50 | // test if this is a first time click event, if so initialise the code 51 | if (typeof $mode === 'undefined') { 52 | // not defined yet - set pref. & ask the browser if alt. is active 53 | $mode = 'light'; 54 | if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) $mode = 'dark'; 55 | init_color_scheme_css("css", $mode); 56 | init_color_scheme_css("css-code", $mode); 57 | // `init_color_scheme_css()` any other CSS 58 | } 59 | // by here we have the current mode, so swap it 60 | $new_mode = ($mode == 'dark') ? 'light' : 'dark'; 61 | toggle_color_scheme_css("css", $new_mode); 62 | toggle_color_scheme_css("css-code", $new_mode); 63 | // `toggle_color_scheme_css()` any other CSS 64 | 65 | // Saving user's preference to the localStorage 66 | localStorage.setItem("theme", $new_mode); 67 | }); 68 | 69 | }); 70 | -------------------------------------------------------------------------------- /docs/deps/_Roboto Slab-0.4.0/BngbUXZYTXPIvIBgJJSb6s3BzlRRfKOFbvjojISWaw.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/_Roboto Slab-0.4.0/BngbUXZYTXPIvIBgJJSb6s3BzlRRfKOFbvjojISWaw.woff -------------------------------------------------------------------------------- /docs/deps/_Roboto Slab-0.4.0/font.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Roboto Slab'; 3 | font-style: normal; 4 | font-weight: 400; 5 | font-display: swap; 6 | src: url(BngbUXZYTXPIvIBgJJSb6s3BzlRRfKOFbvjojISWaw.woff) format('woff'); 7 | } 8 | -------------------------------------------------------------------------------- /docs/deps/_Roboto-0.4.0/KFOmCnqEu92Fr1Me5g.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/_Roboto-0.4.0/KFOmCnqEu92Fr1Me5g.woff -------------------------------------------------------------------------------- /docs/deps/_Roboto-0.4.0/font.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Roboto'; 3 | font-style: normal; 4 | font-weight: 400; 5 | font-display: swap; 6 | src: url(KFOmCnqEu92Fr1Me5g.woff) format('woff'); 7 | } 8 | -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/font.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Lato'; 3 | font-style: italic; 4 | font-weight: 400; 5 | font-display: swap; 6 | src: url(fonts/S6u8w4BMUTPHjxswWA.woff) format('woff'); 7 | } 8 | @font-face { 9 | font-family: 'Lato'; 10 | font-style: normal; 11 | font-weight: 400; 12 | font-display: swap; 13 | src: url(fonts/S6uyw4BMUTPHvxo.woff) format('woff'); 14 | } 15 | @font-face { 16 | font-family: 'Lato'; 17 | font-style: normal; 18 | font-weight: 700; 19 | font-display: swap; 20 | src: url(fonts/S6u9w4BMUTPHh6UVeww.woff) format('woff'); 21 | } 22 | -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVs9pbCIPrc.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVs9pbCIPrc.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCIPrc.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCIPrc.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/4iCs6KVjbNBYlgo6ew.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/4iCs6KVjbNBYlgo6ew.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/4iCs6KVjbNBYlgoKfw7w.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/4iCs6KVjbNBYlgoKfw7w.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/4iCv6KVjbNBYlgoCxCvTtA.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/4iCv6KVjbNBYlgoCxCvTtA.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/4iCv6KVjbNBYlgoCxCvjsGyL.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/4iCv6KVjbNBYlgoCxCvjsGyL.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7nsDQ.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7nsDQ.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPa7j.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPa7j.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3aPA.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3aPA.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7j.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7j.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rAkw.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rAkw.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vAkw.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vAkw.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlxdo.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlxdo.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zAkw.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zAkw.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwlxdo.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwlxdo.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/CSR54z1Qlv-GDxkbKVQ_dFsvWNRevw.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/CSR54z1Qlv-GDxkbKVQ_dFsvWNRevw.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/CSR54z1Qlv-GDxkbKVQ_dFsvaNA.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/CSR54z1Qlv-GDxkbKVQ_dFsvaNA.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/CSR64z1Qlv-GDxkbKVQ_TOQ.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/CSR64z1Qlv-GDxkbKVQ_TOQ.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/CSR64z1Qlv-GDxkbKVQ_fOAKSw.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/CSR64z1Qlv-GDxkbKVQ_fOAKSw.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/JTURjIg1_i6t8kCHKm45_ZpC7g0.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/JTURjIg1_i6t8kCHKm45_ZpC7g0.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/JTURjIg1_i6t8kCHKm45_dJE7g0.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/JTURjIg1_i6t8kCHKm45_dJE7g0.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/JTUSjIg1_i6t8kCHKm45xW0.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/JTUSjIg1_i6t8kCHKm45xW0.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/KFOlCnqEu92Fr1MmEU9fBBc-.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/KFOlCnqEu92Fr1MmEU9fBBc-.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/KFOlCnqEu92Fr1MmEU9vAA.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/KFOlCnqEu92Fr1MmEU9vAA.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/KFOlCnqEu92Fr1MmSU5fBBc-.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/KFOlCnqEu92Fr1MmSU5fBBc-.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/KFOlCnqEu92Fr1MmSU5vAA.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/KFOlCnqEu92Fr1MmSU5vAA.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/KFOlCnqEu92Fr1MmWUlfBBc-.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/KFOlCnqEu92Fr1MmWUlfBBc-.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/KFOlCnqEu92Fr1MmWUlvAA.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/KFOlCnqEu92Fr1MmWUlvAA.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/KFOmCnqEu92Fr1Me5g.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/KFOmCnqEu92Fr1Me5g.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/KFOmCnqEu92Fr1Mu4mxM.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/KFOmCnqEu92Fr1Mu4mxM.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/QGYpz_kZZAGCONcK2A4bGOj8mNhL.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/QGYpz_kZZAGCONcK2A4bGOj8mNhL.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/S6u8w4BMUTPHjxsAXC-s.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/S6u8w4BMUTPHjxsAXC-s.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/S6u8w4BMUTPHjxswWA.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/S6u8w4BMUTPHjxswWA.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/S6u9w4BMUTPHh6UVSwiPHw.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/S6u9w4BMUTPHh6UVSwiPHw.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/S6u9w4BMUTPHh6UVeww.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/S6u9w4BMUTPHh6UVeww.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/S6u9w4BMUTPHh7USSwiPHw.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/S6u9w4BMUTPHh7USSwiPHw.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/S6u9w4BMUTPHh7USeww.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/S6u9w4BMUTPHh7USeww.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/S6uyw4BMUTPHjx4wWA.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/S6uyw4BMUTPHjx4wWA.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/S6uyw4BMUTPHvxo.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/S6uyw4BMUTPHvxo.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuFuYMZs.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuFuYMZs.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuI6fMZs.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuI6fMZs.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfMZs.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfMZs.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/XRXV3I6Li01BKof4MQ.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/XRXV3I6Li01BKof4MQ.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/XRXW3I6Li01BKofA6sKkZQ.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/XRXW3I6Li01BKofA6sKkZQ.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/XRXW3I6Li01BKofAjsOkZQ.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/XRXW3I6Li01BKofAjsOkZQ.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk5hkWVAexg.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk5hkWVAexg.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk5hkaVQ.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk5hkaVQ.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk8ZkWVAexg.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk8ZkWVAexg.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk8ZkaVQ.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk8ZkaVQ.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkyFjWVAexg.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkyFjWVAexg.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkyFjaVQ.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkyFjaVQ.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsg-1x4gaVQ.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsg-1x4gaVQ.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsg-1y4k.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsg-1y4k.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsiH0B4gaVQ.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsiH0B4gaVQ.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsiH0C4k.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsiH0C4k.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0B4gaVQ.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0B4gaVQ.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0C4k.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0C4k.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/pe03MImSLYBIv1o4X1M8cc9iB_5p.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/pe03MImSLYBIv1o4X1M8cc9iB_5p.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/pe0qMImSLYBIv1o4X1M8cfe5.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/pe0qMImSLYBIv1o4X1M8cfe5.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.1.0/fonts/q5uGsou0JOdh94bfvQlr.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/deps/bootstrap-5.1.0/fonts/q5uGsou0JOdh94bfvQlr.woff -------------------------------------------------------------------------------- /docs/deps/data-deps.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /docs/docsearch.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | 3 | // register a handler to move the focus to the search bar 4 | // upon pressing shift + "/" (i.e. "?") 5 | $(document).on('keydown', function(e) { 6 | if (e.shiftKey && e.keyCode == 191) { 7 | e.preventDefault(); 8 | $("#search-input").focus(); 9 | } 10 | }); 11 | 12 | $(document).ready(function() { 13 | // do keyword highlighting 14 | /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ 15 | var mark = function() { 16 | 17 | var referrer = document.URL ; 18 | var paramKey = "q" ; 19 | 20 | if (referrer.indexOf("?") !== -1) { 21 | var qs = referrer.substr(referrer.indexOf('?') + 1); 22 | var qs_noanchor = qs.split('#')[0]; 23 | var qsa = qs_noanchor.split('&'); 24 | var keyword = ""; 25 | 26 | for (var i = 0; i < qsa.length; i++) { 27 | var currentParam = qsa[i].split('='); 28 | 29 | if (currentParam.length !== 2) { 30 | continue; 31 | } 32 | 33 | if (currentParam[0] == paramKey) { 34 | keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); 35 | } 36 | } 37 | 38 | if (keyword !== "") { 39 | $(".contents").unmark({ 40 | done: function() { 41 | $(".contents").mark(keyword); 42 | } 43 | }); 44 | } 45 | } 46 | }; 47 | 48 | mark(); 49 | }); 50 | }); 51 | 52 | /* Search term highlighting ------------------------------*/ 53 | 54 | function matchedWords(hit) { 55 | var words = []; 56 | 57 | var hierarchy = hit._highlightResult.hierarchy; 58 | // loop to fetch from lvl0, lvl1, etc. 59 | for (var idx in hierarchy) { 60 | words = words.concat(hierarchy[idx].matchedWords); 61 | } 62 | 63 | var content = hit._highlightResult.content; 64 | if (content) { 65 | words = words.concat(content.matchedWords); 66 | } 67 | 68 | // return unique words 69 | var words_uniq = [...new Set(words)]; 70 | return words_uniq; 71 | } 72 | 73 | function updateHitURL(hit) { 74 | 75 | var words = matchedWords(hit); 76 | var url = ""; 77 | 78 | if (hit.anchor) { 79 | url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; 80 | } else { 81 | url = hit.url + '?q=' + escape(words.join(" ")); 82 | } 83 | 84 | return url; 85 | } 86 | -------------------------------------------------------------------------------- /docs/docsearch.json: -------------------------------------------------------------------------------- 1 | { 2 | "index_name": "single-cell-pathway-analysis", 3 | "start_urls": [ 4 | { 5 | "url": "jackbibby1.github.io/SCPA/index.html", 6 | "selectors_key": "homepage", 7 | "tags": [ 8 | "homepage" 9 | ] 10 | }, 11 | { 12 | "url": "jackbibby1.github.io/SCPA/reference", 13 | "selectors_key": "reference", 14 | "tags": [ 15 | "reference" 16 | ] 17 | }, 18 | { 19 | "url": "jackbibby1.github.io/SCPA/articles", 20 | "selectors_key": "articles", 21 | "tags": [ 22 | "articles" 23 | ] 24 | } 25 | ], 26 | "stop_urls": [ 27 | "/reference/$", 28 | "/reference/index.html", 29 | "/articles/$", 30 | "/articles/index.html" 31 | ], 32 | "sitemap_urls": [ 33 | "jackbibby1.github.io/SCPA/sitemap.xml" 34 | ], 35 | "selectors": { 36 | "homepage": { 37 | "lvl0": { 38 | "selector": ".contents h1", 39 | "default_value": "SCPA Home page" 40 | }, 41 | "lvl1": { 42 | "selector": ".contents h2" 43 | }, 44 | "lvl2": { 45 | "selector": ".contents h3", 46 | "default_value": "Context" 47 | }, 48 | "lvl3": ".ref-arguments td, .ref-description", 49 | "text": ".contents p, .contents li, .contents .pre" 50 | }, 51 | "reference": { 52 | "lvl0": { 53 | "selector": ".contents h1" 54 | }, 55 | "lvl1": { 56 | "selector": ".contents .name", 57 | "default_value": "Argument" 58 | }, 59 | "lvl2": { 60 | "selector": ".ref-arguments th", 61 | "default_value": "Description" 62 | }, 63 | "lvl3": ".ref-arguments td, .ref-description", 64 | "text": ".contents p, .contents li" 65 | }, 66 | "articles": { 67 | "lvl0": { 68 | "selector": ".contents h1" 69 | }, 70 | "lvl1": { 71 | "selector": ".contents .name" 72 | }, 73 | "lvl2": { 74 | "selector": ".contents h2, .contents h3", 75 | "default_value": "Context" 76 | }, 77 | "text": ".contents p, .contents li" 78 | } 79 | }, 80 | "selectors_exclude": [ 81 | ".dont-index" 82 | ], 83 | "min_indexed_level": 2, 84 | "custom_settings": { 85 | "separatorsToIndex": "_", 86 | "attributesToRetrieve": [ 87 | "hierarchy", 88 | "content", 89 | "anchor", 90 | "url", 91 | "url_without_anchor" 92 | ] 93 | } 94 | } 95 | 96 | -------------------------------------------------------------------------------- /docs/extra.css: -------------------------------------------------------------------------------- 1 | pre, pre code { 2 | white-space: pre; 3 | padding-right: 1rem; 4 | } 5 | -------------------------------------------------------------------------------- /docs/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/favicon-16x16.png -------------------------------------------------------------------------------- /docs/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/favicon-32x32.png -------------------------------------------------------------------------------- /docs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/favicon.ico -------------------------------------------------------------------------------- /docs/link.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /docs/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/logo.png -------------------------------------------------------------------------------- /docs/man/figures/aa_metab_rank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/man/figures/aa_metab_rank.png -------------------------------------------------------------------------------- /docs/man/figures/covid_atlas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/man/figures/covid_atlas.png -------------------------------------------------------------------------------- /docs/man/figures/covid_heatmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/man/figures/covid_heatmap.png -------------------------------------------------------------------------------- /docs/man/figures/defa_expression.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/man/figures/defa_expression.png -------------------------------------------------------------------------------- /docs/man/figures/metabolic_heatmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/man/figures/metabolic_heatmap.png -------------------------------------------------------------------------------- /docs/man/figures/naive_cd4_milestone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/man/figures/naive_cd4_milestone.png -------------------------------------------------------------------------------- /docs/man/figures/naive_cd4_pseudo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/man/figures/naive_cd4_pseudo.png -------------------------------------------------------------------------------- /docs/man/figures/naive_cd4_umap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/man/figures/naive_cd4_umap.png -------------------------------------------------------------------------------- /docs/man/figures/naive_cd8_umap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/man/figures/naive_cd8_umap.png -------------------------------------------------------------------------------- /docs/man/figures/pathway_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/man/figures/pathway_screenshot.png -------------------------------------------------------------------------------- /docs/man/figures/tissue_heatmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/man/figures/tissue_heatmap.png -------------------------------------------------------------------------------- /docs/man/figures/tissue_umap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/man/figures/tissue_umap.png -------------------------------------------------------------------------------- /docs/man/figures/tissue_variance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/man/figures/tissue_variance.png -------------------------------------------------------------------------------- /docs/man/figures/v_plot_rest_act.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/man/figures/v_plot_rest_act.png -------------------------------------------------------------------------------- /docs/pkgdown.js: -------------------------------------------------------------------------------- 1 | /* http://gregfranko.com/blog/jquery-best-practices/ */ 2 | (function($) { 3 | $(function() { 4 | 5 | $('.navbar-fixed-top').headroom(); 6 | 7 | $('body').css('padding-top', $('.navbar').height() + 10); 8 | $(window).resize(function(){ 9 | $('body').css('padding-top', $('.navbar').height() + 10); 10 | }); 11 | 12 | $('[data-toggle="tooltip"]').tooltip(); 13 | 14 | var cur_path = paths(location.pathname); 15 | var links = $("#navbar ul li a"); 16 | var max_length = -1; 17 | var pos = -1; 18 | for (var i = 0; i < links.length; i++) { 19 | if (links[i].getAttribute("href") === "#") 20 | continue; 21 | // Ignore external links 22 | if (links[i].host !== location.host) 23 | continue; 24 | 25 | var nav_path = paths(links[i].pathname); 26 | 27 | var length = prefix_length(nav_path, cur_path); 28 | if (length > max_length) { 29 | max_length = length; 30 | pos = i; 31 | } 32 | } 33 | 34 | // Add class to parent
  • , and enclosing
  • if in dropdown 35 | if (pos >= 0) { 36 | var menu_anchor = $(links[pos]); 37 | menu_anchor.parent().addClass("active"); 38 | menu_anchor.closest("li.dropdown").addClass("active"); 39 | } 40 | }); 41 | 42 | function paths(pathname) { 43 | var pieces = pathname.split("/"); 44 | pieces.shift(); // always starts with / 45 | 46 | var end = pieces[pieces.length - 1]; 47 | if (end === "index.html" || end === "") 48 | pieces.pop(); 49 | return(pieces); 50 | } 51 | 52 | // Returns -1 if not found 53 | function prefix_length(needle, haystack) { 54 | if (needle.length > haystack.length) 55 | return(-1); 56 | 57 | // Special case for length-0 haystack, since for loop won't run 58 | if (haystack.length === 0) { 59 | return(needle.length === 0 ? 0 : -1); 60 | } 61 | 62 | for (var i = 0; i < haystack.length; i++) { 63 | if (needle[i] != haystack[i]) 64 | return(i); 65 | } 66 | 67 | return(haystack.length); 68 | } 69 | 70 | /* Clipboard --------------------------*/ 71 | 72 | function changeTooltipMessage(element, msg) { 73 | var tooltipOriginalTitle=element.getAttribute('data-original-title'); 74 | element.setAttribute('data-original-title', msg); 75 | $(element).tooltip('show'); 76 | element.setAttribute('data-original-title', tooltipOriginalTitle); 77 | } 78 | 79 | if(ClipboardJS.isSupported()) { 80 | $(document).ready(function() { 81 | var copyButton = ""; 82 | 83 | $("div.sourceCode").addClass("hasCopyButton"); 84 | 85 | // Insert copy buttons: 86 | $(copyButton).prependTo(".hasCopyButton"); 87 | 88 | // Initialize tooltips: 89 | $('.btn-copy-ex').tooltip({container: 'body'}); 90 | 91 | // Initialize clipboard: 92 | var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { 93 | text: function(trigger) { 94 | return trigger.parentNode.textContent.replace(/\n#>[^\n]*/g, ""); 95 | } 96 | }); 97 | 98 | clipboardBtnCopies.on('success', function(e) { 99 | changeTooltipMessage(e.trigger, 'Copied!'); 100 | e.clearSelection(); 101 | }); 102 | 103 | clipboardBtnCopies.on('error', function() { 104 | changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); 105 | }); 106 | }); 107 | } 108 | })(window.jQuery || window.$) 109 | -------------------------------------------------------------------------------- /docs/pkgdown.yml: -------------------------------------------------------------------------------- 1 | pandoc: 3.1.1 2 | pkgdown: 2.0.7 3 | pkgdown_sha: ~ 4 | articles: 5 | comparing_two_populations: comparing_two_populations.html 6 | disease_comparison: disease_comparison.html 7 | interpreting_scpa_output: interpreting_scpa_output.html 8 | parallel_implementation: parallel_implementation.html 9 | pseudotime: pseudotime.html 10 | quick_start: quick_start.html 11 | seurat_comparison: seurat_comparison.html 12 | systematic_tissue_comparison: systematic_tissue_comparison.html 13 | using_gene_sets: using_gene_sets.html 14 | visualisation: visualisation.html 15 | last_built: 2024-02-21T19:28Z 16 | urls: 17 | reference: jackbibby1.github.io/SCPA/reference 18 | article: jackbibby1.github.io/SCPA/articles 19 | 20 | -------------------------------------------------------------------------------- /docs/preferably.css: -------------------------------------------------------------------------------- 1 | body, p, a { 2 | font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji; 3 | font-weight: 500; 4 | } 5 | 6 | h1 { 7 | font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji; 8 | font-weight: 700 !important; 9 | } 10 | 11 | h2, h3, h4, h5, h6 { 12 | font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji; 13 | font-weight: bold; 14 | } 15 | 16 | pre, code, pre.usage, code.sourceCode.r, .sourceCode, .examples, .downlit, .sourceCode, .r { 17 | font-family: ui-monospace, SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace; 18 | font-weight: 500; 19 | } 20 | 21 | .preferably { 22 | margin-top: -8px; 23 | } 24 | -------------------------------------------------------------------------------- /docs/reference/Rplot001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/Rplot001.png -------------------------------------------------------------------------------- /docs/reference/figures/README-pressure-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/figures/README-pressure-1.png -------------------------------------------------------------------------------- /docs/reference/figures/aa_metab_rank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/figures/aa_metab_rank.png -------------------------------------------------------------------------------- /docs/reference/figures/cd4_cell_types.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/figures/cd4_cell_types.png -------------------------------------------------------------------------------- /docs/reference/figures/covid_atlas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/figures/covid_atlas.png -------------------------------------------------------------------------------- /docs/reference/figures/covid_heatmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/figures/covid_heatmap.png -------------------------------------------------------------------------------- /docs/reference/figures/defa_expression.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/figures/defa_expression.png -------------------------------------------------------------------------------- /docs/reference/figures/fine_tissue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/figures/fine_tissue.png -------------------------------------------------------------------------------- /docs/reference/figures/heatmap_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/figures/heatmap_1.png -------------------------------------------------------------------------------- /docs/reference/figures/heatmap_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/figures/heatmap_2.png -------------------------------------------------------------------------------- /docs/reference/figures/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/figures/logo.png -------------------------------------------------------------------------------- /docs/reference/figures/metabolic_heatmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/figures/metabolic_heatmap.png -------------------------------------------------------------------------------- /docs/reference/figures/mtorc1_rank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/figures/mtorc1_rank.png -------------------------------------------------------------------------------- /docs/reference/figures/multisample_time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/figures/multisample_time.png -------------------------------------------------------------------------------- /docs/reference/figures/naive_cd4_milestone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/figures/naive_cd4_milestone.png -------------------------------------------------------------------------------- /docs/reference/figures/naive_cd4_pseudo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/figures/naive_cd4_pseudo.png -------------------------------------------------------------------------------- /docs/reference/figures/naive_cd4_umap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/figures/naive_cd4_umap.png -------------------------------------------------------------------------------- /docs/reference/figures/naive_cd8_umap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/figures/naive_cd8_umap.png -------------------------------------------------------------------------------- /docs/reference/figures/pathway_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/figures/pathway_screenshot.png -------------------------------------------------------------------------------- /docs/reference/figures/pseudotime_rank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/figures/pseudotime_rank.png -------------------------------------------------------------------------------- /docs/reference/figures/rank_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/figures/rank_plot.png -------------------------------------------------------------------------------- /docs/reference/figures/scpa_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/figures/scpa_logo.png -------------------------------------------------------------------------------- /docs/reference/figures/scpa_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/figures/scpa_outline.png -------------------------------------------------------------------------------- /docs/reference/figures/tissue_heatmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/figures/tissue_heatmap.png -------------------------------------------------------------------------------- /docs/reference/figures/tissue_umap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/figures/tissue_umap.png -------------------------------------------------------------------------------- /docs/reference/figures/tissue_variance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/figures/tissue_variance.png -------------------------------------------------------------------------------- /docs/reference/figures/two_sample_time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/figures/two_sample_time.png -------------------------------------------------------------------------------- /docs/reference/figures/two_sample_time_paths.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/figures/two_sample_time_paths.png -------------------------------------------------------------------------------- /docs/reference/figures/v_plot_rest_act.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/docs/reference/figures/v_plot_rest_act.png -------------------------------------------------------------------------------- /docs/sitemap.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jackbibby1.github.io/SCPA/404.html 5 | 6 | 7 | jackbibby1.github.io/SCPA/LICENSE.html 8 | 9 | 10 | jackbibby1.github.io/SCPA/articles/SCPA.html 11 | 12 | 13 | jackbibby1.github.io/SCPA/articles/comparing_two_populations.html 14 | 15 | 16 | jackbibby1.github.io/SCPA/articles/disease_comparison.html 17 | 18 | 19 | jackbibby1.github.io/SCPA/articles/index.html 20 | 21 | 22 | jackbibby1.github.io/SCPA/articles/interpreting_scpa_output.html 23 | 24 | 25 | jackbibby1.github.io/SCPA/articles/parallel_implementation.html 26 | 27 | 28 | jackbibby1.github.io/SCPA/articles/pseudotime.html 29 | 30 | 31 | jackbibby1.github.io/SCPA/articles/quick_start.html 32 | 33 | 34 | jackbibby1.github.io/SCPA/articles/seurat_comparison.html 35 | 36 | 37 | jackbibby1.github.io/SCPA/articles/systematic_tissue_comparison.html 38 | 39 | 40 | jackbibby1.github.io/SCPA/articles/using_gene_sets.html 41 | 42 | 43 | jackbibby1.github.io/SCPA/articles/visualisation.html 44 | 45 | 46 | jackbibby1.github.io/SCPA/authors.html 47 | 48 | 49 | jackbibby1.github.io/SCPA/index.html 50 | 51 | 52 | jackbibby1.github.io/SCPA/news/index.html 53 | 54 | 55 | jackbibby1.github.io/SCPA/reference/compare_pathways.html 56 | 57 | 58 | jackbibby1.github.io/SCPA/reference/compare_pathways_parallel.html 59 | 60 | 61 | jackbibby1.github.io/SCPA/reference/compare_sce.html 62 | 63 | 64 | jackbibby1.github.io/SCPA/reference/compare_seurat.html 65 | 66 | 67 | jackbibby1.github.io/SCPA/reference/format_pathways.html 68 | 69 | 70 | jackbibby1.github.io/SCPA/reference/get_paths.html 71 | 72 | 73 | jackbibby1.github.io/SCPA/reference/index.html 74 | 75 | 76 | jackbibby1.github.io/SCPA/reference/parallel_comparison.html 77 | 78 | 79 | jackbibby1.github.io/SCPA/reference/pathway_matrices.html 80 | 81 | 82 | jackbibby1.github.io/SCPA/reference/pipe.html 83 | 84 | 85 | jackbibby1.github.io/SCPA/reference/plot_heatmap.html 86 | 87 | 88 | jackbibby1.github.io/SCPA/reference/plot_rank.html 89 | 90 | 91 | jackbibby1.github.io/SCPA/reference/random_cells.html 92 | 93 | 94 | jackbibby1.github.io/SCPA/reference/sce_extract.html 95 | 96 | 97 | jackbibby1.github.io/SCPA/reference/seurat_extract.html 98 | 99 | 100 | jackbibby1.github.io/SCPA/reference/single_comparison.html 101 | 102 | 103 | -------------------------------------------------------------------------------- /inst/CITATION: -------------------------------------------------------------------------------- 1 | citHeader("To cite SCPA in publications use:") 2 | 3 | bibentry( 4 | bibtype = "Article", 5 | title = "Systematic single-cell pathway analysis to characterize early T cell activation", 6 | author = c(as.person("Jack A. Bibby"), as.person("Divyansh Agarwal"), as.person("Tilo Freiwald"), as.person("Natalia Kunz"), as.person("Nicolas S. Merle"), as.person("Erin E. West"), as.person("Parul Singh"), as.person("Andre Larochelle"), as.person("Fariba Chinian"), as.person("Somabha Mukherjee"), as.person("Behdad Afzali"), as.person("Claudia Kemper"), as.person("Nancy R. Zhang")), 7 | journal = "Cell Reports", 8 | year = 2022, 9 | volume = 41, 10 | issue = 8, 11 | url = "https://www.sciencedirect.com/science/article/pii/S2211124722015716?via%3Dihub", 12 | 13 | textVersion = paste( 14 | 15 | "Jack A. Bibby, Divyansh Agarwal, Tilo Freiwald, Natalia Kunz, Nicolas S. Merle, Erin E. West, 16 | Parul Singh, Andre Larochelle, Fariba Chinian, Somabha Mukherjee, Behdad Afzali, 17 | Claudia Kemper, Nancy R. Zhang (2022). Systematic single-cell pathway analysis to characterize early T cell activation. Cell Reports, volume 41, issue 8, doi: https://doi.org/10.1016/j.celrep.2022.111697" 18 | 19 | ) 20 | ) 21 | -------------------------------------------------------------------------------- /inst/WORDLIST: -------------------------------------------------------------------------------- 1 | COVID 2 | Color 3 | Colors 4 | ComplexHeatmap 5 | FC 6 | KEGG 7 | MSigDB 8 | MTORC 9 | Multisample 10 | Pseudocount 11 | Reactome 12 | SCE 13 | Seurat 14 | Sims 15 | SingleCellExperiment 16 | Tcm 17 | Treg 18 | Tregs 19 | Wilk 20 | colData 21 | colors 22 | com 23 | csv 24 | defensin 25 | filepath 26 | ggplot 27 | github 28 | gmt 29 | grepl 30 | gs 31 | hr 32 | io 33 | jackbibby 34 | logcounts 35 | magrittr 36 | msigdbr 37 | multicross 38 | multisample 39 | pseudotime 40 | pseuodotime 41 | pval 42 | qval 43 | qvals 44 | rds 45 | scRNA 46 | scpa 47 | seq 48 | seurat 49 | walkthroughs 50 | -------------------------------------------------------------------------------- /inst/rds_files/th1_tcm.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/inst/rds_files/th1_tcm.rds -------------------------------------------------------------------------------- /man/compare_pathways.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ComparePathways.R 3 | \name{compare_pathways} 4 | \alias{compare_pathways} 5 | \title{Use SCPA to compare gene sets} 6 | \usage{ 7 | compare_pathways( 8 | samples, 9 | pathways, 10 | downsample = 500, 11 | min_genes = 15, 12 | max_genes = 500, 13 | parallel = FALSE, 14 | cores = NULL 15 | ) 16 | } 17 | \arguments{ 18 | \item{samples}{List of samples, each supplied as an expression matrix with cells in columns 19 | and genes in rows.} 20 | 21 | \item{pathways}{Pathways and their genes with each pathway in a separate list. For formatting of 22 | gene lists, see documentation at https://jackbibby1.github.io/SCPA/articles/using_gene_sets.html} 23 | 24 | \item{downsample}{Option to downsample cell numbers. Defaults to 500 cells per condition. If a population 25 | has < 500 cells, all cells from that condition are used.} 26 | 27 | \item{min_genes}{Gene sets with fewer than this number of genes will be excluded} 28 | 29 | \item{max_genes}{Gene sets with more than this number of genes will be excluded} 30 | 31 | \item{parallel}{Should parallel processing be used?} 32 | 33 | \item{cores}{The number of cores used for parallel processing} 34 | } 35 | \value{ 36 | Statistical results from the SCPA analysis. The qval should be the 37 | primary metric that is used to interpret pathway differences i.e. a higher 38 | qval translates to larger pathway differences between conditions. 39 | If only two samples are provided, a fold change (FC) enrichment score will also be 40 | calculated. The FC statistic is generated from a running sum of mean changes in gene 41 | expression from all genes of the pathway. It's calculated from average pathway 42 | expression in population1 - population2, so a negative FC means the pathway is 43 | higher in population2. 44 | } 45 | \description{ 46 | This function takes an input of samples and pathways 47 | to compare gene set perturbations over different conditions with SCPA. 48 | } 49 | \examples{ 50 | \dontrun{ 51 | scpa_result <- compare_pathways( 52 | list(sample1, sample2, sample3), 53 | pathways = pathways) 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /man/compare_sce.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CompareSce.R 3 | \name{compare_sce} 4 | \alias{compare_sce} 5 | \title{Use SCPA to compare pathways within a SingleCellExperiment object} 6 | \usage{ 7 | compare_sce( 8 | sce_object, 9 | assay_name = "logcounts", 10 | group1 = NULL, 11 | group1_population = NULL, 12 | group2 = NULL, 13 | group2_population = NULL, 14 | pathways, 15 | min_genes = 15, 16 | max_genes = 500, 17 | downsample = 500, 18 | parallel = FALSE, 19 | cores = NULL 20 | ) 21 | } 22 | \arguments{ 23 | \item{sce_object}{SingleCellExperiment object with populations defined in the column data} 24 | 25 | \item{assay_name}{Assay name to extract expression values from. Defaults to logcounts} 26 | 27 | \item{group1}{First comparison group as defined by \code{colData()} columns 28 | of SingleCellExperiment object e.g. cell_type} 29 | 30 | \item{group1_population}{Populations within group1 to compare 31 | e.g. c("t_cell", "b_cell")} 32 | 33 | \item{group2}{Second comparison group as defined by \code{colData()} columns 34 | of SingleCellExperiment object e.g. hour} 35 | 36 | \item{group2_population}{Population within group2 to compare 37 | e.g. 24} 38 | 39 | \item{pathways}{Pathway gene sets with each pathway in a separate list. For formatting of 40 | gene lists, see documentation at https://jackbibby1.github.io/SCPA/articles/using_gene_sets.html} 41 | 42 | \item{min_genes}{Gene sets with fewer than this number of genes will be excluded} 43 | 44 | \item{max_genes}{Gene sets with more than this number of genes will be excluded} 45 | 46 | \item{downsample}{Option to downsample cell numbers. Defaults to 500 cells per condition. If a population 47 | has < 500 cells, all cells from that condition are used.} 48 | 49 | \item{parallel}{Should parallel processing be used?} 50 | 51 | \item{cores}{The number of cores used for parallel processing} 52 | } 53 | \value{ 54 | Statistical results from the SCPA analysis. The qval should be the 55 | primary metric that is used to interpret pathway differences i.e. a higher 56 | qval translates to larger pathway differences between conditions. 57 | If only two samples are provided, a fold change (FC) enrichment score will also be 58 | calculated. The FC output is generated from a running sum of mean changes in gene 59 | expression from all genes of the pathway. It's calculated from average pathway 60 | expression in population1 - population2, so a negative FC means the pathway is 61 | higher in population2. 62 | } 63 | \description{ 64 | This function takes a SingleCellExperiment object as an input, and 65 | compares gene sets over specified conditions/populations. 66 | } 67 | \examples{ 68 | \dontrun{ 69 | scpa_out <- compare_sce( 70 | group1 = "cell", 71 | group1_population = c("t_cell", "b_cell"), 72 | group2 = "hour", 73 | group2_population = c("24"), 74 | pathways = pathways) 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /man/compare_seurat.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CompareSeurat.R 3 | \name{compare_seurat} 4 | \alias{compare_seurat} 5 | \title{Use SCPA to compare pathways within a Seurat object} 6 | \usage{ 7 | compare_seurat( 8 | seurat_object, 9 | assay = "RNA", 10 | group1 = NULL, 11 | group1_population = NULL, 12 | group2 = NULL, 13 | group2_population = NULL, 14 | pathways, 15 | downsample = 500, 16 | min_genes = 15, 17 | max_genes = 500, 18 | parallel = FALSE, 19 | cores = NULL 20 | ) 21 | } 22 | \arguments{ 23 | \item{seurat_object}{Seurat object with populations defined in the meta data} 24 | 25 | \item{assay}{Assay to pull expression data from} 26 | 27 | \item{group1}{First comparison group as defined by meta data in 28 | Seurat object e.g. cell_type} 29 | 30 | \item{group1_population}{Populations within group1 to compare 31 | e.g. c("t_cell", "b_cell")} 32 | 33 | \item{group2}{Second comparison group as defined by column names in 34 | Seurat object e.g. hour} 35 | 36 | \item{group2_population}{Population within group2 to compare 37 | e.g. 24} 38 | 39 | \item{pathways}{Pathway gene sets with each pathway in a separate list. For formatting of 40 | gene lists, see documentation at https://jackbibby1.github.io/SCPA/articles/using_gene_sets.html} 41 | 42 | \item{downsample}{Option to downsample cell numbers. Defaults to 500 cells per condition. If a population 43 | has < 500 cells, all cells from that condition are used.} 44 | 45 | \item{min_genes}{Gene sets with fewer than this number of genes will be excluded} 46 | 47 | \item{max_genes}{Gene sets with more than this number of genes will be excluded} 48 | 49 | \item{parallel}{Should parallel processing be used?} 50 | 51 | \item{cores}{The number of cores used for parallel processing} 52 | } 53 | \value{ 54 | Statistical results from the SCPA analysis. The qval should be the 55 | primary metric that is used to interpret pathway differences i.e. a higher 56 | qval translates to larger pathway differences between conditions. 57 | If only two samples are provided, a fold change (FC) enrichment score will also be 58 | calculated. The FC output is generated from a running sum of mean changes in gene 59 | expression from all genes of the pathway. It's calculated from average pathway 60 | expression in population1 - population2, so a negative FC means the pathway is 61 | higher in population2. 62 | } 63 | \description{ 64 | This function takes a Seurat object as an input, and 65 | compares gene sets over specified conditions/populations. 66 | } 67 | \examples{ 68 | \dontrun{ 69 | scpa_out <- compare_sce( 70 | group1 = "cell", 71 | group1_population = c("t_cell", "b_cell"), 72 | group2 = "hour", 73 | group2_population = c("24"), 74 | pathways = pathways) 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /man/figures/aa_metab_rank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/man/figures/aa_metab_rank.png -------------------------------------------------------------------------------- /man/figures/cd4_cell_types.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/man/figures/cd4_cell_types.png -------------------------------------------------------------------------------- /man/figures/covid_atlas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/man/figures/covid_atlas.png -------------------------------------------------------------------------------- /man/figures/covid_heatmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/man/figures/covid_heatmap.png -------------------------------------------------------------------------------- /man/figures/defa_expression.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/man/figures/defa_expression.png -------------------------------------------------------------------------------- /man/figures/fine_tissue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/man/figures/fine_tissue.png -------------------------------------------------------------------------------- /man/figures/heatmap_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/man/figures/heatmap_1.png -------------------------------------------------------------------------------- /man/figures/heatmap_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/man/figures/heatmap_2.png -------------------------------------------------------------------------------- /man/figures/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/man/figures/logo.png -------------------------------------------------------------------------------- /man/figures/metabolic_heatmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/man/figures/metabolic_heatmap.png -------------------------------------------------------------------------------- /man/figures/mtorc1_rank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/man/figures/mtorc1_rank.png -------------------------------------------------------------------------------- /man/figures/multisample_time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/man/figures/multisample_time.png -------------------------------------------------------------------------------- /man/figures/naive_cd4_milestone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/man/figures/naive_cd4_milestone.png -------------------------------------------------------------------------------- /man/figures/naive_cd4_pseudo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/man/figures/naive_cd4_pseudo.png -------------------------------------------------------------------------------- /man/figures/naive_cd4_umap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/man/figures/naive_cd4_umap.png -------------------------------------------------------------------------------- /man/figures/naive_cd8_umap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/man/figures/naive_cd8_umap.png -------------------------------------------------------------------------------- /man/figures/pathway_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/man/figures/pathway_screenshot.png -------------------------------------------------------------------------------- /man/figures/pseudotime_rank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/man/figures/pseudotime_rank.png -------------------------------------------------------------------------------- /man/figures/rank_plot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/man/figures/rank_plot.png -------------------------------------------------------------------------------- /man/figures/scpa_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/man/figures/scpa_outline.png -------------------------------------------------------------------------------- /man/figures/tissue_heatmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/man/figures/tissue_heatmap.png -------------------------------------------------------------------------------- /man/figures/tissue_umap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/man/figures/tissue_umap.png -------------------------------------------------------------------------------- /man/figures/tissue_variance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/man/figures/tissue_variance.png -------------------------------------------------------------------------------- /man/figures/two_sample_time_paths.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/man/figures/two_sample_time_paths.png -------------------------------------------------------------------------------- /man/figures/v_plot_rest_act.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/man/figures/v_plot_rest_act.png -------------------------------------------------------------------------------- /man/format_pathways.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/FormatPathways.R 3 | \name{format_pathways} 4 | \alias{format_pathways} 5 | \title{Format the output of msigdbr to use with SCPA} 6 | \usage{ 7 | format_pathways(msigdbr_output) 8 | } 9 | \arguments{ 10 | \item{msigdbr_output}{output from msigdbr} 11 | } 12 | \value{ 13 | list of pathways with corresponding genes 14 | } 15 | \description{ 16 | This function takes the output of msigdbr 17 | and formats the pathways into something that 18 | can be used within SCPA 19 | } 20 | \examples{ 21 | \dontrun{ 22 | pathways <- format_pathways( 23 | pathways 24 | ) 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /man/get_paths.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/GetPaths.R 3 | \name{get_paths} 4 | \alias{get_paths} 5 | \title{Convert gene sets to filtered pathway list} 6 | \usage{ 7 | get_paths(pathway_filepath) 8 | } 9 | \arguments{ 10 | \item{pathway_filepath}{filepath to csv or gmt file} 11 | } 12 | \value{ 13 | list of pathways with corresponding genes 14 | } 15 | \description{ 16 | This function takes one of three inputs: 17 | \enumerate{ 18 | \item csv file where pathway title is in the first column 19 | and subsequent columns contain genes of that pathway 20 | \item A gmt file 21 | \item A tidy formatted list where pathway name is contained in the first column 22 | and the genes of that pathway are in the second column 23 | } 24 | } 25 | \examples{ 26 | \dontrun{ 27 | pathways <- get_paths( 28 | "Documents/gene_list.csv" 29 | ) 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /man/parallel_comparison.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ComparePathways.R 3 | \name{parallel_comparison} 4 | \alias{parallel_comparison} 5 | \title{Internal function for compare_pathways()} 6 | \usage{ 7 | parallel_comparison( 8 | samples, 9 | pathways, 10 | downsample = 500, 11 | min_genes = 15, 12 | max_genes = 500, 13 | cores = 2 14 | ) 15 | } 16 | \arguments{ 17 | \item{samples}{List of samples, each supplied as an expression matrix with cells in columns 18 | and genes in rows.} 19 | 20 | \item{pathways}{Pathways and their genes with each pathway in a separate list. For formatting of 21 | gene lists, see documentation at https://jackbibby1.github.io/SCPA/articles/using_gene_sets.html} 22 | 23 | \item{downsample}{Option to downsample cell numbers. Defaults to 500 cells per condition. If a population 24 | has < 500 cells, all cells from that condition are used.} 25 | 26 | \item{min_genes}{Gene sets with fewer than this number of genes will be excluded} 27 | 28 | \item{max_genes}{Gene sets with more than this number of genes will be excluded} 29 | 30 | \item{cores}{Number of cores to use for parallel processing} 31 | } 32 | \value{ 33 | Statistical results from the SCPA analysis. The qval should be the 34 | primary metric that is used to interpret pathway differences i.e. a higher 35 | qval translates to larger pathway differences between conditions. 36 | If only two samples are provided, a fold change (FC) enrichment score will also be 37 | calculated. The FC statistic is generated from a running sum of mean changes in gene 38 | expression from all genes of the pathway. It's calculated from average pathway 39 | expression in population1 - population2, so a negative FC means the pathway is 40 | higher in population2. 41 | } 42 | \description{ 43 | This function takes an input of samples and pathways 44 | to compare gene set perturbations over different conditions with SCPA. 45 | } 46 | \examples{ 47 | \dontrun{ 48 | scpa_result <- compare_pathways_parallel( 49 | list(sample1, sample2, sample3), 50 | pathways = pathways), 51 | cores = 2) 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /man/pathway_matrices.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/PathwayMatrices.R 3 | \name{pathway_matrices} 4 | \alias{pathway_matrices} 5 | \title{Create pathway matrices from gene sets} 6 | \usage{ 7 | pathway_matrices(samples, pathways, sample_names = NULL) 8 | } 9 | \arguments{ 10 | \item{samples}{Expression matrix for each population, with each population 11 | as a separate list. These matrices can be generated with e.g. \code{SCPA::seurat_extract()}} 12 | 13 | \item{pathways}{Either a gene set gmt file, csv file, or output from \code{SCPA::format_pathways()} 14 | that contains your gene sets of interest. Information on formatting gene sets can be found 15 | at https://jackbibby1.github.io/SCPA/articles/using_gene_sets.html.} 16 | 17 | \item{sample_names}{Names of the samples to be used in the output} 18 | } 19 | \description{ 20 | This function takes a matrix and pathway csv/gmt files 21 | and input and creates expression matrices for each 22 | pathway. The resulting output is a nested list of expression 23 | matrices for each pathway by each sample. 24 | } 25 | \examples{ 26 | \dontrun{ 27 | pathway_expression <- pathway_matrices( 28 | list(sample1, sample2), 29 | pathways = "your/path_to_gmt", 30 | sample_names = c("population1", "population2")) 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /man/pipe.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils-pipe.R 3 | \name{\%>\%} 4 | \alias{\%>\%} 5 | \title{Pipe operator} 6 | \usage{ 7 | lhs \%>\% rhs 8 | } 9 | \arguments{ 10 | \item{lhs}{A value or the magrittr placeholder.} 11 | 12 | \item{rhs}{A function call using the magrittr semantics.} 13 | } 14 | \value{ 15 | The result of calling \code{rhs(lhs)}. 16 | } 17 | \description{ 18 | See \code{magrittr::\link[magrittr:pipe]{\%>\%}} for details. 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/plot_heatmap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/PlotHeatmap.R 3 | \name{plot_heatmap} 4 | \alias{plot_heatmap} 5 | \title{Plot a heatmap of qvals from SCPA} 6 | \usage{ 7 | plot_heatmap( 8 | scpa_out, 9 | highlight_pathways = NULL, 10 | row_fontsize = 6, 11 | column_fontsize = 10, 12 | column_names = colnames(scpa_out), 13 | show_row_names = TRUE, 14 | cluster_columns = TRUE, 15 | hm_colors = NULL, 16 | scale_breaks = NULL 17 | ) 18 | } 19 | \arguments{ 20 | \item{scpa_out}{Data frame that contains a "Pathway" column, and a column or multiple columns 21 | containing qvals. This can be the direct output from \code{compare_pathways()}, 22 | or a custom data frame.} 23 | 24 | \item{highlight_pathways}{Pathway or pathways to annotate on the heatmap, 25 | supplied as character vector. If no argument is given, all pathways are 26 | shown} 27 | 28 | \item{row_fontsize}{Font size of pathway names} 29 | 30 | \item{column_fontsize}{Font size of the sample names} 31 | 32 | \item{column_names}{Option to supply names of the heatmap 33 | columns if more than one populations is present} 34 | 35 | \item{show_row_names}{Should row names be shown in the heatmap?} 36 | 37 | \item{cluster_columns}{Should columns in the heatmap be clustered?} 38 | 39 | \item{hm_colors}{Colors to be used in the heatmap} 40 | 41 | \item{scale_breaks}{Breaks to be used in the colors of the heatmap. 42 | Length must be equal to the number of colors.} 43 | } 44 | \value{ 45 | list of pathways with corresponding genes 46 | } 47 | \description{ 48 | This function takes the output from SCPA and plots a 49 | heatmap of the qvals 50 | } 51 | \examples{ 52 | \dontrun{ 53 | plot_heatmap( 54 | scpa_out = scpa_result, 55 | pathway = "mtorc" 56 | ) 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /man/plot_rank.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/PlotRank.R 3 | \name{plot_rank} 4 | \alias{plot_rank} 5 | \title{Plot the rank of specific pathways from SCPA output} 6 | \usage{ 7 | plot_rank( 8 | scpa_out, 9 | pathway, 10 | population_name = "qval", 11 | base_point_size = 2, 12 | base_point_color = "gray70", 13 | highlight_point_size = 3, 14 | highlight_point_color = "cornflowerblue", 15 | label_pathway = T, 16 | label_size = 4 17 | ) 18 | } 19 | \arguments{ 20 | \item{scpa_out}{Data frame containing Pathways and qvals generated from 21 | compare_pathways} 22 | 23 | \item{pathway}{Chosen pathway or pathways to plot the rank of. This can 24 | be specific e.g. HALLMARK_GLYCOLYSIS to plot a specific result, or 25 | generic e.g. glycolysis to plot all glycolysis pathways} 26 | 27 | \item{population_name}{Column name of the population to plot, if more 28 | than one population present in the data frame} 29 | 30 | \item{base_point_size}{Size of the base points to plot on the graph} 31 | 32 | \item{base_point_color}{Color of the base points to plot on the graph} 33 | 34 | \item{highlight_point_size}{Size of the highlighted points to plot on the graph} 35 | 36 | \item{highlight_point_color}{Color of the highlighted points to plot on the graph} 37 | 38 | \item{label_pathway}{Should the selected pathway be labelled?} 39 | 40 | \item{label_size}{Text size of the pathway label} 41 | } 42 | \value{ 43 | list of pathways with corresponding genes 44 | } 45 | \description{ 46 | This function takes the output from SCPA and plots the 47 | rank of a user defined pathway. 48 | } 49 | \examples{ 50 | \dontrun{ 51 | plot_rank( 52 | scpa_out = scpa_result, 53 | pathway = "interferon", 54 | population_name = cd4_qval, 55 | ) 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /man/random_cells.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/RandomCells.R 3 | \name{random_cells} 4 | \alias{random_cells} 5 | \title{Randomly sample cells (columns)} 6 | \usage{ 7 | random_cells(df, n) 8 | } 9 | \arguments{ 10 | \item{df}{Data frame or matrix.} 11 | 12 | \item{n}{Number of cells to sample.} 13 | } 14 | \value{ 15 | Matrix or data frame of n randomly sampled rows 16 | } 17 | \description{ 18 | This function takes a matrix or data frame as 19 | input and randomly samples columns 20 | } 21 | \examples{ 22 | \dontrun{ 23 | df <- matrix(1:1000, 500, 20) 24 | sub_df <- random_cells( 25 | df = df, 26 | n = 20 27 | ) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /man/sce_extract.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/SceExtract.R 3 | \name{sce_extract} 4 | \alias{sce_extract} 5 | \title{Extract data from a SingleCellExperiment object} 6 | \usage{ 7 | sce_extract( 8 | sce_object, 9 | assay_name = "logcounts", 10 | meta1 = NULL, 11 | value_meta1 = NULL, 12 | meta2 = NULL, 13 | value_meta2 = NULL, 14 | pseudocount = 0.001 15 | ) 16 | } 17 | \arguments{ 18 | \item{sce_object}{SingleCellExperiment object containing expression data} 19 | 20 | \item{assay_name}{Name of assay to pull from. Defaults to "logcounts"} 21 | 22 | \item{meta1}{Metadata column to subset} 23 | 24 | \item{value_meta1}{Value to select within \code{meta1} column} 25 | 26 | \item{meta2}{Metadata column to subset} 27 | 28 | \item{value_meta2}{Value to select within \code{meta2} column} 29 | 30 | \item{pseudocount}{Pseudocount to add to data. Defaults to 0.001} 31 | } 32 | \value{ 33 | Matrix containing count values of selected populations 34 | } 35 | \description{ 36 | This function takes a SingleCellExperiment object as an input, and returns 37 | an expression matrix based on subsetting parameters. Either none, one, or 38 | two metadata features can be selected for a given input. 39 | } 40 | \examples{ 41 | \dontrun{ 42 | cd4 <- sce_extract( 43 | sce_object, 44 | meta1 = "Hour", 45 | value_meta1 = 12, 46 | meta2 = "Cell_Type", 47 | value_meta2 = "CD4" 48 | ) 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /man/seurat_extract.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/SeuratExtract.R 3 | \name{seurat_extract} 4 | \alias{seurat_extract} 5 | \title{Extract Data From A Seurat Object} 6 | \usage{ 7 | seurat_extract( 8 | seu_obj, 9 | assay = "RNA", 10 | meta1 = NULL, 11 | value_meta1 = NULL, 12 | meta2 = NULL, 13 | value_meta2 = NULL, 14 | pseudocount = 0.001 15 | ) 16 | } 17 | \arguments{ 18 | \item{seu_obj}{Seurat object} 19 | 20 | \item{assay}{Seurat assay to extract. Defaults to RNA} 21 | 22 | \item{meta1}{Metadata column to subset} 23 | 24 | \item{value_meta1}{Value to select within \code{meta1} column} 25 | 26 | \item{meta2}{Metadata column to subset} 27 | 28 | \item{value_meta2}{Value to select within \code{meta2} column} 29 | 30 | \item{pseudocount}{Pseudocount to add to data. Defaults to 0.001} 31 | } 32 | \value{ 33 | Matrix containing count values of selected populations 34 | } 35 | \description{ 36 | This function takes a Seurat object as an input, and returns 37 | an expression matrix based on subsetting parameters. Either none, one, or 38 | two metadata features can be selected for a given input. 39 | } 40 | \examples{ 41 | \dontrun{ 42 | cd4 <- seurat_extract( 43 | Seurat_Object, 44 | meta1 = "Hour", 45 | value_meta1 = 12, 46 | meta2 = "Cell_Type", 47 | value_meta2 = "CD4" 48 | ) 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /man/single_comparison.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ComparePathways.R 3 | \name{single_comparison} 4 | \alias{single_comparison} 5 | \title{Internal function for compare_pathways()} 6 | \usage{ 7 | single_comparison( 8 | samples, 9 | pathways, 10 | downsample = 500, 11 | min_genes = 15, 12 | max_genes = 500 13 | ) 14 | } 15 | \arguments{ 16 | \item{samples}{List of samples, each supplied as an expression matrix with cells in columns 17 | and genes in rows.} 18 | 19 | \item{pathways}{Pathways and their genes with each pathway in a separate list. For formatting of 20 | gene lists, see documentation at https://jackbibby1.github.io/SCPA/articles/using_gene_sets.html} 21 | 22 | \item{downsample}{Option to downsample cell numbers. Defaults to 500 cells per condition. If a population 23 | has < 500 cells, all cells from that condition are used.} 24 | 25 | \item{min_genes}{Gene sets with fewer than this number of genes will be excluded} 26 | 27 | \item{max_genes}{Gene sets with more than this number of genes will be excluded} 28 | } 29 | \value{ 30 | Statistical results from the SCPA analysis. The qval should be the 31 | primary metric that is used to interpret pathway differences i.e. a higher 32 | qval translates to larger pathway differences between conditions. 33 | If only two samples are provided, a fold change (FC) enrichment score will also be 34 | calculated. The FC statistic is generated from a running sum of mean changes in gene 35 | expression from all genes of the pathway. It's calculated from average pathway 36 | expression in population1 - population2, so a negative FC means the pathway is 37 | higher in population2. 38 | } 39 | \description{ 40 | This function takes an input of samples and pathways 41 | to compare gene set perturbations over different conditions with SCPA. 42 | } 43 | \examples{ 44 | \dontrun{ 45 | scpa_result <- compare_pathways( 46 | list(sample1, sample2, sample3), 47 | pathways = pathways) 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /pkgdown/extra.css: -------------------------------------------------------------------------------- 1 | pre, pre code { 2 | white-space: pre; 3 | padding-right: 1rem; 4 | } 5 | -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/pkgdown/favicon/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/pkgdown/favicon/apple-touch-icon-152x152.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/pkgdown/favicon/apple-touch-icon-180x180.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/pkgdown/favicon/apple-touch-icon-60x60.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/pkgdown/favicon/apple-touch-icon-76x76.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/pkgdown/favicon/apple-touch-icon.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/pkgdown/favicon/favicon-16x16.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/pkgdown/favicon/favicon-32x32.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jackbibby1/SCPA/68b6c9954a0eca82b4cfc990a963d5f5ca1f711b/pkgdown/favicon/favicon.ico -------------------------------------------------------------------------------- /tests/spelling.R: -------------------------------------------------------------------------------- 1 | if(requireNamespace('spelling', quietly = TRUE)) 2 | spelling::spell_check_test(vignettes = TRUE, error = FALSE, 3 | skip_on_cran = TRUE) 4 | -------------------------------------------------------------------------------- /vignettes/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | *.R 3 | -------------------------------------------------------------------------------- /vignettes/comparing_two_populations.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Comparing two populations" 3 | output: rmarkdown::html_vignette 4 | vignette: > 5 | %\VignetteIndexEntry{comparing_two_populations} 6 | %\VignetteEngine{knitr::rmarkdown} 7 | %\VignetteEncoding{UTF-8} 8 | --- 9 | 10 | ```{r, include = FALSE} 11 | knitr::opts_chunk$set( 12 | collapse = TRUE, 13 | comment = "#>" 14 | ) 15 | ``` 16 | 17 | Here we're going to do a basic comparison of pathways between two populations using our naive CD4^+^ T cell dataset that you can find [here](https://drive.google.com/file/d/1XstWBD4lOY0QNd-8Wzeh1f3-uYKuUU5Q/view?usp=sharing). 18 | 19 | Let's load in a few packages we'll need 20 | ```{r setup, eval=F} 21 | library(SCPA) 22 | library(Seurat) 23 | library(tidyverse) 24 | ``` 25 | 26 | 27 | ### Loading in data and visualizing 28 | And let's load in the data we're going to use. In this dataset, CD4^+^ T cells were left unstimulated, or stimulated for 12 or 24 hours with anti-CD3 and anti-CD28 29 | 30 | ```{r, eval=F} 31 | naive_cd4 <- readRDS("naive_cd4.rds") 32 | ``` 33 | 34 | In the `naive_cd4` object, we have all our naive CD4^+^ T cells with metadata specifying the identified cell types and the hour specifying time point of cell harvesting. 35 | 36 | ```{r draw_umap, eval=F} 37 | DimPlot(naive_cd4, split.by = "Hour") + 38 | theme(aspect.ratio = 1) 39 | ``` 40 | 41 | ![](../man/figures/naive_cd4_umap.png){width=100%} 42 | 43 | 44 | ### Extracting the expression matrices 45 | We then need the expression matrices for the populations we want to compare. For this, we can use the `seurat_extract` function from the SCPA package, which takes a Seurat object and subsets the data based on the metadata specified in the Seurat columns e.g. here we want to take 'Resting' cells at 0hr, and 'Activated' cells at 24hr. If you have a SingleCellExperiment object, you can use the `sce_extract` function. 46 | 47 | ```{r seurat_extract, eval=F} 48 | resting <- seurat_extract(naive_cd4, 49 | meta1 = "Cell_Type", value_meta1 = "Resting", 50 | meta2 = "Hour", value_meta2 = 0) 51 | 52 | activated <- seurat_extract(naive_cd4, 53 | meta1 = "Cell_Type", value_meta1 = "Activated", 54 | meta2 = "Hour", value_meta2 = 24) 55 | 56 | ``` 57 | 58 | 59 | ### Defining metabolic pathways 60 | After we have our data, we can define the pathways to compare. We curated a list of metabolic pathways from a few different sources (Hallmark, KEGG, and Reactome), which can be found [here](https://github.com/jackbibby1/SCPA/tree/main/gene_sets). The file is in standard gmt file format with the pathway name in column 1 and genes of that pathway in subsequent columns. Here we just converted a gmt file to csv, and manually curated a single file with all metabolic gene sets. SCPA just needs the filepath to these gene sets, so we can add this as an object to simplify our final chunk of code 61 | 62 | 63 | ```{r, eval=F} 64 | pathways <- "combined_metabolic_pathways.csv" 65 | ``` 66 | 67 | 68 | ### Running SCPA 69 | So now we have our samples and metabolic gene sets. To compare these pathways, we can just run the compare_pathways function. 70 | 71 | ```{r compare_pathways, eval=F} 72 | rest_act <- compare_pathways(samples = list(resting, activated), 73 | pathways = pathways) 74 | 75 | # For faster analysis with parallel processing, use 'parallel = TRUE' and 'cores = x' arguments 76 | ``` 77 | 78 | ### Visualizing results 79 | Now we have the results stored in the rest_act object, which we can then visualize. 80 | 81 | ```{r plot_volcano, eval=F} 82 | rest_act <- rest_act %>% 83 | mutate(color = case_when(FC > 5 & adjPval < 0.01 ~ '#6dbf88', 84 | FC < 5 & FC > -5 & adjPval < 0.01 ~ '#84b0f0', 85 | FC < -5 & adjPval < 0.01 ~ 'mediumseagreen', 86 | FC < 5 & FC > -5 & adjPval > 0.01 ~ 'black')) 87 | 88 | aa_path <- rest_act %>% 89 | filter(grepl(pattern = "reactome_arachi", ignore.case = T, x = Pathway)) 90 | 91 | ggplot(rest_act, aes(-FC, qval)) + 92 | geom_vline(xintercept = c(-5, 5), linetype = "dashed", col = 'black', lwd = 0.3) + 93 | geom_point(cex = 2.6, shape = 21, fill = rest_act$color, stroke = 0.3) + 94 | geom_point(data = aa_path, shape = 21, cex = 2.8, fill = "orangered2", color = "black", stroke = 0.3) + 95 | xlim(-20, 80) + 96 | ylim(0, 11) + 97 | xlab("Enrichment") + 98 | ylab("Qval") + 99 | theme(panel.background = element_blank(), 100 | panel.border = element_rect(fill = NA), 101 | aspect.ratio = 1) 102 | ``` 103 | 104 | ![](../man/figures/v_plot_rest_act.png){width=45%} 105 | 106 | ### Some conclusions about SCPA 107 | An important aspect of SCPA is highlighted here, in that pathways showing large changes in multivariate distribution (i.e. pathway 'activity') do not always show mean changes. So looking at the plot, we see a large number of pathways that have high qvals, but no enrichment in any given population. In the plot above we highlight arachidonic acid as one particular pathway that shows this pattern, and in our wet lab work, we have shown that these pathways are also very relevant when understanding pathway importance (see figure 4 in our paper [here](https://www.cell.com/cell-reports/fulltext/S2211-1247(22)01571-6) . So here we suggest that the qval should be used as the primary statistic when judging biological relevance, and the pathway fold change/enrichment should only be a secondary informative value. For more on interpreting the output of SCPA, see [this tutorial](https://jackbibby1.github.io/SCPA/articles/interpreting_scpa_output.html) 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /vignettes/disease_comparison.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Systems level pathway analysis in disease" 3 | output: rmarkdown::html_vignette 4 | vignette: > 5 | %\VignetteIndexEntry{disease_comparison} 6 | %\VignetteEngine{knitr::rmarkdown} 7 | %\VignetteEncoding{UTF-8} 8 | --- 9 | 10 | ```{r, include = FALSE} 11 | knitr::opts_chunk$set( 12 | collapse = TRUE, 13 | comment = "#>" 14 | ) 15 | ``` 16 | 17 | Here we're going to perform a systems level characterisation of pathway perturbations in a disease. Applying a systems level analysis of a disease using scRNA-seq data allows you to get a really good understanding of a few important aspects: 18 | 19 | - Which pathways show the greatest perturbation in the disease 20 | - Which cell types show the largest perturbation in their transcriptional profile 21 | - Shared and unique pathway perturbations across cell types 22 | 23 | Because SCPA can be easily applied in a systems level way, it allows for the identification of the most relevant pathways and cell types in any given disease. 24 | 25 | ## Loading in data/packages 26 | Let's load in a few packages 27 | 28 | ```{r setup, eval=F} 29 | library(SCPA) 30 | library(Seurat) 31 | library(tidyverse) 32 | library(ComplexHeatmap) 33 | library(circlize) 34 | library(magrittr) 35 | ``` 36 | 37 | And load in a dataset from [Wilk, A...Blish, C](https://www.nature.com/articles/s41591-020-0944-y) that creates a single cell atlas of peripheral blood immune cells in COVID-19 patients. You can download this dataset [here](https://drive.google.com/file/d/1eYGW0psWFsxaRRtKTZCK6ESfPSQX0zeq/view?usp=sharing) 38 | 39 | ```{r, eval=F} 40 | blood_atlas <- readRDS("covid_blood_atlas.rds") 41 | Idents(blood_atlas) <- blood_atlas$cell.type 42 | ``` 43 | 44 | Let's have a quick look at the data, and get rid of any cell populations that aren't represented in both healthy and disease datasets. 45 | 46 | ```{r, eval=F} 47 | DimPlot(blood_atlas, label = T, group.by = "cell.type.fine", split.by = "Status") + 48 | theme(aspect.ratio = 1) 49 | ``` 50 | 51 | ![](../man/figures/covid_atlas.png){width=100%} 52 | 53 | ```{r, eval=F} 54 | idents <- c("Class-switched B", "IgG PB", "IgA PB", "CD14 Monocyte", "CD8m T", 55 | "CD4m T", "CD4n T", "B", "NK", "Neutrophil", "CD16 Monocyte", "gd T", 56 | "pDC", "SC & Eosinophil", "DC") 57 | blood_atlas <- subset(blood_atlas, idents = idents) 58 | ``` 59 | 60 | 61 | ## Preparing data for comparison 62 | Now we can pull all of the pathways that we want to compare. For this, we're using a csv file that contains a combination of canonical pathways, gene ontology pathways, and regulatory pathways from [MSigDB](https://www.gsea-msigdb.org/gsea/msigdb), and you can find this file [here](https://github.com/jackbibby1/SCPA/blob/main/gene_sets/). 63 | 64 | ```{r, eval=F} 65 | pathways <- "h_k_r_go_pid_reg_wik.csv" 66 | ``` 67 | 68 | And let's create an object with our cell types that we want to compare, and split the object by disease status. 69 | 70 | ```{r, eval=F} 71 | cell_types <- unique(blood_atlas$cell.type.fine) 72 | blood_atlas <- SplitObject(blood_atlas, split.by = "Status") 73 | ``` 74 | 75 | ## SCPA comparison 76 | Now we've formatted everything properly, we just need to loop SCPA over all the cell types in the dataset. Here we're using `seurat_extract` to pull expression matrices from each cell type, and then using these as the input to `compare_pathways`. We're using a load of pathways and cell types here, so this may take a while. To make the downstream analysis easier, we're only going to keep the Pathway and qval columns from the SCPA output, and then add the cell type to the column names, so we can keep track of the qvals for each cell type. 77 | 78 | ```{r, eval=F} 79 | scpa_out <- list() 80 | for (i in cell_types) { 81 | 82 | healthy <- seurat_extract(blood_atlas$Healthy, 83 | meta1 = "cell.type.fine", value_meta1 = i) 84 | 85 | covid <- seurat_extract(blood_atlas$COVID, 86 | meta1 = "cell.type.fine", value_meta1 = i) 87 | 88 | print(paste("comparing", i)) 89 | scpa_out[[i]] <- compare_pathways(list(healthy, covid), pathways) %>% 90 | select(Pathway, qval) %>% 91 | set_colnames(c("Pathway", paste(i, "qval", sep = "_"))) 92 | 93 | # For faster analysis with parallel processing, use 'parallel = TRUE' and 'cores = x' arguments 94 | 95 | } 96 | ``` 97 | 98 | ## Plotting the output 99 | ```{r, echo=F, eval=F} 100 | load("~/Google Drive/scRNA_metabolism_paper/Paper/Fig6/Disease_data/Tilo_COVID/mcross_bloodatlas_10k_gene_sets.RData") 101 | scpa_out <- mcross_blood_atlas 102 | ``` 103 | 104 |
    105 | **Click here for the data wrangling for plotting** 106 | 107 | Let's combine the results from all cell types, and just take pathways with a qval of > 2 in any comparison 108 | ```{r, eval=F} 109 | scpa_out <- scpa_out %>% 110 | reduce(full_join, by = "Pathway") %>% 111 | set_colnames(gsub(colnames(.), pattern = " ", replacement = "_")) %>% 112 | select(c("Pathway", grep("_qval", colnames(.)))) %>% 113 | filter_all(any_vars(. > 2)) %>% 114 | column_to_rownames("Pathway") 115 | ``` 116 | 117 | We can then take pathways that we want to highlight in the final plot 118 | ```{r, eval=F} 119 | blood_paths <- c("HALLMARK_TNFA_SIGNALING_VIA_NFKB", "HALLMARK_INFLAMMATORY_RESPONSE", 120 | "HALLMARK_COMPLEMENT", "HALLMARK_IL6_JAK_STAT3_SIGNALING", 121 | "HALLMARK_IL2_STAT5_SIGNALING", "HALLMARK_INTERFERON_GAMMA_RESPONSE", 122 | "HALLMARK_MTORC1_SIGNALING", "HALLMARK_INTERFERON_ALPHA_RESPONSE", 123 | "HALLMARK_MYC_TARGETS_V1", "HALLMARK_OXIDATIVE_PHOSPHORYLATION") 124 | ``` 125 | 126 | And create row annotations for the heatmap to highlight these pathways, and colour scale 127 | ```{r, eval=F} 128 | position <- which(rownames(scpa_out) %in% blood_paths) 129 | row_an <- rowAnnotation(Genes = anno_mark(at = which(rownames(scpa_out) %in% blood_paths), 130 | labels = rownames(scpa_out)[position], 131 | labels_gp = gpar(fontsize = 7), 132 | link_width = unit(2.5, "mm"), 133 | padding = unit(1, "mm"), 134 | link_gp = gpar(lwd = 0.5))) 135 | col_hm <- colorRamp2(colors = c("blue", "white", "red"), breaks = c(0, 3, 6)) 136 | ``` 137 | 138 |
    139 | \ 140 | 141 | Now we have all the results, we can plot a heatmap of the qvals to get an idea of any broad patterns. Interestingly, we see a large dysregulation of pathways in CD14^+^ monocytes in the peripheral blood of COVID-19 patients, suggesting that these cell show the greatest deviation from CD14^+^ monocytes from healthy donors. These pathways include well defined immunological signatures in response to viral infection, including interferon response pathways, and complement cascades. We've just chosen to highlight a few on the heatmap below. 142 | 143 | ```{r, eval=F} 144 | Heatmap(scpa_out, 145 | col = col_hm, 146 | name = "Qval", 147 | show_row_names = F, 148 | right_annotation = row_an, 149 | column_names_gp = gpar(fontsize = 8), 150 | border = T, 151 | column_km = 3, 152 | row_km = 3, 153 | column_labels = c("CS B", "IgG B", "IgA B", "CD14 Mono", "mCD8 T", "mCD4 T", 154 | "nCD4 T", "B", "NK", "Neut", "CD16 Mono", "gdT", "pDC", "Eosin", "DC")) 155 | ``` 156 | 157 | ![](../man/figures/covid_heatmap.png){width=75%} 158 | 159 | 160 | 161 | -------------------------------------------------------------------------------- /vignettes/interpreting_scpa_output.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Interpreting SCPA output" 3 | output: rmarkdown::html_vignette 4 | vignette: > 5 | %\VignetteIndexEntry{interpreting_scpa_output} 6 | %\VignetteEngine{knitr::rmarkdown} 7 | %\VignetteEncoding{UTF-8} 8 | --- 9 | 10 | ```{r, include = FALSE} 11 | knitr::opts_chunk$set( 12 | collapse = TRUE, 13 | comment = "#>" 14 | ) 15 | ``` 16 | 17 | ### Basic output from SCPA 18 | The output from SCPA provides 4-5 columns, depending on the type of comparison. These will be 1) your pathways 2) raw pval 3) adjusted pval 4) qval, and, if a two-sample comparison is done 5) fold change. Here is an example output: 19 | 20 | ```{r, echo=FALSE} 21 | scpa_out <- readRDS("../inst/rds_files/th1_tcm.rds") 22 | ``` 23 | 24 | ```{r} 25 | head(scpa_out, 10) 26 | ``` 27 | 28 | ### Which output values should you use? 29 | Instead of looking at pathway enrichment, SCPA assesses changes in the multivariate distribution of a pathway. However, 30 | pathways that show enrichment in a given population will also necessarily show large changes in multivariate distribution. This means that with SCPA 31 | you're able to detect 1) enriched pathways and 2) non-enriched pathways that have transcriptional changes that are independent 32 | of enrichment. This output is reflected in the qval, and we recommend people to use this as their primary statistic. Here, 33 | the larger the qval, the larger the change in pathway 'activity'. As SCPA measures multivariate distributions, there will be pathways 34 | that show significantly large qvals, but no overall fold change/enrichment in a given population. Whilst these pathways are not enriched, 35 | we know that these distribution changes identified by SCPA are still important for cellular behaviour. We show an example of this in Figure 4 36 | [our paper](https://www.cell.com/cell-reports/fulltext/S2211-1247(22)01571-6), where arachidonic acid metabolism is not enriched, but shows 37 | changes in multivariate distribution, and is shown to be critical for T cell activation. We are therefore proposing that considering changes in 38 | multivariate distributions of pathways is a better overall reflection of pathway activity, and because of this, you should use the qval as your statistical 39 | measurement of pathway activity, and fold change only as a secondary informative value. 40 | 41 | ### Filtering and visualizing the SCPA output 42 | In general, it's most informative to visualize the whole output of the pathway analysis so you can understand the global pattern of pathway changes 43 | that are occurring in your populations. So whilst you can use a typical statistical filter e.g. adjusted pval < 0.01, we generally 44 | propose using something like a ranking plot to visualize the distribution of qvals, whilst still being able to highlight certain pathways. We provide 45 | some basic functions including `plot_rank()` that can visualize the SCPA output like this, and also provide the `plot_heatmap()` function that can visualize 46 | more than one comparison. See the [Visualization tutorial](https://jackbibby1.github.io/SCPA/articles/visualisation.html) for some examples of this. 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /vignettes/parallel_implementation.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Parallel processing for faster analysis" 3 | output: rmarkdown::html_vignette 4 | vignette: > 5 | %\VignetteIndexEntry{parallel_implementation} 6 | %\VignetteEngine{knitr::rmarkdown} 7 | %\VignetteEncoding{UTF-8} 8 | --- 9 | 10 | ```{r, include = FALSE} 11 | knitr::opts_chunk$set( 12 | collapse = TRUE, 13 | comment = "#>" 14 | ) 15 | ``` 16 | 17 | Version 1.5 added parallel implementation in the `compare_pathways()` function, which will significantly reduce the time taken for pathway comparisons. Users can specify this with `parallel = TRUE` and `cores = x`. 18 | Here are some benchmarking figures for varying numbers of cores (1-8) and pathways (50-5000) using the default 500 cells 19 | per population. You can see that using somewhere between 2-4 cores scales well, showing large improvements in completion speed. 20 | 21 |
    22 | **Click here for the benchmarking code** 23 | 24 | ```{r setup, eval=F} 25 | library(SCPA) 26 | library(msigdbr) 27 | library(Seurat) 28 | library(magrittr) 29 | library(ggplot2) 30 | 31 | df <- readRDS("naive_cd4.rds") 32 | 33 | pathways <- msigdbr("Homo sapiens", "H") %>% 34 | format_pathways() 35 | 36 | p1 <- seurat_extract(df, meta1 = "Hour", value_meta1 = "0") 37 | p2 <- seurat_extract(df, meta1 = "Hour", value_meta1 = "12") 38 | 39 | cores_to_use <- seq(1, 8, 1) 40 | gene_set_multiplier <- c(1, 5, 10, 20, 40, 100) 41 | 42 | two_sample_times <- list() 43 | for (i in gene_set_multiplier) { 44 | two_sample_times[[as.character(i)]] <- lapply(cores_to_use, function(x) { 45 | system.time(compare_pathways_parallel(samples = list(p1, p2), pathways = rep(pathways, i), cores = x, downsample = 100)) 46 | }) 47 | } 48 | 49 | two_sample_times %>% 50 | lapply(function(x) lapply(x, function(c) c[3])) %>% 51 | unlist() %>% 52 | data.frame() %>% 53 | rename(time = ".") %>% 54 | mutate(time = time/60) %>% 55 | mutate(cores = rep(cores_to_use, times = 6)) %>% 56 | mutate(pathway_size = rep(50*(gene_set_multiplier), each = 8)) %>% 57 | ggplot(aes(cores, time)) + 58 | geom_smooth(se = F, col = "tomato", linewidth = 0.5) + 59 | facet_wrap(~pathway_size, scales = "free_y") + 60 | geom_point(shape = 21, size = 3.5, stroke = 0.3, aes(fill = cores)) + 61 | scale_y_continuous(limits = c(0, NA)) + 62 | scale_x_continuous(breaks = seq(1, 8, 1)) + 63 | labs(x = "Cores", y = "Time (minutes)", title = "Analysis time by cores and total pathways") + 64 | theme(panel.background = element_blank(), 65 | panel.border = element_rect(fill = NA), 66 | legend.position = "none") 67 | 68 | 69 | ``` 70 | 71 |
    72 | \ 73 | 74 | ![](../man/figures/two_sample_time_paths.png){width=60%} 75 | 76 | And here's some equivalent benchmarking using the multisample comparison across three populations: 77 | 78 |
    79 | **Click here for the benchmarking code** 80 | 81 | ```{r, eval=F} 82 | p3 <- seurat_extract(df, meta1 = "Hour", value_meta1 = "24") 83 | 84 | cores_to_use <- seq(1, 8, 1) 85 | gene_set_multiplier <- c(1, 5, 10, 20, 40, 100) 86 | 87 | multisample_times <- list() 88 | for (i in gene_set_multiplier) { 89 | multisample_times[[as.character(i)]] <- lapply(cores_to_use, function(x) { 90 | system.time(compare_pathways_parallel(samples = list(p1, p2, p3), pathways = rep(pathways, i), cores = x)) 91 | }) 92 | } 93 | 94 | df %>% 95 | lapply(function(x) lapply(x, function(c) c[3])) %>% 96 | unlist() %>% 97 | data.frame() %>% 98 | rename(time = ".") %>% 99 | mutate(time = time/60) %>% 100 | mutate(cores = rep(cores_to_use, times = 6)) %>% 101 | mutate(pathway_size = rep(50*(gene_set_multiplier), each = 8)) %>% 102 | ggplot(aes(cores, time)) + 103 | geom_smooth(se = F, col = "tomato", linewidth = 0.5) + 104 | facet_wrap(~pathway_size, scales = "free_y") + 105 | geom_point(shape = 21, size = 3.5, stroke = 0.3, aes(fill = cores)) + 106 | scale_y_continuous(limits = c(0, NA)) + 107 | scale_x_continuous(breaks = seq(1, 8, 1)) + 108 | labs(x = "Cores", y = "Time (minutes)", title = "Analysis time by cores and total pathways") + 109 | theme(panel.background = element_blank(), 110 | panel.border = element_rect(fill = NA), 111 | legend.position = "none") 112 | 113 | ``` 114 | 115 |
    116 | \ 117 | 118 | ![](../man/figures/multisample_time.png){width=60%} 119 | 120 | 121 | 122 | -------------------------------------------------------------------------------- /vignettes/pseudotime.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Comparing pathways over pseudotime" 3 | output: rmarkdown::html_vignette 4 | vignette: > 5 | %\VignetteIndexEntry{pseudotime} 6 | %\VignetteEngine{knitr::rmarkdown} 7 | %\VignetteEncoding{UTF-8} 8 | --- 9 | 10 | ```{r, include = FALSE} 11 | knitr::opts_chunk$set( 12 | collapse = TRUE, 13 | comment = "#>" 14 | ) 15 | ``` 16 | 17 | ## Multisample analysis with SCPA 18 | Multisample analysis can be performed with SCPA, meaning you can test pathway activity over multiple populations. This may be useful if you have multiple time points, or a pseudotime trajectory. The principle is the same as a two group comparison, but you just need to supply more populations. For example, if you have three time points, you would run: 19 | 20 | ```{r, eval=F} 21 | scpa_out <- compare_pathways(samples = list(pop1, pop2, pop3), 22 | pathways = pathways) 23 | 24 | ``` 25 | 26 | ## Comparing pathways across pseudotime with SCPA 27 | 28 | Here we're going to look at tracking gene set changes across a pseudotime trajectory, using the multisample capability of SCPA. To do this, we'll use a dataset that we generated where naive CD4^+^ T cells were left unstimulated, or stimulated for 12 or 24 hours with anti-CD3 and anti-CD28. You can find this dataset [here](https://drive.google.com/file/d/1XstWBD4lOY0QNd-8Wzeh1f3-uYKuUU5Q/view?usp=sharing), and 29 | this analysis will replicate Figure 4 from [our paper](https://www.cell.com/cell-reports/fulltext/S2211-1247(22)01571-6). We'll do a systematic analysis of how metabolic pathways are transcriptionally regulated throughout naive CD4^+^ T cell activation. 30 | 31 | Let's load in a few packages to start 32 | 33 | ```{r setup, eval=F} 34 | library(SCPA) 35 | library(Seurat) 36 | library(tidyverse) 37 | library(magrittr) 38 | library(dyno) 39 | library(ComplexHeatmap) 40 | library(circlize) 41 | ``` 42 | 43 | 44 | ### Load in data 45 | ```{r, eval=F} 46 | naive_cd4 <- readRDS("naive_cd4.rds") 47 | ``` 48 | 49 | 50 | ### Quick look at the data 51 | We can see that the populations include both naive/activated T cells, and Tregs 52 | ```{r plot_umap, eval=F} 53 | DimPlot(naive_cd4, split.by = "Hour") 54 | ``` 55 | ![](../man/figures/naive_cd4_umap.png){width=100%} 56 | 57 | ### Filter out cells we don't want 58 | We'll get rid of the Tregs because we're just interested in naive T cell activation in the non Treg populations 59 | 60 | ```{r remove_treg, eval=F} 61 | naive_cd4 <- subset(naive_cd4, idents = "Treg", invert = T) 62 | ``` 63 | 64 | 65 | ### Model trajectory using the dyno workflow 66 | We'll then take the top 1000 most variable genes to model a trajectory 67 | ```{r var_genes, eval=F} 68 | df <- as.matrix(naive_cd4[["RNA"]]@data) 69 | var_genes <- names(sort(apply(df, 1, var), decreasing = TRUE))[1:1000] 70 | ``` 71 | 72 | And then these steps are broadly taken from the [dyno vignettes](https://dynverse.org/users/3-user-guide/). We're just taking expression data and adding it to the object so it's able to be used in the `infer_trajectory` 73 | function. 74 | 75 | ```{r make_matrix, eval=F} 76 | counts <- Matrix::t(as(as.matrix(naive_cd4@assays$RNA@counts[var_genes,]), 'sparseMatrix')) 77 | expression <- Matrix::t(as(as.matrix(naive_cd4@assays$RNA@data[var_genes,]), 'sparseMatrix')) 78 | 79 | dataset_n4 <- wrap_expression(expression = expression, 80 | counts = counts) 81 | ``` 82 | 83 | And finally running the `infer_trajectory` function using slingshot as the modeller 84 | ```{r run_modelling, eval=FALSE} 85 | model_n4 <- infer_trajectory(dataset_n4, method = ti_slingshot(), verbose = T) 86 | ``` 87 | 88 | We can visualise the trajectory 89 | 90 | ```{r plot_dimred, eval=F} 91 | plot_dimred(model_n4, 92 | "pseudotime", 93 | pseudotime = calculate_pseudotime(model_n4), 94 | hex_cells = F, 95 | plot_trajectory = T, 96 | size_cells = 1, alpha_cells = 0.8) + 97 | theme(aspect.ratio = 1) 98 | ``` 99 | 100 | ![](../man/figures/naive_cd4_pseudo.png){width=50%} 101 | 102 | 103 | Once we have our trajectory calculated, we can generate distinct nodes of cells across the trajectory 104 | to use as an input for SCPA. To generate the nodes, we can use the `group_onto_nearest_milestones` function, which assigns each cell to a node based on it's pseudotime value. 105 | 106 | We can then visualize the nodes that are calculated across the trajectory to see what we're extracting 107 | 108 | ```{r plot_dimred_milestones, eval=F} 109 | plot_dimred(model_n4, 110 | grouping = group_onto_nearest_milestones(model_n4), 111 | hex_cells = F, 112 | plot_trajectory = T, 113 | size_cells = 1, alpha_cells = 0.8) + 114 | theme(aspect.ratio = 1) 115 | ``` 116 | 117 | ![](../man/figures/naive_cd4_milestone.png){width=50%} 118 | 119 | 120 | 121 | And extract the cells based on this grouping 122 | 123 | ```{r get_milestones, eval=F} 124 | mile_group <- data.frame(group_onto_nearest_milestones(model_n4)) %>% 125 | set_colnames("milestone") %>% 126 | rownames_to_column("cell") 127 | ``` 128 | 129 | Once we have the pseudotime groupings, we can add this information to the Seurat 130 | object. 131 | 132 | ```{r add_milestones, eval=F} 133 | naive_cd4$milestone <- mile_group$milestone 134 | ``` 135 | 136 | 137 | ### Extract expression data for the populations we're comparing 138 | We then need to extract expression matrices for all the cells across the distinct nodes, 139 | so we effectively have 4 populations across the trajectory. We can use these expression 140 | matrices to assess pathways across the 4 nodes. 141 | 142 | We can loop the `seurat_extract` function to get expression matrices for all cells in each population. If you have a SingleCellExperiment object, you can use the `sce_extract` function. 143 | 144 | ```{r seurat_extract, eval=F} 145 | cd4_pseudo <- list() 146 | for (i in 1:max(mile_group$milestone)) { 147 | cd4_pseudo[[i]] <- seurat_extract(naive_cd4, meta1 = "milestone", value_meta1 = i) 148 | } 149 | ``` 150 | 151 | ### Define pathways and run comparison 152 | Now all the hard work is done, we just need to give this information to SCPA to analyse 153 | pathways over pseudotime, after defining the pathways. Here we're using a curated list of metabolic 154 | pathways taken from Hallmark, KEGG, and Reactome databases that you can find [here](https://github.com/jackbibby1/SCPA/blob/main/gene_sets/) 155 | 156 | ```{r compare_pathways, eval=F} 157 | pathways <- "combined_metabolic_pathways.csv" 158 | 159 | cd4_metabolism <- compare_pathways(samples = cd4_pseudo, 160 | pathways = pathways) 161 | 162 | # For faster analysis with parallel processing, use 'parallel = TRUE' and 'cores = x' arguments 163 | ``` 164 | 165 | 166 | ### Plot a global summary of the data 167 | All done. Let's plot the data (some annotations have been added later to highlight pathways) 168 | 169 | ```{r plot_heatmap, eval=F} 170 | cd4_metabolism <- cd4_metabolism %>% 171 | data.frame() %>% 172 | select(Pathway, qval) %>% 173 | column_to_rownames("Pathway") 174 | 175 | col_hm <- colorRamp2(colors = c("white", "red"), breaks = c(0, max(mstone_out))) 176 | 177 | Heatmap(t(cd4_metabolism), 178 | name = "Qvalue", 179 | col = col_hm, 180 | border = T, 181 | rect_gp = gpar(col = "white", lwd = 0.1), 182 | heatmap_height = unit(2, "cm"), 183 | show_column_dend = F, 184 | show_row_names = F, 185 | show_column_names = F) 186 | ``` 187 | 188 | ![](../man/figures/metabolic_heatmap.png){width=70%} 189 | 190 | 191 | ### Highlight pathway by rank 192 | We can also extract a single pathway to highlight its rank in the analysis using the 193 | `plot_rank` function. There are lots of glycolysis pathways near the top of the list, 194 | but we'll just highlight one. 195 | 196 | ```{r plot_rank, eval=F} 197 | plot_rank(scpa_out = cd4_metabolism, 198 | pathway = "hallmark_gly", 199 | base_point_size = 2.5, 200 | highlight_point_size = 3) 201 | ``` 202 | 203 | ![](../man/figures/pseudotime_rank.png){width=40%} 204 | 205 | 206 | 207 | 208 | 209 | -------------------------------------------------------------------------------- /vignettes/quick_start.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Quick Start" 3 | output: rmarkdown::html_vignette 4 | vignette: > 5 | %\VignetteIndexEntry{quick_start} 6 | %\VignetteEngine{knitr::rmarkdown} 7 | %\VignetteEncoding{UTF-8} 8 | --- 9 | 10 | ```{r, include = FALSE} 11 | knitr::opts_chunk$set( 12 | collapse = TRUE, 13 | comment = "#>" 14 | ) 15 | ``` 16 | 17 | ## 1. Broad overview of the workflow 18 | 19 | ```{r, eval=F} 20 | pathways <- msigdbr("Homo sapiens", "H") %>% 21 | format_pathways() 22 | 23 | # The populations here just need to be your normalized expression matrices 24 | 25 | scpa_out <- compare_pathways(samples = list(population1, population2), 26 | pathways = pathways) 27 | 28 | # For faster analysis with parallel processing, use 'parallel = TRUE' and 'cores = x' arguments 29 | 30 | ``` 31 | 32 | In this output, the qval should be the primary metric that is used to interpret pathway differences i.e. a higher 33 | qval translates to larger pathway differences between conditions. 34 | If only two samples are provided, a fold change (FC) enrichment score will also be 35 | calculated. A large advantage in assessing the multivariate distribution of a pathway in SCPA is that there will be pathways that show large qvals, but relatively small fold changes. These pathways 36 | therefore show large differences that are independent of mean changes in gene expression. These are still highly relevant pathways, which we show in [our paper](https://www.cell.com/cell-reports/fulltext/S2211-1247(22)01571-6), and is why we suggest solely using the qval for 37 | your statistical interpretation. 38 | 39 | ## 2. Full workflow on an example dataset 40 | 41 | Here we're just going to show some general principles of what you need to get started in a basic pathway analysis. It acts as a quick reference to all the main points of the workflow, but more detailed examples can be found in our other tutorials. 42 | 43 | ### Basic information needed for pathway analysis 44 | The two main bits of information we need are: 45 | 46 | - Expression matrix for each condition (this can be formatted as separate data frames/matrices, or stored within a typical Seurat/SingleCellExperiment object) 47 | - Gene sets 48 | 49 | ### Loading in packages 50 | For this simple example, we're going to load in a few packages. msigdbr allows access to a large number of gene sets that are collated [here](https://www.gsea-msigdb.org/gsea/msigdb/genesets.jsp) 51 | 52 | ```{r setup, results='hide', warning=F, message=F, eval=F} 53 | library(SCPA) 54 | library(msigdbr) 55 | library(Seurat) 56 | library(dplyr) 57 | library(ggplot2) 58 | ``` 59 | 60 | ### Loading in data 61 | Here we're going to use data taken from the [Szabo, P... Sims, P](https://www.nature.com/articles/s41467-019-12464-3) paper. You can find this data in an R object [here](https://drive.google.com/file/d/1-HJHfSMw5EBP02ZjTrbX7Pd_5eYGe1Zz/view?usp=sharing) 62 | 63 | ```{r, eval=F} 64 | t_cells <- readRDS("szabo_t_cell.rds") 65 | ``` 66 | 67 | 68 | ### Quick Look at the data 69 | ```{r plot_umap, eval=F} 70 | DimPlot(t_cells) + 71 | theme(aspect.ratio = 1) 72 | ``` 73 | 74 | ![](../man/figures/fine_tissue.png){width=60%} 75 | 76 | 77 | ### Generating samples from a Seurat object 78 | For this basic comparison, we're going to look at T helper 1 (Th1) and T central memory (Tcm) cells. To generate expression matrices that SCPA can use, we can run the `seurat_extract` function. This takes a Seurat object as an input, subsets data based on the Seurat column metadata, and returns an expression file for that given subset. If you have a SingleCellExperiment object, you can use the `sce_extract` function. 79 | 80 | ```{r extract_data, eval=F} 81 | tcm <- seurat_extract(t_cells, 82 | meta1 = "cell", value_meta1 = "cd4 tcm") 83 | th1 <- seurat_extract(t_cells, 84 | meta1 = "cell", value_meta1 = "cd4 th1") 85 | ``` 86 | 87 | ### Generate some gene sets using msigdbr 88 | We then need to generate our gene sets. msigdbr is a handy package 89 | that allows you to get this information. Here we're pulling all the Hallmark pathways, and 90 | using the `format_pathways` function within SPCA to get them properly formatted. A detailed explanation of 91 | generating gene sets for SCPA can be found [here](https://jackbibby1.github.io/SCPA/articles/using_gene_sets.html) 92 | 93 | ```{r get_pathways, eval=F} 94 | pathways <- msigdbr("Homo sapiens", "H") %>% 95 | format_pathways() 96 | ``` 97 | 98 | ### Comparing samples 99 | We're all set. We now have everything that we need to compare the two populations. So just run 100 | `compare_pathways` and use the objects we created above. 101 | 102 | ```{r compare_pathways, eval=F} 103 | scpa_out <- compare_pathways(samples = list(tcm, th1), 104 | pathways = pathways) 105 | 106 | # For faster analysis with parallel processing, use 'parallel = TRUE' and 'cores = x' arguments 107 | ``` 108 | 109 | ```{r, echo=F} 110 | scpa_out <- readRDS("../inst/rds_files/th1_tcm.rds") 111 | ``` 112 | 113 | 114 | And in `scpa_out`, we have all our results. 115 | 116 | ```{r lood_at_output} 117 | head(scpa_out, 5) 118 | ``` 119 | 120 | ### Plotting some basic output 121 | You can use SCPA to generate a pathway rank plot. For example, we can highlight one of the topmost pathways -- MTORC1 -- using the `plot_rank` function. 122 | 123 | ```{r plot_rank, eval=F, dpi=600, out.width="50%"} 124 | plot_rank(scpa_out = scpa_out, 125 | pathway = "MTORC1", 126 | base_point_size = 2, 127 | highlight_point_size = 3) 128 | ``` 129 | 130 | ![](../man/figures/mtorc1_rank.png){width=50%} 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /vignettes/seurat_comparison.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Comparison within Seurat object" 3 | output: rmarkdown::html_vignette 4 | vignette: > 5 | %\VignetteIndexEntry{seurat_comparison} 6 | %\VignetteEngine{knitr::rmarkdown} 7 | %\VignetteEncoding{UTF-8} 8 | --- 9 | 10 | ```{r, include = FALSE} 11 | knitr::opts_chunk$set( 12 | collapse = TRUE, 13 | comment = "#>" 14 | ) 15 | ``` 16 | 17 | As well as importing expression matrices into `compare_pathways`, you can also compare populations directly within a Seurat or SingleCellExperiment object in one function within SCPA. To do this, you just need the Seurat/SCE object that is annotated with the groups you want to compare. 18 | 19 | Let's load in a few packages. 20 | ```{r setup, eval=F} 21 | library(SCPA) 22 | library(tidyverse) 23 | library(msigdbr) 24 | library(Seurat) 25 | ``` 26 | 27 | 28 | ### Getting the dataset 29 | We're going to do the same comparison of Th1 and Tcm cells that we did in the [quick start tutorial](https://jackbibby1.github.io/SCPA/articles/quick_start.html), again using all Hallmark gene sets. We'll use the [Szabo, P... Sims, P](https://www.nature.com/articles/s41467-019-12464-3) T cell dataset that you can download [here](https://drive.google.com/file/d/1-HJHfSMw5EBP02ZjTrbX7Pd_5eYGe1Zz/view?usp=sharing). 30 | 31 | ```{r, eval=F} 32 | t_cells <- readRDS("szabo_t_cell.rds") 33 | ``` 34 | 35 | ### Quick Look at the data 36 | ```{r plot_umap, eval=F} 37 | DimPlot(t_cells) + 38 | theme(aspect.ratio = 1) 39 | ``` 40 | 41 | ![](../man/figures/cd4_cell_types.png){width=50%} 42 | 43 | ### Getting the gene sets 44 | We need to define our gene sets, and we can do this through the msigdbr package that contains a bunch of biological gene sets that can be found [here](https://www.gsea-msigdb.org/gsea/msigdb/genesets.jsp). Here we just take the Hallmark gene sets (using the "H" call to msigdbr), and use the format_pathways function to get them in a readable format for SCPA. 45 | 46 | ```{r get_pathways, eval=F} 47 | pathways <- msigdbr("Homo sapiens", "H") %>% 48 | format_pathways() 49 | ``` 50 | 51 | 52 | ### SCPA comparison 53 | Now to compare the Th1 and Tcm populations, we can use the compare_seurat function within SCPA. Here, `group1` defines the column name for your metadata, and `group1_population` defines two values within that column. N.B. We're going to compare populations within a Seurat object here, but it's the same set up for a SCE object using the `compare_sce` function. 54 | 55 | ```{r compare_pathways, eval=F} 56 | scpa_out <- compare_seurat(t_cells, 57 | group1 = "cell", 58 | group1_population = c("cd4 th1", "cd4 tcm"), 59 | pathways = pathways) 60 | 61 | # For faster analysis with parallel processing, use 'parallel = TRUE' and 'cores = x' arguments 62 | ``` 63 | 64 | And that's it. Your results will be stored in your `scpa_out` object. 65 | 66 | ### Comparing across more than 2 populations 67 | If you wanted to compare more than 2 populations in a Seurat object e.g. multiple time points, you just need to supply more arguments to the `group1_population` call. For example, on a hypothetical dataset: 68 | 69 | ```{r multiple_comparisons, eval=F} 70 | scpa_out <- compare_seurat(different_dataset, 71 | group1 = "hour", 72 | group1_population = c("0", "12", "24"), 73 | group2 = "cell", 74 | group2_population = "t_cells" 75 | pathways = pathways) 76 | 77 | # For faster analysis with parallel processing, use 'parallel = TRUE' and 'cores = x' arguments 78 | 79 | ``` 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /vignettes/using_gene_sets.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Generating gene sets" 3 | output: rmarkdown::html_vignette 4 | vignette: > 5 | %\VignetteIndexEntry{using_gene_sets} 6 | %\VignetteEngine{knitr::rmarkdown} 7 | %\VignetteEncoding{UTF-8} 8 | --- 9 | 10 | ```{r, include = FALSE} 11 | knitr::opts_chunk$set( 12 | collapse = TRUE, 13 | comment = "#>" 14 | ) 15 | ``` 16 | 17 | ## Using gene sets in SCPA 18 | There are a few different formats for gene sets that you can use in SCPA. However you decide to generate them though, the gene names need to be formatted in the same way across your expression file and gene sets i.e. if you have human gene symbols in your expression data, you need human gene symbols in your gene set. 19 | 20 | - Generate gene set lists in R (possibly the best option) 21 | - Use a classical gene set gmt file 22 | - Use a csv file 23 | 24 | Here we'll outline a basic workflow to get gene sets using either of the methods. First let's load in a couple of packages we'll need 25 | 26 | ```{r setup, message=FALSE} 27 | library(SCPA) 28 | library(msigdbr) 29 | library(magrittr) 30 | library(dplyr) 31 | ``` 32 | 33 | 34 | ### 1. Generating gene sets within R using msigdbr 35 | 36 | ### Generic example 37 | In a simple example, you can generate formatted gene sets using two simple lines of code. We'll just extract all the Hallmark pathways from msigdbr 38 | 39 | ```{r, eval=F} 40 | pathways <- msigdbr(species = "Homo sapiens", category = "H") %>% 41 | format_pathways() 42 | ``` 43 | 44 | ### More detailed example 45 | msigdbr is a handy R package that contains a huge number of pathways that are derived from 46 | the Molecular Signatures Database (MSigDB) v7.5.1. Using msigdbr is probably the easiest and 47 | most efficient way to generate all the gene sets that you're interested in. You can see 48 | a detailed explanation of how to use different aspects of the package in the 49 | [msigdbr vignette](https://igordot.github.io/msigdbr/articles/msigdbr-intro.html). 50 | We're going to use it to generate lists of gene sets that we want to analyse in our data using SCPA. 51 | 52 | For example, we can generate a data frame containing all of the Homo sapiens 53 | Hallmark gene sets using the "H" call within `msigdbr`. This data is in tidy format 54 | with all the pathway names in the gs_name column, and gene names in the gene_symbol 55 | column 56 | 57 | ```{r} 58 | hallmark <- msigdbr("Homo sapiens", "H") 59 | head(hallmark) 60 | 61 | ``` 62 | 63 | We can have a look at a few of these pathways 64 | 65 | ```{r} 66 | hallmark$gs_name %>% 67 | unique() %>% 68 | head(10) 69 | 70 | ``` 71 | 72 | We only need the pathway name and gene symbol though. For SCPA, we also need it to be formatted 73 | into separate lists for each pathway. We can do this easily using the `format_pathways()` function 74 | within SCPA 75 | 76 | ```{r} 77 | hallmark <- format_pathways(hallmark) 78 | ``` 79 | 80 | This will result in a separate list for each pathway that contains the pathway name and all the genes of that pathway. 81 | We can see this if we just look at the top of the first pathway list 82 | 83 | ```{r} 84 | head(hallmark[[1]]) 85 | ``` 86 | 87 | Now we've generated pathways that can be analysed directly in the `compare_pathways()` function of SCPA 88 | 89 | 90 | ### Versatility in using msigdbr 91 | An advantage of using something like msigdbr is its versatility in subsetting specific pathways, 92 | or collection of gene sets. For example, if we wanted all pathways related to interferon, 93 | we could use grepl to filter the gs_names column: 94 | 95 | ```{r, eval=F} 96 | ifn_pathways <- msigdbr("Homo sapiens") %>% 97 | filter(grepl("interferon", gs_name, ignore.case = T)) %>% 98 | format_pathways() 99 | ``` 100 | 101 | Or we could specify a combination of collections so we get all of the Hallmark, 102 | KEGG, and Reactome gene sets: 103 | 104 | ```{r, eval=F} 105 | pathways <- c("hallmark", "kegg", "reactome") 106 | hkr_sets <- msigdbr("Homo sapiens") %>% 107 | filter(grepl(paste(pathways, collapse = "|"), gs_name, ignore.case = T)) %>% 108 | format_pathways() 109 | ``` 110 | 111 | Using something like this makes it easy to pull large and/or relevant gene set lists for direct use within SCPA. 112 | 113 | ### 2. Using a gmt file 114 | You can download gmt files for both [human](https://www.gsea-msigdb.org/gsea/msigdb/human/collections.jsp) and [mouse](https://www.gsea-msigdb.org/gsea/msigdb/mouse/collections.jsp) from the MSigDB, selecting the "gene symbols" version. 115 | SCPA has a built in function to read gmt files and format them properly, so all you need to do is specify the filepath(s); this can be a 116 | single file or multiple gmt files e.g. creating a list of all the gmt files in a particular directory: 117 | 118 | ```{r, eval=F} 119 | gmt_files <- list.files(path = "gene_sets", pattern = "gmt", full.names = T) 120 | ``` 121 | 122 | And then you can just use this in the `compare_pathways()` function 123 | 124 | ```{r, eval=F} 125 | scpa_out <- compare_pathways(samples = samples, pathways = gmt_files) 126 | ``` 127 | 128 | 129 | ### 3. Using a csv file 130 | In this example, we need to create the csv file, but once that's done, 131 | it's a simple line of code. As with gmt files, SCPA can directly read properly formatted 132 | csv gene set files -- you just need to supply the filepath 133 | 134 | ```{r, eval=F} 135 | pathways <- "path/to/geneset/file.csv" 136 | scpa_out <- compare_pathways(samples = samples, pathways = pathways) 137 | ``` 138 | 139 | ### How to create the csv file 140 | The csv file needs to be formatted in the style of a classical 141 | gene set gmt file. This being the pathway name in column 1, and genes of that pathway in subsequent 142 | columns. To generate something like this, all you need to do is download a gmt file, open it in something like excel, delete the second column containing a url, and save it as a csv file. Using this method means you can manually create a list of gene sets you're interested in, where you're not limited to existing databases. The file should look something like this: 143 | 144 | ![](../man/figures/pathway_screenshot.png){width=100%} 145 | 146 | 147 | 148 | 149 | 150 | 151 | -------------------------------------------------------------------------------- /vignettes/visualisation.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Visualisation" 3 | output: rmarkdown::html_vignette 4 | vignette: > 5 | %\VignetteIndexEntry{visualisation} 6 | %\VignetteEngine{knitr::rmarkdown} 7 | %\VignetteEncoding{UTF-8} 8 | --- 9 | 10 | ```{r, include = FALSE} 11 | knitr::opts_chunk$set( 12 | collapse = TRUE, 13 | comment = "#>" 14 | ) 15 | ``` 16 | 17 | ## Visualising the output from SCPA 18 | 19 | Visualising the output from SCPA is best done by considering the relative ranks of the qvals. 20 | This will give you the best chance to find the most appropriate signal. 21 | 22 | ```{r, include=FALSE} 23 | scpa_out <- readRDS("../inst/rds_files/th1_tcm.rds") 24 | ``` 25 | 26 | Lets load in some packages 27 | ```{r setup, warning=FALSE, message=FALSE} 28 | library(SCPA) 29 | library(magrittr) 30 | library(dplyr) 31 | library(ComplexHeatmap) 32 | ``` 33 | 34 | We can use data from the comparison we did in the 35 | [quick start](https://jackbibby1.github.io/SCPA/articles/quick_start.html) 36 | tutorial where we compared Th1 and Tcm cells. You can get this rds file [here](https://github.com/jackbibby1/SCPA/tree/main/rds_files). 37 | 38 | ```{r, eval=FALSE} 39 | scpa_out <- readRDS("th1_tcm.rds") 40 | ``` 41 | 42 | `scpa_out` is the standard output from a two sample SCPA comparison: 43 | 44 | ```{r} 45 | head(scpa_out) 46 | ``` 47 | 48 | 49 | ## 1. A simple rank plot 50 | We can use the `plot_rank` function in SCPA to plot the rank of a specific 51 | pathway (or pathways) that we want to highlight. By default, this looks for a `qval` and `Pathway` 52 | column, which is standard in the SCPA output. 53 | 54 | If you have your own data frame that contains all your qvals and a Pathway column, 55 | you can specify the column you want on the y axis with the 56 | `population_name = [your_qval_column_name]` argument. 57 | See `?plot_rank` for all the graphical parameters, but this is a ggplot object, so you can modify it using 58 | the typical arguments e.g. `+ theme(panel.background...)`. 59 | 60 | ```{r, eval=FALSE} 61 | # if you want all pathways that contain "MYC"... 62 | p1 <- plot_rank(scpa_out, "myc", 63 | highlight_point_size = 3.5, highlight_point_color = "#60c5f7") 64 | 65 | # or if you want a specific myc pathway... 66 | p2 <- plot_rank(scpa_out, "HALLMARK_MYC_TARGETS_V1", 67 | highlight_point_size = 3.5, highlight_point_color = "#fa815c") 68 | 69 | patchwork::wrap_plots(p1, p2) 70 | 71 | ``` 72 | 73 | ![](../man/figures/rank_plot.png){width=80%} 74 | 75 | ## 2. Plotting a heatmap of results 76 | You can use the `plot_heatmap` option within SCPA to visualise the output, which uses the great 77 | [ComplexHeatmap](https://github.com/jokergoo/ComplexHeatmap) package. Like the 78 | `plot_rank` function, you can choose to highlight general or specific pathways. By default, this function 79 | looks for any column names that contain "qval", and uses them to plot the heatmap. This means you can combine 80 | multiple SCPA results into a single heatmap. See `?plot_heatmap` for graphical parameters. 81 | 82 | 83 | ```{r, warning=FALSE, eval=FALSE} 84 | plot_heatmap(scpa_out, 85 | highlight_pathways = "myc", 86 | column_names = "Th1 vs Tcm", 87 | show_row_names = F) 88 | ``` 89 | 90 | ![](../man/figures/heatmap_1.png){width=40%} 91 | 92 | If you want to combine multiple scpa outputs into a single heatmap, you can add 93 | your qvals into a single data frame. You just need to make sure the column you're 94 | adding contains "qval" in its name e.g. 95 | 96 | ```{r, warning=FALSE, eval=FALSE} 97 | # here we'll just duplicate the qval column for the purpose of this example 98 | scpa_out %>% 99 | mutate(another_qval = qval) %>% 100 | plot_heatmap(highlight_pathways = "myc", 101 | hm_colors = c("#5ab0f2", "white", "#be67c9"), 102 | column_names = c("First qval", "Second qval"), 103 | cluster_columns = F, 104 | show_row_names = F) 105 | ``` 106 | 107 | ![](../man/figures/heatmap_2.png){width=50%} 108 | 109 | 110 | 111 | 112 | --------------------------------------------------------------------------------