├── .Rbuildignore ├── .Rprofile ├── .dockerignore ├── .github ├── .gitignore └── workflows │ └── ci.yml ├── .gitignore ├── .renvignore ├── CITATION.cff ├── DESCRIPTION ├── Dockerfile ├── LICENSE ├── LICENSE.md ├── NAMESPACE ├── NEWS.md ├── R ├── NNTransform.R ├── SingleViolinIPlot.R ├── diff_utils.R ├── dropdownButton.R ├── format_query_table.R ├── from_crossmeta.R ├── get_drugs_table.R ├── import_scseq.R ├── matrix_utils.R ├── merge_utils.R ├── modules-bulk-server.R ├── modules-bulk-ui.R ├── modules-bulk-utils.R ├── modules-drugs-server.R ├── modules-drugs-ui.R ├── modules-drugs-utils.R ├── modules-path-utils.R ├── modules-sc-server.R ├── modules-sc-ui.R ├── modules-sc-utils.R ├── parse_pug.R ├── plot_scseq.R ├── query_utils.R ├── recover_error.R ├── run_dseqr.R ├── run_esmeta.R ├── run_kb_scseq.R ├── scseq_qc.R ├── scseq_reports.R ├── server-utils.R ├── seurat_to_sce.R ├── split_utils.R ├── sysdata.rda ├── theme_pubr.R └── ui-utils.R ├── README.md ├── data-raw ├── benchmarks │ └── rnaseq_microarray_cmap │ │ ├── 1-diff_expr.R │ │ ├── 2-salmon_vs_kallisto.R │ │ └── 3-rnaseq_vs_microarray.R ├── biogps │ └── biogps.R ├── cell_info │ ├── GSE92742_Broad_LINCS_cell_info.txt │ ├── cell_info.R │ └── cell_info.rds ├── convert │ ├── 0.10.0.R │ ├── 0.13.0.R │ ├── 0.13.3.R │ ├── 0.14.0.R │ ├── 0.14.1.R │ ├── 0.15.0.R │ ├── 0.16.0.R │ ├── 0.18.0.R │ ├── 0.23.0.R │ ├── 0.30.0.R │ └── 0.9.2.R ├── d3 │ ├── box.js │ ├── morley.css │ ├── morley.csv │ ├── morley.js │ └── simplot.js ├── drug_annot │ ├── pug_view │ │ ├── check_sider.R │ │ ├── cids.csv │ │ ├── cids.rds │ │ ├── get_cids.R │ │ ├── get_views.sh │ │ ├── pug_annot.R │ │ ├── pug_annot.rds │ │ └── sider.rds │ └── setup.R ├── drug_es │ ├── pvals.R │ ├── setup.R │ └── signatures.R ├── drug_gene_queries │ ├── drug_gene_queries.R │ └── pert_names.R ├── drug_paths │ ├── cmap_paths.R │ ├── l1000_paths.R │ └── map.rds ├── dseqr_to_cellenics.R ├── ensmap │ ├── ensmap.R │ └── ensmap.rds ├── example_data │ ├── GSE134809_samples.csv │ ├── GSE93624_annot.csv │ └── setup.R ├── genes │ ├── genes.R │ └── genes.rds ├── macspectrum │ ├── amdsg_hgnc.txt │ ├── amdsgs.rds │ ├── macspectrum.R │ ├── psg_amdsg_hgnc.txt │ ├── psg_hgnc.txt │ └── psgs.rds ├── qcgenes │ └── mrna_rrna.R ├── sysdata.R └── update_R_version_deps.R ├── dseqr.Rproj ├── inst ├── app │ ├── global.R │ ├── server.R │ ├── tests │ │ ├── testthat.R │ │ └── testthat │ │ │ ├── _snaps │ │ │ └── shinytest2.md │ │ │ ├── setup.R │ │ │ └── test-shinytest2.R │ ├── ui.R │ └── www │ │ ├── EMBL_Logo.png │ │ ├── bulk_intro.csv │ │ ├── contextMenu.js │ │ ├── custom.css │ │ ├── drugbank_logo.ico │ │ ├── drugs.css │ │ ├── drugs_intro.csv │ │ ├── favicon.png │ │ ├── genecards_logo.ico │ │ ├── gtag.html │ │ ├── gtm.html │ │ ├── isMobile.js │ │ ├── pathways.css │ │ ├── pubchem_logo.ico │ │ ├── renderSelectize.js │ │ ├── sc_intro_clusters.csv │ │ ├── sc_intro_samples.csv │ │ └── wiki_logo.svg └── extdata │ ├── mrna.csv │ ├── mrna_mouse.csv │ ├── rrna.csv │ ├── rrna_mouse.csv │ ├── slack.rds │ └── txp2hgnc.zip ├── man ├── SingleViolinIPlot.Rd ├── add_cluster_numbers.Rd ├── add_combined_metrics.Rd ├── add_doublet_score.Rd ├── add_hvgs.Rd ├── add_linkout.Rd ├── add_scseq_qc_metrics.Rd ├── add_scseq_qcplot_metrics.Rd ├── add_table_html.Rd ├── advancedOptionsInput.Rd ├── aggregate.Matrix.Rd ├── annot_query_res.Rd ├── append_annot.Rd ├── boxPlotly.Rd ├── boxPlotlyCells.Rd ├── bulkPage.Rd ├── bulkPageUI.Rd ├── calcx.Rd ├── check_bulk_changed.Rd ├── check_gras.Rd ├── check_has_scseq.Rd ├── check_is_market_matrix.Rd ├── clean_kb_scseq.Rd ├── collapse_sorted.Rd ├── construct_path_df.Rd ├── construct_pbulk_subsets.Rd ├── create_scseq.Rd ├── customQueryFormInput.Rd ├── datasets_to_list.Rd ├── detect_10x_chemistry.Rd ├── detect_cells.Rd ├── diff_abundance.Rd ├── dir_exists.Rd ├── disableAll.Rd ├── dl_pert_result.Rd ├── dl_pert_signature.Rd ├── download_kb_index.Rd ├── downsample_clusters.Rd ├── dropdownButtonMod.Rd ├── dropdownMenuButton.Rd ├── drugsFormInput.Rd ├── drugsGenesPlotlyOutput.Rd ├── drugsPage.Rd ├── drugsPageUI.Rd ├── drugsTableOutput.Rd ├── enableAll.Rd ├── evaluate_custom_metric.Rd ├── file_exists.Rd ├── filter_clinical.Rd ├── filter_nsig.Rd ├── format_dl_annot.Rd ├── format_query_res.Rd ├── format_up_annot.Rd ├── format_up_custom.Rd ├── from_crossmeta.Rd ├── getDeleteRowButtons.Rd ├── get_ambience.Rd ├── get_boxplotly_cell_args.Rd ├── get_boxplotly_gene_args.Rd ├── get_cell_choices.Rd ├── get_cluster_choices.Rd ├── get_cluster_markers.Rd ├── get_cluster_stats.Rd ├── get_contrast_choices.Rd ├── get_contrast_markers.Rd ├── get_cors_html.Rd ├── get_dist.Rd ├── get_dprimes.Rd ├── get_drug_paths.Rd ├── get_drugbank.Rd ├── get_drugs_table.Rd ├── get_expression_colors.Rd ├── get_founder.Rd ├── get_genego.Rd ├── get_gonames.Rd ├── get_group_levels.Rd ├── get_label_transfer_choices.Rd ├── get_mds.Rd ├── get_metric_choices.Rd ├── get_metric_features.Rd ├── get_nearest_row.Rd ├── get_npc_choices.Rd ├── get_open_a.Rd ├── get_palette.Rd ├── get_path_df.Rd ├── get_path_res.Rd ├── get_pred_annot.Rd ├── get_presto_markers.Rd ├── get_query_cols.Rd ├── get_resoln_name.Rd ├── get_sc_dataset_choices.Rd ├── get_species.Rd ├── get_top.Rd ├── get_top_cors.Rd ├── get_tsne_coords.Rd ├── get_violin_data.Rd ├── get_wikipedia.Rd ├── handle_sc_progress.Rd ├── html_space.Rd ├── id_from_tab.Rd ├── identify_sc_files.Rd ├── import_scseq.Rd ├── init_dseqr.Rd ├── integrate_saved_scseqs.Rd ├── integrate_scseqs.Rd ├── interpret.Rd ├── isTruthy.Rd ├── isTruthyAll.Rd ├── is_invertible.Rd ├── justifiedButtonGroup.Rd ├── keep_curr_selected.Rd ├── limit_cells.Rd ├── load_bulk_datasets.Rd ├── load_cellranger_counts.Rd ├── load_custom_anals.Rd ├── load_custom_results.Rd ├── load_drug_es.Rd ├── load_kallisto_counts.Rd ├── load_pert_anals.Rd ├── load_pert_signature.Rd ├── load_resoln.Rd ├── load_scseq_datasets.Rd ├── load_scseq_qcgenes.Rd ├── load_scseq_qs.Rd ├── load_scseq_subsets.Rd ├── make_unique.Rd ├── merge_linkouts.Rd ├── merge_samples.Rd ├── navbar2UI.Rd ├── navbarUI.Rd ├── normalize_scseq.Rd ├── plot_biogps.Rd ├── plot_dprimes.Rd ├── plot_violin.Rd ├── plotlyMDS.Rd ├── process_raw_scseq.Rd ├── qread.safe.Rd ├── query_budger.Rd ├── query_drugs.Rd ├── remove_dataset_files.Rd ├── req.Rd ├── rightClickMenu.Rd ├── run_custom_query.Rd ├── run_drug_queries.Rd ├── run_dseqr.Rd ├── run_fastmnn.Rd ├── run_harmony.Rd ├── run_integrate_saved_scseqs.Rd ├── run_kb_scseq.Rd ├── run_limma_scseq.Rd ├── run_pca.Rd ├── run_post_cluster.Rd ├── run_reduction.Rd ├── run_scseq_qc.Rd ├── save_lmfit.Rd ├── save_scseq_args.Rd ├── save_scseq_data.Rd ├── scPage.Rd ├── scPageUI.Rd ├── sc_dl_filename.Rd ├── scseq_part_path.Rd ├── selectedAnalInput.Rd ├── selectedDrugStudyInput.Rd ├── selectedPertSignatureInput.Rd ├── send_slack_error.Rd ├── sort_clusters.Rd ├── sort_query_table_clin.Rd ├── standardize_cellranger.Rd ├── subset_saved_scseq.Rd ├── summarise_query_table.Rd ├── summarize_compound.Rd ├── tabPane.Rd ├── theme_dimgray.Rd ├── theme_no_xaxis.Rd ├── theme_no_yaxis.Rd ├── theme_pubr.Rd ├── transfer_prev_annot.Rd ├── validate_custom_query.Rd ├── validate_integration.Rd ├── validate_metric.Rd ├── validate_pdata.Rd ├── validate_preds.Rd ├── validate_up_annot.Rd └── validate_up_custom.Rd ├── renv.lock ├── renv.lock.init ├── renv ├── .gitignore └── activate.R ├── setup ├── get_sysdeps_run.R ├── install_debian_packages.sh ├── run_ci_tests.R └── sysdeps_build_debian.txt └── tests ├── testthat.R └── testthat ├── setup.R ├── test_calcx.R ├── test_evaluate_custom_metric.R ├── test_import_robject.R ├── test_import_scseq.R ├── test_integrate_saved_scseqs.R ├── test_linkouts.R ├── test_matrix_utils.R ├── test_subset_saved_scseq.R ├── test_summarize_compound.R ├── test_validate_bulk_labels.R ├── test_validate_bulk_uploads.R └── test_validate_scseq_import.R /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^renv$ 2 | ^\.Rprofile$ 3 | ^.*\.Rproj$ 4 | ^\.Rproj\.user$ 5 | ^data-raw$ 6 | ^run_sjia\.R$ 7 | ^sync-aws\.sh$ 8 | ^example_data\.tar\.gz$ 9 | ^packrat/ 10 | ^renv\.lock$ 11 | ^renv\.lock\.init$ 12 | ^LICENSE\.md$ 13 | ^inst/app/tests$ 14 | ^\.renvignore$ 15 | ^\.dockerignore$ 16 | ^dseqr\.gif$ 17 | ^\.github$ 18 | _\.new\.png$ 19 | ^Dockerfile$ 20 | -------------------------------------------------------------------------------- /.Rprofile: -------------------------------------------------------------------------------- 1 | source("renv/activate.R") 2 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | /data-raw/* 2 | .git/* 3 | .Rproj.user/* 4 | renv/* 5 | example_data.tar.gz 6 | -------------------------------------------------------------------------------- /.github/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: ci 2 | on: 3 | pull_request: 4 | types: [closed, opened, synchronize, reopened] 5 | branches: 6 | - master 7 | 8 | concurrency: 9 | group: build-${{ github.event.pull_request.number || github.ref }} 10 | cancel-in-progress: true 11 | 12 | env: 13 | DOCKERHUB_REPO: alexvpickering/dseqr 14 | 15 | jobs: 16 | build-test-push: 17 | runs-on: ubuntu-latest 18 | steps: 19 | - name: Checkout 20 | uses: actions/checkout@v2 21 | 22 | - name: Set up Docker Buildx 23 | id: buildx 24 | uses: docker/setup-buildx-action@v2 25 | 26 | - name: Login to DockerHub 27 | uses: docker/login-action@v2 28 | with: 29 | username: ${{ secrets.DOCKERHUB_USERNAME }} 30 | password: ${{ secrets.DOCKERHUB_TOKEN }} 31 | 32 | - name: Build Docker image 33 | uses: docker/build-push-action@v3 34 | with: 35 | context: . 36 | target: testing 37 | load: true 38 | cache-from: type=registry,ref=${{ env.DOCKERHUB_REPO }}:buildcache 39 | tags: ${{ env.DOCKERHUB_REPO }}:testing 40 | 41 | # push cache that includes production and testing 42 | - name: Push buildcache to DockerHub 43 | uses: docker/build-push-action@v2 44 | with: 45 | context: . 46 | cache-to: type=registry,ref=${{ env.DOCKERHUB_REPO }}:buildcache,mode=max 47 | 48 | - name: Test pull request 49 | if: github.event.pull_request.merged == false 50 | run: | 51 | docker run --rm ${{ env.DOCKERHUB_REPO }}:testing 52 | 53 | - name: Push production to DockerHub on merge 54 | uses: docker/build-push-action@v2 55 | if: github.event.pull_request.merged == true 56 | with: 57 | context: . 58 | target: production 59 | push: true 60 | tags: ${{ env.DOCKERHUB_REPO }}:latest 61 | 62 | 63 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | 4 | data-raw/drug_annot/repurposing_*.txt 5 | data-raw/biogps/biogps.rds 6 | data-raw/drug_gene_queries/pert_names*\.rds 7 | data-raw/cellranger_example 8 | 9 | # personal files 10 | sync-aws.sh 11 | run_sjia.R 12 | filter.txt 13 | user_data.sh 14 | example_data.tar.gz 15 | cmap_analysis.R 16 | 17 | dseqr.gif 18 | 19 | # shinytest2 generated data 20 | inst/app/tests/testthat/test_data_dir/* 21 | inst/app/tests/testthat/mock_10x/* 22 | inst/app/Rplots.pdf 23 | 24 | testthat-problems.rds 25 | # {shinytest2}: Ignore new debug snapshots for `$expect_values()` 26 | *_.new.png 27 | -------------------------------------------------------------------------------- /.renvignore: -------------------------------------------------------------------------------- 1 | data-raw/ 2 | tests/ 3 | example_data.tar.gz 4 | .git/ 5 | -------------------------------------------------------------------------------- /CITATION.cff: -------------------------------------------------------------------------------- 1 | cff-version: 1.2.0 2 | message: "If you use this software, please cite it as below." 3 | authors: 4 | - family-names: "Pickering" 5 | given-names: "Alex" 6 | orcid: "https://orcid.org/0000-0002-0002-6759" 7 | title: "dseqr" 8 | version: 0.35.0 9 | date-released: 2023-01-18 10 | url: "https://github.com/hms-dbmi/dseqr" 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2021 2 | COPYRIGHT HOLDER: dseqr authors 3 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (c) 2021 dseqr authors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | S3method(aggregate,Matrix) 4 | S3method(cbind,safe) 5 | S3method(pretty,unique) 6 | S3method(toString,data.frame) 7 | export(add_cluster_numbers) 8 | export(bulkPage) 9 | export(bulkPageUI) 10 | export(check_has_scseq) 11 | export(clean_kb_scseq) 12 | export(dir_exists) 13 | export(download_kb_index) 14 | export(drugsPage) 15 | export(drugsPageUI) 16 | export(file_exists) 17 | export(from_crossmeta) 18 | export(getDeleteRowButtons) 19 | export(get_expression_colors) 20 | export(get_palette) 21 | export(get_presto_markers) 22 | export(get_species) 23 | export(init_dseqr) 24 | export(isTruthy) 25 | export(load_scseq_qs) 26 | export(make_unique) 27 | export(navbar2UI) 28 | export(navbarUI) 29 | export(qread.safe) 30 | export(req) 31 | export(run_dseqr) 32 | export(run_kb_scseq) 33 | export(scPage) 34 | export(scPageUI) 35 | export(send_slack_error) 36 | export(theme_dimgray) 37 | export(theme_no_xaxis) 38 | export(theme_no_yaxis) 39 | import(celldex) 40 | import(rintrojs) 41 | import(shiny) 42 | importFrom(TSP,TSP) 43 | importFrom(TSP,solve_TSP) 44 | importFrom(magrittr,"%>%") 45 | importFrom(presto,wilcoxauc) 46 | importFrom(rlang,"%||%") 47 | importFrom(rlang,":=") 48 | importFrom(rlang,.data) 49 | importFrom(shinyjs,addClass) 50 | importFrom(shinyjs,hidden) 51 | importFrom(shinyjs,html) 52 | importFrom(shinyjs,removeClass) 53 | importFrom(shinyjs,runjs) 54 | importFrom(shinyjs,toggle) 55 | importFrom(shinyjs,toggleClass) 56 | importFrom(shinyjs,toggleState) 57 | -------------------------------------------------------------------------------- /R/NNTransform.R: -------------------------------------------------------------------------------- 1 | # from Azimuth 2 | NNTransform <- function(object, meta.data, neighbor.slot = "query_ref.nn", key = "ori.index") { 3 | on.exit(expr = gc(verbose = FALSE)) 4 | ind <- Seurat::Indices(object[[neighbor.slot]]) 5 | ori.index <- t(x = sapply(X = seq_len(nrow(ind)), FUN = function(i) { 6 | return(meta.data[ind[i, ], key]) 7 | })) 8 | rownames(x = ori.index) <- rownames(x = ind) 9 | methods::slot(object = object[[neighbor.slot]], name = "nn.idx") <- ori.index 10 | return(object) 11 | } 12 | -------------------------------------------------------------------------------- /R/from_crossmeta.R: -------------------------------------------------------------------------------- 1 | #' Covert from crossmeta to dseqr formats 2 | #' 3 | #' Convert a microarray ExpressionSet saved with 'crossmeta' into a format 4 | #' for direct usage in 'dseqr'. 5 | #' 6 | #' @param data_dir directory that contains \code{gse_name} folder 7 | #' @param gse_name Name of GSE accession dataset, must be folder in data_dir 8 | #' 9 | #' @export 10 | #' @examples 11 | #' library(Biobase) 12 | #' 13 | #' # generate example eset 14 | #' sd <- 0.3*sqrt(4/rchisq(1000,df=4)) 15 | #' y <- matrix(rnorm(1000*6,sd=sd),1000,6) 16 | #' rownames(y) <- paste("Gene",1:1000) 17 | #' y[1:2,4:6] <- y[1:2,4:6] + 2 18 | #' 19 | #' y[100:200, c(1,2,6)] <- y[100:200, c(1,2,6)] + 0.5 20 | #' 21 | #' pdata <- data.frame(group = c(rep('healthy', 3), rep('disease', 3))) 22 | #' fdata <- data.frame(SYMBOL = row.names(y), 23 | #' PROBE = row.names(y), 24 | #' row.names = row.names(y)) 25 | #' 26 | #' eset <- ExpressionSet(y, 27 | #' phenoData = as(pdata, 'AnnotatedDataFrame'), 28 | #' featureData = as(fdata, 'AnnotatedDataFrame')) 29 | #' 30 | #' 31 | #' # save 32 | #' eset <- list(GSE1=eset) 33 | #' data_dir <- tempdir() 34 | #' gse_dir <- file.path(data_dir, 'GSE1') 35 | #' dir.create(gse_dir) 36 | #' saveRDS(eset, file.path(gse_dir, 'GSE1_eset.rds')) 37 | #' 38 | #' from_crossmeta('GSE1', data_dir) 39 | #' 40 | from_crossmeta <- function(gse_name, data_dir) { 41 | 42 | # change saved eset name to eset.rds 43 | dataset_dir <- file.path(data_dir, gse_name) 44 | eset_path <- list.files(dataset_dir, '^.+?_eset.rds', full.names = TRUE) 45 | eset <- readRDS(eset_path)[[1]] 46 | qs::qsave(eset, file.path(dataset_dir, 'eset.qs')) 47 | } 48 | -------------------------------------------------------------------------------- /R/scseq_reports.R: -------------------------------------------------------------------------------- 1 | #' Remove ggplot xaxis title, text, and ticks 2 | #' 3 | #' @return ggplot2 \code{theme} object 4 | #' @export 5 | #' @examples 6 | #' 7 | #' library(ggplot2) 8 | #' ggplot(mtcars, aes(wt, mpg)) + geom_point() + theme_no_xaxis() 9 | #' 10 | theme_no_xaxis <- function() { 11 | ggplot2::theme(axis.title.x = ggplot2::element_blank(), 12 | axis.text.x = ggplot2::element_blank(), 13 | axis.ticks.x = ggplot2::element_blank()) 14 | } 15 | 16 | #' Remove ggplot yaxis title, text, and ticks 17 | #' 18 | #' @return ggplot2 \code{theme} object 19 | #' @export 20 | #' @examples 21 | #' 22 | #' library(ggplot2) 23 | #' ggplot(mtcars, aes(wt, mpg)) + geom_point() + theme_no_yaxis() 24 | #' 25 | theme_no_yaxis <- function() { 26 | ggplot2::theme(axis.title.y = ggplot2::element_blank(), 27 | axis.text.y = ggplot2::element_blank(), 28 | axis.ticks.y = ggplot2::element_blank()) 29 | } 30 | 31 | #' Make ggplot axes and text dimgray 32 | #' 33 | #' @param with_nums Include axis ticks/text? Default is TRUE. 34 | #' 35 | #' @return ggplot2 \code{theme} object 36 | #' @export 37 | #' @examples 38 | #' 39 | #' library(ggplot2) 40 | #' ggplot(mtcars, aes(wt, mpg)) + geom_point() + theme_dimgray() 41 | #' 42 | theme_dimgray <- function(with_nums = TRUE) { 43 | 44 | axis.line <- ggplot2::element_line(size = 0.1, color = 'dimgray') 45 | 46 | if (with_nums) { 47 | axis.text <- ggplot2::element_text(colour = 'dimgray') 48 | axis.ticks <- ggplot2::element_line(size = 0.1, color = 'dimgray') 49 | 50 | } else { 51 | axis.text <- axis.ticks <- ggplot2::element_blank() 52 | 53 | } 54 | 55 | ggplot2::theme(axis.line.y = axis.line, 56 | axis.line.x = axis.line, 57 | axis.ticks.x = axis.ticks, 58 | axis.ticks.y = axis.ticks, 59 | axis.text = axis.text, 60 | axis.title = ggplot2::element_text(colour = 'dimgray'), 61 | text = ggplot2::element_text(colour = 'dimgray')) 62 | } 63 | -------------------------------------------------------------------------------- /R/server-utils.R: -------------------------------------------------------------------------------- 1 | #' Read qs file safely 2 | #' 3 | #' @inheritParams qs::qread 4 | #' @param .nofile return value when file doesn't exist 5 | #' @param .nullfile return value when file value is \code{NULL} 6 | #' 7 | #' @inherit qs::qread return 8 | #' 9 | #' @export 10 | #' 11 | qread.safe <- function(file, .nofile = NULL, .nullfile = NULL) { 12 | res <- .nofile 13 | if (isTruthy(file) && file_exists(file)) 14 | res <- tryCatch(qs::qread(file), error = function(e) NULL) 15 | 16 | if (is.null(res)) return(.nullfile) 17 | return(res) 18 | } 19 | 20 | 21 | #' Disable multiple ids 22 | #' 23 | #' @param ids Character vector of ids to disable 24 | #' @return called for side effects 25 | #' 26 | #' @keywords internal 27 | disableAll <- function(ids, asis = rep(FALSE, length(ids))){ 28 | for (i in seq_along(ids)) shinyjs::disable(ids[i], asis = asis[i]) 29 | shinyjs::runjs("$(\".tooltip\").tooltip(\"hide\");") 30 | } 31 | 32 | 33 | #' Enable multiple ids 34 | #' 35 | #' @param ids Character vector of ids to enable 36 | #' 37 | #' @return No return value. Called for side effects. 38 | #' @keywords internal 39 | enableAll <- function(ids, asis = rep(FALSE, length(ids))) { 40 | for (i in seq_along(ids)) shinyjs::enable(ids[i], asis = asis[i]) 41 | } 42 | 43 | #' Check truthiness of multiple objects 44 | #' 45 | #' @param ... objects to check truthiness of 46 | #' 47 | #' @keywords internal 48 | isTruthyAll <- function(...) { 49 | x <- list(...) 50 | for (xi in x) if (!isTruthy(xi)) return(FALSE) 51 | return(TRUE) 52 | } 53 | -------------------------------------------------------------------------------- /R/split_utils.R: -------------------------------------------------------------------------------- 1 | split_mtx <- function(mtx, samples) { 2 | 3 | mtxs <- list() 4 | for (sample in unique(samples)) { 5 | is.sample <- samples == sample 6 | mtxs[[sample]] <- mtx[, is.sample] 7 | } 8 | 9 | return(mtxs) 10 | } 11 | 12 | 13 | save_split_mtxs <- function(mtxs, features, data_dir) { 14 | colnames(features)[c(1, 2)] <- c('enid', 'symbol') 15 | fnames <- c('barcodes.tsv.gz', 'features.tsv.gz', 'matrix.mtx.gz') 16 | 17 | unique.genes <- make_unique(features$symbol) 18 | 19 | out_dir <- file.path(data_dir, 'split') 20 | dir.create(out_dir) 21 | 22 | for (i in seq_along(mtxs)) { 23 | samplei <- names(mtxs)[i] 24 | mtxi <- mtxs[[i]] 25 | 26 | if (!identical(unique.genes, row.names(mtxi))) 27 | stop('Gene names not same') 28 | 29 | sample_dir <- file.path(out_dir, samplei) 30 | 31 | DropletUtils::write10xCounts(sample_dir, 32 | mtxi, 33 | gene.id = features$enid, 34 | gene.symbol = features$symbol, 35 | version = '3') 36 | file.rename(file.path(sample_dir, fnames), 37 | file.path(out_dir, paste0(samplei, '_', fnames))) 38 | 39 | unlink(sample_dir, recursive = TRUE) 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /R/sysdata.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/dseqr/fcfc43b8087263591a94e699250bd444cc508708/R/sysdata.rda -------------------------------------------------------------------------------- /data-raw/biogps/biogps.R: -------------------------------------------------------------------------------- 1 | # This script annotates the BioGPS Human U133A Gene Atlas for use by explore_scseq_clusters 2 | # the BioGPS data was downloaded from http://plugins.biogps.org/download/gnf1h-gcrma.zip 3 | 4 | library(data.table) 5 | library(crossmeta) 6 | 7 | # load BioGPS Human U133A Gene Atlas 8 | atlas <- fread('data-raw/biogps/U133AGNF1B.gcrma.avg.csv') 9 | colnames(atlas)[1] <- 'PROBE' 10 | 11 | # annotate to SYMBOL from U133A platform ---- 12 | 13 | # annotation for U133A 14 | gse_name <- 'GSE1133' 15 | data_dir <- 'data-raw/single-cell/example-anals' 16 | eset <- load_raw(gse_name, data_dir)[[1]] 17 | fdat <- fData(eset)[, c('PROBE', 'ENTREZID', 'SYMBOL')] 18 | 19 | # join with atlas 20 | table(fdat$PROBE %in% atlas$PROBE) 21 | atlas <- atlas[PROBE %in% fdat$PROBE] 22 | atlas <- atlas[fdat, on = 'PROBE'] 23 | 24 | # use max IQR to resolve duplicates by symbol 25 | expr <- atlas[, -c('SYMBOL', 'ENTREZID', 'PROBE')] 26 | fdat <- AnnotatedDataFrame(atlas[, .(SYMBOL, ENTREZID, PROBE)]) 27 | eset <- ExpressionSet(as.matrix(expr), featureData = fdat) 28 | 29 | max_iqr <- crossmeta:::which_max_iqr(eset, 'SYMBOL') 30 | atlas <- atlas[max_iqr, -'PROBE'] 31 | 32 | # used SYMBOL for key column 33 | setkey(atlas, SYMBOL) 34 | 35 | # save expression values 36 | saveRDS(atlas, 'data-raw/biogps/biogps.rds') 37 | -------------------------------------------------------------------------------- /data-raw/cell_info/cell_info.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/dseqr/fcfc43b8087263591a94e699250bd444cc508708/data-raw/cell_info/cell_info.rds -------------------------------------------------------------------------------- /data-raw/convert/0.10.0.R: -------------------------------------------------------------------------------- 1 | # this script moves everything from rds to qs 2 | # it is necessary to transition data created prior to version 0.10.0 3 | 4 | # fill in path to app data 5 | app_dir <- "" 6 | 7 | # get all .rds files 8 | rds_files <- list.files(app_dir, '.rds$', full.names = TRUE, recursive = TRUE) 9 | 10 | for (rds_file in rds_files) { 11 | item <- readRDS(rds_file) 12 | qs_file <- gsub('.rds$', '.qs', rds_file) 13 | qs::qsave(item, qs_file) 14 | unlink(rds_file) 15 | } 16 | -------------------------------------------------------------------------------- /data-raw/convert/0.13.3.R: -------------------------------------------------------------------------------- 1 | # remove hardcoded is_test and is_ctrl 2 | 3 | app_dir <- "/home/alex/patient_data/sjia" 4 | app_dirs <- list.files('/srv/dseqr') 5 | app_dirs <- setdiff(app_dirs, 6 | c('indices', 'node_modules', 'pert_signature_dir', 7 | 'pert_query_dir', 'example_data.tar.gz')) 8 | 9 | convert <- function(app_dir) { 10 | cat('==== Working on', app_dir, '====\n') 11 | 12 | sc_dir <- file.path(app_dir, 'single-cell') 13 | 14 | integrated <- dseqr:::qread.safe(file.path(sc_dir, 'integrated.qs')) 15 | if (!length(integrated)) next() 16 | 17 | dataset_dirs <- file.path(sc_dir, integrated) 18 | 19 | for (i in seq_along(dataset_dirs)) { 20 | dataset_name <- integrated[i] 21 | dataset_dir <- dataset_dirs[i] 22 | cat('working on', integrated[i], '...\n') 23 | scseq_path <- file.path(dataset_dir, 'scseq.qs') 24 | 25 | if (!file.exists(scseq_path)) next() 26 | 27 | combined <- qs::qread(scseq_path) 28 | 29 | # remove 'is_test' and 'is_ctrl' 30 | combined$is_test <- combined$is_ctrl <- NULL 31 | 32 | # overwrite qs 33 | qs::qsave(combined, scseq_path, preset = 'fast') 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /data-raw/convert/0.14.0.R: -------------------------------------------------------------------------------- 1 | library(SingleCellExperiment) 2 | 3 | app_dir <- "/home/alex/patient_data/example" 4 | app_dirs <- list.files('/srv/dseqr') 5 | app_dirs <- setdiff(app_dirs, 6 | c('indices', 'node_modules', 'pert_signature_dir', 7 | 'pert_query_dir', 'example_data.tar.gz')) 8 | 9 | convert <- function(app_dir) { 10 | cat('==== Working on', app_dir, '====\n') 11 | 12 | sc_dir <- file.path(app_dir, 'single-cell') 13 | 14 | dataset_names <- list.files(sc_dir) 15 | dataset_dirs <- file.path(sc_dir, dataset_names) 16 | 17 | for (i in seq_along(dataset_dirs)) { 18 | dataset_name <- dataset_names[i] 19 | dataset_dir <- dataset_dirs[i] 20 | cat('working on', dataset_names[i], '...\n') 21 | 22 | scseq_path <- file.path(dataset_dir, 'scseq.qs') 23 | 24 | if (!file.exists(scseq_path)) next() 25 | scseq <- qs::qread(scseq_path) 26 | 27 | # save as seperate parts 28 | dseqr:::split_save_scseq(scseq, dataset_dir) 29 | 30 | # delete previous 31 | unlink(scseq_path) 32 | remove <- list.files(dataset_dir, 33 | '^lm_fit|^top_tables|^cluster_stats|plots|ambient.qs|^l1000_|^cmap_|^kegg|^go', 34 | recursive = TRUE, full.names = TRUE, include.dirs = TRUE) 35 | unlink(remove, recursive = TRUE) 36 | 37 | } 38 | } 39 | 40 | for (app_dir in app_dirs) convert(app_dir) 41 | -------------------------------------------------------------------------------- /data-raw/convert/0.14.1.R: -------------------------------------------------------------------------------- 1 | library(SingleCellExperiment) 2 | 3 | app_dir <- "/home/alex/patient_data/sjia" 4 | app_dirs <- list.files('/srv/dseqr') 5 | app_dirs <- setdiff(app_dirs, 6 | c('indices', 'node_modules', 'pert_signature_dir', 7 | 'pert_query_dir', 'example_data.tar.gz')) 8 | 9 | convert <- function(app_dir) { 10 | cat('==== Working on', app_dir, '====\n') 11 | 12 | sc_dir <- file.path(app_dir, 'single-cell') 13 | 14 | dataset_names <- list.files(sc_dir) 15 | dataset_dirs <- file.path(sc_dir, dataset_names) 16 | 17 | for (i in seq_along(dataset_dirs)) { 18 | dataset_name <- dataset_names[i] 19 | dataset_dir <- dataset_dirs[i] 20 | cat('working on', dataset_names[i], '...\n') 21 | 22 | scseq_path <- file.path(dataset_dir, 'shell.qs') 23 | logs_path <- file.path(dataset_dir, 'dgclogs.qs') 24 | 25 | if (!file.exists(scseq_path)) next() 26 | scseq <- qs::qread(scseq_path) 27 | logcounts(scseq) <- qs::qread(logs_path) 28 | decs <- scran::modelGeneVar(scseq, block=scseq$batch) 29 | SummarizedExperiment::rowData(scseq)$bio <- decs$bio 30 | 31 | logcounts(scseq) <- NULL 32 | 33 | # orig.ident (test/ctrl) can be updated 34 | scseq$orig.ident <- scseq$orig.cluster <- scseq$orig.resoln <- NULL 35 | 36 | qs::qsave(scseq, scseq_path, preset = 'fast') 37 | } 38 | } 39 | 40 | for (app_dir in app_dirs) convert(app_dir) 41 | -------------------------------------------------------------------------------- /data-raw/convert/0.16.0.R: -------------------------------------------------------------------------------- 1 | # create HDF5Array TENxMatrix for fast 2 | library(SingleCellExperiment) 3 | 4 | app_dir <- '/home/alex/patient_data/example' 5 | app_dirs <- list.files('/srv/dseqr') 6 | app_dirs <- setdiff(app_dirs, 7 | c('indices', 'node_modules', 'pert_signature_dir', 8 | 'pert_query_dir', 'gs_dir', 'example_data.tar.gz', 'tx2gene')) 9 | 10 | 11 | convert <- function(app_dir) { 12 | cat('==== Working on', app_dir, '====\n') 13 | 14 | sc_dir <- file.path(app_dir, 'single-cell') 15 | 16 | dataset_names <- list.files(sc_dir) 17 | dataset_dirs <- file.path(sc_dir, dataset_names) 18 | 19 | for (i in seq_along(dataset_dirs)) { 20 | dataset_name <- dataset_names[i] 21 | dataset_dir <- dataset_dirs[i] 22 | cat('working on', dataset_names[i], '...\n') 23 | 24 | dgclogs_path <- file.path(dataset_dir, 'dgclogs.qs') 25 | dgrlogs_path <- file.path(dataset_dir, 'dgrlogs.qs') 26 | if (!file.exists(dgclogs_path)) next() 27 | if (!file.exists(dgrlogs_path)) next() 28 | 29 | logs <- qs::qread(dgclogs_path) 30 | tlogs <- Matrix::t(logs) 31 | 32 | tlogs_path <- file.path(dataset_dir, 'tlogs.tenx') 33 | HDF5Array::writeTENxMatrix(tlogs, tlogs_path, group = 'mm10') 34 | unlink(dgrlogs_path) 35 | } 36 | } 37 | 38 | for (app_dir in app_dirs) convert(app_dir) 39 | -------------------------------------------------------------------------------- /data-raw/convert/0.18.0.R: -------------------------------------------------------------------------------- 1 | # add species.qs for individual datasets 2 | library(SingleCellExperiment) 3 | 4 | app_dirs <- list.files('/srv/dseqr') 5 | app_dirs <- setdiff(app_dirs, 6 | c('indices', 'node_modules', 'pert_signature_dir', 7 | 'pert_query_dir', 'gs_dir', 'example_data.tar.gz', 'tx2gene')) 8 | 9 | 10 | convert <- function(app_dir) { 11 | cat('==== Working on', app_dir, '====\n') 12 | 13 | sc_dir <- file.path(app_dir, 'single-cell') 14 | 15 | dataset_names <- list.files(sc_dir) 16 | dataset_dirs <- file.path(sc_dir, dataset_names) 17 | 18 | for (i in seq_along(dataset_dirs)) { 19 | dataset_name <- dataset_names[i] 20 | dataset_dir <- dataset_dirs[i] 21 | cat('working on', dataset_names[i], '...\n') 22 | 23 | species_path <- file.path(dataset_dir, 'species.qs') 24 | if (file.exists(species_path)) next() 25 | 26 | shell_path <- file.path(dataset_dir, 'shell.qs') 27 | if (!file.exists(shell_path)) next() 28 | 29 | scseq <- qs::qread(shell_path) 30 | 31 | species <- scseq@metadata$species 32 | qs::qsave(species, species_path) 33 | } 34 | } 35 | 36 | for (app_dir in app_dirs) convert(app_dir) 37 | -------------------------------------------------------------------------------- /data-raw/convert/0.23.0.R: -------------------------------------------------------------------------------- 1 | # azimuth_ref.qs to ref_name.qs 2 | # remove sample metrics from cdata 3 | 4 | data_dir <- '/srv/dseqr' 5 | app_dirs <- list.files(data_dir) 6 | app_dirs <- setdiff(app_dirs, 7 | c('indices', 'node_modules', 'pert_signature_dir', 8 | 'pert_query_dir', 'gs_dir', 'example_data.tar.gz', 'tx2gene')) 9 | 10 | 11 | convert <- function(data_dir, app_dir) { 12 | cat('==== Working on', app_dir, '====\n') 13 | 14 | sc_dir <- file.path(data_dir, app_dir, 'single-cell') 15 | 16 | dataset_names <- list.files(sc_dir) 17 | dataset_dirs <- file.path(sc_dir, dataset_names) 18 | 19 | for (i in seq_along(dataset_dirs)) { 20 | dataset_name <- dataset_names[i] 21 | dataset_dir <- dataset_dirs[i] 22 | cat('working on', dataset_names[i], '...\n') 23 | 24 | # remove sample columns from metrics 25 | shell_path <- file.path(dataset_dir, 'shell.qs') 26 | if (!file.exists(shell_path)) next() 27 | shell <- qs::qread(shell_path) 28 | 29 | samples <- unique(shell$batch) 30 | if (length(samples) > 1) { 31 | shell@colData <- shell@colData[, !colnames(shell@colData) %in% samples] 32 | qs::qsave(shell, shell_path) 33 | } 34 | 35 | # azimuth_ref to ref_name 36 | azimuth_path <- file.path(dataset_dir, 'azimuth_ref.qs') 37 | if (!file.exists(azimuth_path)) next() 38 | 39 | ref_name <- qs::qread(azimuth_path) 40 | ref_path <- file.path(dataset_dir, 'ref_name.qs') 41 | qs::qsave(ref_name, ref_path) 42 | unlink(azimuth_path) 43 | } 44 | } 45 | 46 | for (app_dir in app_dirs) convert(data_dir, app_dir) 47 | -------------------------------------------------------------------------------- /data-raw/convert/0.30.0.R: -------------------------------------------------------------------------------- 1 | # add default project dirs 2 | # remove sample metrics from cdata 3 | 4 | data_dir <- '/srv/dseqr' 5 | app_dirs <- list.files(data_dir) 6 | app_dirs <- setdiff(app_dirs, 7 | c('indices', 'node_modules', 'pert_signature_dir', 'tmp', 8 | 'pert_query_dir', 'gs_dir', 'example_data.tar.gz', 'tx2gene')) 9 | 10 | 11 | for (app_dir in app_dirs) { 12 | # get dirs 13 | move_dirs <- list.files(file.path(data_dir, app_dir)) 14 | 15 | # make default 16 | default_dir <- file.path(data_dir, app_dir, 'default') 17 | if (dir.exists(default_dir)) next() 18 | dir.create(default_dir) 19 | 20 | file.rename(from = file.path(data_dir, app_dir, move_dirs), 21 | to = file.path(default_dir, move_dirs)) 22 | } 23 | -------------------------------------------------------------------------------- /data-raw/d3/morley.css: -------------------------------------------------------------------------------- 1 | .box { 2 | font: 10px sans-serif; 3 | } 4 | 5 | .box line, 6 | .box rect, 7 | .box circle { 8 | stroke-width: 1.5px; 9 | } 10 | 11 | .box .center { 12 | stroke-dasharray: 3,3; 13 | } 14 | 15 | .box .outlier { 16 | fill: none; 17 | stroke: #ccc; 18 | } 19 | -------------------------------------------------------------------------------- /data-raw/d3/morley.csv: -------------------------------------------------------------------------------- 1 | Expt,Run,Speed 2 | 1,1,850 3 | 1,2,740 4 | 1,3,900 5 | 1,4,1070 6 | 1,5,930 7 | 1,6,850 8 | 1,7,950 9 | 1,8,980 10 | 1,9,980 11 | 1,10,880 12 | 1,11,1000 13 | 1,12,980 14 | 1,13,930 15 | 1,14,650 16 | 1,15,760 17 | 1,16,810 18 | 1,17,1000 19 | 1,18,1000 20 | 1,19,960 21 | 1,20,960 22 | 2,1,960 23 | 2,2,940 24 | 2,3,960 25 | 2,4,940 26 | 2,5,880 27 | 2,6,800 28 | 2,7,850 29 | 2,8,880 30 | 2,9,900 31 | 2,10,840 32 | 2,11,830 33 | 2,12,790 34 | 2,13,810 35 | 2,14,880 36 | 2,15,880 37 | 2,16,830 38 | 2,17,800 39 | 2,18,790 40 | 2,19,760 41 | 2,20,800 42 | 3,1,880 43 | 3,2,880 44 | 3,3,880 45 | 3,4,860 46 | 3,5,720 47 | 3,6,720 48 | 3,7,620 49 | 3,8,860 50 | 3,9,970 51 | 3,10,950 52 | 3,11,880 53 | 3,12,910 54 | 3,13,850 55 | 3,14,870 56 | 3,15,840 57 | 3,16,840 58 | 3,17,850 59 | 3,18,840 60 | 3,19,840 61 | 3,20,840 62 | 4,1,890 63 | 4,2,810 64 | 4,3,810 65 | 4,4,820 66 | 4,5,800 67 | 4,6,770 68 | 4,7,760 69 | 4,8,740 70 | 4,9,750 71 | 4,10,760 72 | 4,11,910 73 | 4,12,920 74 | 4,13,890 75 | 4,14,860 76 | 4,15,880 77 | 4,16,720 78 | 4,17,840 79 | 4,18,850 80 | 4,19,850 81 | 4,20,780 82 | -------------------------------------------------------------------------------- /data-raw/d3/simplot.js: -------------------------------------------------------------------------------- 1 | // !preview r2d3 data=c(0.3) 2 | // 3 | // r2d3: https://rstudio.github.io/r2d3 4 | // 5 | 6 | const radius = 5; 7 | const margin = radius + 10; 8 | 9 | var height = 50; 10 | const rowIndex = 0; 11 | 12 | const xScale = d3.scaleLinear(); 13 | xScale.domain([-1, 1]).range([0, 200]); 14 | 15 | console.log(xScale) 16 | 17 | svg.append('line') 18 | .attr("x1", xScale(0)) 19 | .attr("x2", xScale(0)) 20 | .attr("y1", -height * rowIndex) // makes match up across rows 21 | .attr("y2", height) 22 | .style("stroke", "#ddd") 23 | .style("shape-rendering", "crispEdges") 24 | .style("stroke-width", "1px") 25 | .style("stroke-dasharray", "3,3") 26 | 27 | 28 | // data text 29 | svg 30 | .append("g") 31 | .append("text") 32 | .attr("x", xScale(data)) 33 | .attr("y", height) 34 | .attr("class", "x text") 35 | .attr("dy", -2) 36 | .style("fill", "#888") 37 | .style("font", "11px Arial, sans-serif") 38 | .style("text-anchor", "middle") 39 | .text(data); 40 | 41 | 42 | // draw circles 43 | svg 44 | .append("g") 45 | .append("circle") 46 | .attr("cx", xScale(data)) 47 | .attr("cy", height / 2) 48 | .attr("r", radius) 49 | .style("fill", "transparent") 50 | .style("stroke-width", "1.1px") 51 | .style("stroke", "rgba(0, 0, 0, 0.75)") 52 | 53 | -------------------------------------------------------------------------------- /data-raw/drug_annot/pug_view/check_sider.R: -------------------------------------------------------------------------------- 1 | setwd("~/Documents/Batcave/zaklab/dseqr/data-raw/drug_annot/pug_view") 2 | 3 | check_sider <- function(cid) { 4 | url <- paste0('http://sideeffects.embl.de/drugs/', cid, '/') 5 | is_url <- RCurl::url.exists(url) 6 | return(is_url) 7 | } 8 | 9 | cids <- read.table('cids.csv', stringsAsFactors = FALSE)$V1 10 | 11 | sider <- rep(FALSE, length(cids)) 12 | names(sider) <- cids 13 | 14 | for (i in 1:length(cids)) { 15 | cid <- cids[i] 16 | sider[cid] <- check_sider(cid) 17 | 18 | if (i %% 100 == 0 | i == length(cids)) { 19 | cat('Working on', i, 'of', length(cids), '\n') 20 | saveRDS(sider, 'sider.rds') 21 | } 22 | } 23 | 24 | sum(sider) 25 | # 465 26 | -------------------------------------------------------------------------------- /data-raw/drug_annot/pug_view/cids.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/dseqr/fcfc43b8087263591a94e699250bd444cc508708/data-raw/drug_annot/pug_view/cids.rds -------------------------------------------------------------------------------- /data-raw/drug_annot/pug_view/get_cids.R: -------------------------------------------------------------------------------- 1 | # get unique compound ids for 2-get_views.sh 2 | setwd("~/Documents/Batcave/zaklab/dseqr/data-raw/drug_annot/pug_view") 3 | 4 | cmap_pdata <- readRDS(system.file('extdata', 'CMAP02_pdata.rds', package = 'dseqr')) 5 | l1000_pdata <- readRDS(system.file('extdata', 'L1000_pdata.rds', package = 'dseqr')) 6 | 7 | cids <- c(cmap_pdata$`Pubchem CID`, l1000_pdata$`Pubchem CID`) 8 | names(cids) <- c(cmap_pdata$title, l1000_pdata$title) 9 | names(cids) <- gsub('^([^_]+)_.+?$', '\\1', names(cids)) 10 | cids <- cids[!duplicated(cids) & !is.na(cids) & cids != '-666'] 11 | 12 | write.table(cids, 'cids.csv', row.names = FALSE, col.names = FALSE, quote = FALSE) 13 | saveRDS(cids, 'cids.rds') 14 | -------------------------------------------------------------------------------- /data-raw/drug_annot/pug_view/get_views.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cids=`cat cids.csv` 4 | cidstot=`echo "$cids" | wc -w` 5 | 6 | echo "have $cidstot cids" 7 | 8 | cidnum=0 9 | 10 | for cid in $cids 11 | do 12 | # download if doesn't exist 13 | outf="views/$cid.json" 14 | if [ ! -f $outf ] 15 | then 16 | curl -s https://pubchem.ncbi.nlm.nih.gov/rest/pug_view/data/compound/$cid/JSON/ > views/$cid.json 17 | else 18 | ((cidnum++)) 19 | echo "Finished $cid ($cidnum of $cidstot)" 20 | continue 21 | fi 22 | 23 | ((cidnum++)) 24 | echo "Finished $cid ($cidnum of $cidstot)" 25 | 26 | # wait 0.2 seconds so that only 5 per second 27 | sleep 0.2 28 | done 29 | -------------------------------------------------------------------------------- /data-raw/drug_annot/pug_view/pug_annot.R: -------------------------------------------------------------------------------- 1 | library(dseqr) 2 | setwd("~/Documents/Batcave/zaklab/dseqr/data-raw/drug_annot/pug_view") 3 | 4 | cids <- readRDS('cids.rds') 5 | 6 | pug_annot <- tibble::tibble(pubchem_cid = cids, pert_iname = names(cids), drugbank = NA_character_, wikipedia = NA_character_, gras = FALSE) 7 | 8 | for (i in 1:length(cids)) { 9 | cat('Working on', i, 'of', length(cids), '\n') 10 | cid <- cids[i] 11 | 12 | # load pug view 13 | pug_file <- file.path('views', paste0(cid, '.json')) 14 | if (!file.exists(pug_file)) next() 15 | pug_view <- rjson::fromJSON(file=pug_file) 16 | 17 | pug_annot[i, 'drugbank'] <- get_drugbank(pug_view) 18 | pug_annot[i, 'gras'] <- check_gras(pug_view) 19 | pug_annot[i, 'wikipedia'] <- get_wikipedia(pug_view) 20 | } 21 | 22 | sum(!is.na(pug_annot$drugbank)) 23 | # 1230 24 | 25 | sum(pug_annot$gras) 26 | # 7 27 | 28 | sum(!is.na(pug_annot$wikipedia)) 29 | # 1693 30 | 31 | saveRDS(pug_annot, 'pug_annot.rds') 32 | -------------------------------------------------------------------------------- /data-raw/drug_annot/pug_view/pug_annot.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/dseqr/fcfc43b8087263591a94e699250bd444cc508708/data-raw/drug_annot/pug_view/pug_annot.rds -------------------------------------------------------------------------------- /data-raw/drug_annot/pug_view/sider.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/dseqr/fcfc43b8087263591a94e699250bd444cc508708/data-raw/drug_annot/pug_view/sider.rds -------------------------------------------------------------------------------- /data-raw/drug_es/pvals.R: -------------------------------------------------------------------------------- 1 | # saves all CMAP02 and L1000 adjusted pvalues as individual files for quick loading for dseqr::heatplot 2 | library(dseqr) 3 | # load data 4 | l1000_pvals_path <- system.file('extdata', 'l1000_pval.adj.rds', package = 'dseqr.data', mustWork = TRUE) 5 | cmap_pvals_path <- system.file('extdata', 'cmap_pval.adj_ind.rds', package = 'dseqr.data', mustWork = TRUE) 6 | l1000_pvals <- readRDS(l1000_pvals_path) 7 | cmap_pvals <- readRDS(cmap_pvals_path) 8 | 9 | # split l1000 by compounds/genetic perts & ligands 10 | is.genetic <- grepl('-oe_|-sh_|-lig_', colnames(l1000_pvals)) 11 | 12 | l1000_genes_pvals <- l1000_pvals[, is.genetic] 13 | l1000_drugs_pvals <- l1000_pvals[, !is.genetic] 14 | 15 | # save each signature seperately 16 | save_signatures <- function(es, data_dir) { 17 | sig_names <- colnames(es) 18 | dir.create(data_dir, recursive = TRUE) 19 | 20 | 21 | for (sig_name in sig_names) { 22 | sig <- es[,sig_name] 23 | fname <- paste0(sig_name, '.rds') 24 | fpath <- file.path(data_dir, fname) 25 | if (file.exists(fpath)) next() 26 | 27 | tryCatch(saveRDS(sig, fpath), 28 | error = function(e) { 29 | new_fname <- fs::path_sanitize(fname) 30 | new_fpath <- file.path(data_dir, new_fname) 31 | 32 | cat(fname, 'invalid, changing to:', new_fname, '\n') 33 | saveRDS(sig, new_fpath) 34 | }) 35 | } 36 | } 37 | 38 | save_signatures(l1000_genes_pvals, 'data-raw/drug_es/pvals/l1000_genes') 39 | save_signatures(l1000_drugs_pvals, 'data-raw/drug_es/pvals/l1000_drugs') 40 | save_signatures(cmap_pvals, 'data-raw/drug_es/pvals/cmap') 41 | 42 | # sync to s3 43 | # aws s3 sync ~/Documents/Batcave/zaklab/dseqr/data-raw/drug_es/pvals s3://dseqr/drug_pvals_dir 44 | -------------------------------------------------------------------------------- /data-raw/drug_es/signatures.R: -------------------------------------------------------------------------------- 1 | # saves all CMAP02 and L1000 signatures as individual files for quick loading in Pathways tab 2 | library(dseqr) 3 | # load data 4 | cmap_path <- system.file('extdata', 'cmap_es_ind.rds', package = 'dseqr.data', mustWork = TRUE) 5 | cmap_es <- readRDS(cmap_path) 6 | 7 | l1000_genes_path <- system.file('extdata', 'l1000_genes_es.rds', package = 'dseqr.data', mustWork = TRUE) 8 | l1000_genes <- readRDS(l1000_genes_path) 9 | 10 | l1000_drugs_path <- system.file('extdata', 'l1000_drugs_es.rds', package = 'dseqr.data', mustWork = TRUE) 11 | l1000_drugs <- readRDS(l1000_drugs_path) 12 | 13 | # save each signature seperately 14 | save_signatures <- function(es, data_dir) { 15 | sig_names <- colnames(es) 16 | dir.create(data_dir, recursive = TRUE) 17 | 18 | 19 | for (sig_name in sig_names) { 20 | sig <- es[,sig_name] 21 | fname <- paste0(sig_name, '.rds') 22 | fpath <- file.path(data_dir, fname) 23 | if (file.exists(fpath)) next() 24 | 25 | tryCatch(saveRDS(sig, fpath), 26 | error = function(e) { 27 | new_fname <- fs::path_sanitize(fname) 28 | new_fpath <- file.path(data_dir, new_fname) 29 | 30 | cat(fname, 'invalid, changing to:', new_fname, '\n') 31 | saveRDS(sig, new_fpath) 32 | }) 33 | } 34 | } 35 | 36 | save_signatures(cmap_es, 'data-raw/drug_es/signatures/cmap') 37 | save_signatures(l1000_genes, 'data-raw/drug_es/signatures/l1000_genes') 38 | save_signatures(l1000_drugs, 'data-raw/drug_es/signatures/l1000_drugs') 39 | 40 | # sync to s3 41 | # aws s3 sync ~/Documents/Batcave/zaklab/dseqr/data-raw/drug_es/signatures s3://dseqr/drug_es_dir 42 | -------------------------------------------------------------------------------- /data-raw/drug_gene_queries/pert_names.R: -------------------------------------------------------------------------------- 1 | pert_names <- list.files('data-raw/drug_gene_queries/data') 2 | 3 | pert_names <- gsub('.rds$', '', pert_names) 4 | pert_names <- gsub('^.+?_res_', '', pert_names) 5 | pert_names <- unique(pert_names) 6 | 7 | saveRDS(pert_names, 'data-raw/drug_gene_queries/pert_names.rds') 8 | -------------------------------------------------------------------------------- /data-raw/drug_paths/map.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/dseqr/fcfc43b8087263591a94e699250bd444cc508708/data-raw/drug_paths/map.rds -------------------------------------------------------------------------------- /data-raw/dseqr_to_cellenics.R: -------------------------------------------------------------------------------- 1 | library(Seurat) 2 | library(SingleCellExperiment) 3 | 4 | # read in exported data from dseqr 5 | scseq <- qs::qread('scseq.qs') 6 | colnames(scseq) <- make.unique(colnames(scseq)) 7 | 8 | sdata <- as.Seurat(scseq) 9 | 10 | # add cluster to appropriate column 11 | sdata$seurat_clusters <- sdata$cluster 12 | Idents(sdata) <- 'seurat_clusters' 13 | sdata$samples <- sdata$batch 14 | 15 | # add groupings (will be auto-detected by Cellenics) 16 | meta <- scseq@metadata$meta 17 | sdata$Group <- meta[sdata$batch, 'group'] 18 | 19 | # add variable features and pca (needed for Cellenics) 20 | sdata <- SeuratObject::RenameAssays(sdata, 'originalexp' = 'RNA') 21 | 22 | sdata <- FindVariableFeatures(sdata) 23 | sdata <- ScaleData(sdata) 24 | sdata <- RunPCA(sdata) 25 | 26 | 27 | # save for Cellenics 28 | saveRDS(sdata, 'scseq_cellenics.rds') 29 | -------------------------------------------------------------------------------- /data-raw/ensmap/ensmap.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/dseqr/fcfc43b8087263591a94e699250bd444cc508708/data-raw/ensmap/ensmap.rds -------------------------------------------------------------------------------- /data-raw/example_data/GSE134809_samples.csv: -------------------------------------------------------------------------------- 1 | sample,pair 2 | GSM3972009_illeal_involved69_QC1,1 3 | GSM3972011_illeal_involved122_QC1,2 4 | GSM3972013_illeal_involved128_QC1,3 5 | GSM3972016_illeal_involved138_QC1,4 6 | GSM3972010_illeal_uninvolved68_QC1,1 7 | GSM3972012_illeal_uninvolved123_QC1,2 8 | GSM3972014_illeal_uninvolved129_QC1,3 9 | GSM3972015_illeal_uninvolved135_QC1,4 10 | -------------------------------------------------------------------------------- /data-raw/example_data/GSE93624_annot.csv: -------------------------------------------------------------------------------- 1 | "Group name","Title","Pair" 2 | "CTRL","SRR5176629",NA 3 | "CTRL","SRR5176630",NA 4 | "CTRL","SRR5176632",NA 5 | "CTRL","SRR5176646",NA 6 | "CTRL","SRR5176647",NA 7 | "CTRL","SRR5176651",NA 8 | "CTRL","SRR5176653",NA 9 | "CTRL","SRR5176654",NA 10 | "CTRL","SRR5176656",NA 11 | "CTRL","SRR5176663",NA 12 | "CTRL","SRR5176666",NA 13 | "CTRL","SRR5176670",NA 14 | "PROGRESS","SRR5176671",NA 15 | "CTRL","SRR5176674",NA 16 | "CTRL","SRR5176675",NA 17 | "CTRL","SRR5176681",NA 18 | "PROGRESS","SRR5176682",NA 19 | "PROGRESS","SRR5176690",NA 20 | "CTRL","SRR5176691",NA 21 | "PROGRESS","SRR5176697",NA 22 | "PROGRESS","SRR5176699",NA 23 | "PROGRESS","SRR5176707",NA 24 | "PROGRESS","SRR5176708",NA 25 | "CTRL","SRR5176709",NA 26 | "PROGRESS","SRR5176726",NA 27 | "PROGRESS","SRR5176729",NA 28 | "CTRL","SRR5176730",NA 29 | "PROGRESS","SRR5176740",NA 30 | "CTRL","SRR5176745",NA 31 | "CTRL","SRR5176750",NA 32 | "PROGRESS","SRR5176751",NA 33 | "CTRL","SRR5176756",NA 34 | "CTRL","SRR5176758",NA 35 | "CTRL","SRR5176768",NA 36 | "PROGRESS","SRR5176769",NA 37 | "CTRL","SRR5176777",NA 38 | "CTRL","SRR5176778",NA 39 | "CTRL","SRR5176781",NA 40 | "PROGRESS","SRR5176783",NA 41 | "PROGRESS","SRR5176794",NA 42 | "PROGRESS","SRR5176802",NA 43 | "PROGRESS","SRR5176805",NA 44 | "PROGRESS","SRR5176806",NA 45 | "PROGRESS","SRR5176820",NA 46 | "PROGRESS","SRR5176825",NA 47 | "PROGRESS","SRR5176829",NA 48 | "PROGRESS","SRR5176830",NA 49 | "PROGRESS","SRR5176838",NA 50 | "PROGRESS","SRR5176840",NA 51 | "PROGRESS","SRR5176841",NA 52 | "CTRL","SRR5176842",NA 53 | "CTRL","SRR5176843",NA 54 | "CTRL","SRR5176844",NA 55 | "CTRL","SRR5176848",NA 56 | "CTRL","SRR5176849",NA 57 | "CTRL","SRR5176850",NA 58 | "CTRL","SRR5176851",NA 59 | "CTRL","SRR5176853",NA 60 | "CTRL","SRR5176856",NA 61 | "PROGRESS","SRR5176858",NA 62 | "PROGRESS","SRR5176864",NA 63 | "PROGRESS","SRR5176868",NA 64 | -------------------------------------------------------------------------------- /data-raw/genes/genes.R: -------------------------------------------------------------------------------- 1 | data_dir <- system.file('extdata', package = 'dseqr.data') 2 | 3 | l1000_es <- readRDS(file.path(data_dir, 'l1000_genes_es.rds')) 4 | cmap_es <- readRDS(file.path(data_dir, 'cmap_es_ind.rds')) 5 | 6 | cmap_genes <- row.names(cmap_es) 7 | l1000_genes <- row.names(l1000_es) 8 | common <- intersect(cmap_genes, l1000_genes) 9 | 10 | # all l1000 genes are also in CMAP 11 | genes <- list(cmap_only = setdiff(cmap_genes, common), common = common) 12 | 13 | saveRDS(genes, 'data-raw/genes/genes.rds') 14 | -------------------------------------------------------------------------------- /data-raw/genes/genes.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/dseqr/fcfc43b8087263591a94e699250bd444cc508708/data-raw/genes/genes.rds -------------------------------------------------------------------------------- /data-raw/macspectrum/amdsgs.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/dseqr/fcfc43b8087263591a94e699250bd444cc508708/data-raw/macspectrum/amdsgs.rds -------------------------------------------------------------------------------- /data-raw/macspectrum/macspectrum.R: -------------------------------------------------------------------------------- 1 | # from supplemental PMC6542613 2 | library(dplyr) 3 | library(org.Mm.eg.db) 4 | 5 | psgs <- readRDS('data-raw/macspectrum/psgs.rds') 6 | amdsgs <- readRDS('data-raw/macspectrum/amdsgs.rds') 7 | 8 | # use maps that using for quantification 9 | tx2gene_mouse <- dseqr.data::load_tx2gene('Mus musculus') 10 | 11 | psg_map <- tx2gene_mouse[tx2gene_mouse$gene_id %in% psgs, c('gene_id', 'entrezid')] 12 | psg_map <- unique(psg_map) 13 | psg_map$ENTREZID <- as.character(psg_map$entrezid) 14 | 15 | amdsg_map <- tx2gene_mouse[tx2gene_mouse$gene_id %in% amdsgs, c('gene_id', 'entrezid')] 16 | amdsg_map <- unique(amdsg_map) 17 | amdsg_map$ENTREZID <- as.character(amdsg_map$entrezid) 18 | 19 | # map from mouse entrezids to human 20 | homologene <- readRDS(system.file('extdata', 'homologene.rds', package = 'dseqr.data')) 21 | 22 | tx2gene <- dseqr.data::load_tx2gene() 23 | tx2gene$ENTREZID <- as.character(tx2gene$entrezid) 24 | tx2gene <- tx2gene[, c('ENTREZID', 'gene_name')] 25 | tx2gene <- unique(tx2gene) 26 | tx2gene <- tx2gene[!is.na(tx2gene$ENTREZID), ] 27 | 28 | psg_hgnc <- psg_map %>% 29 | left_join(homologene, by = 'ENTREZID') %>% 30 | left_join(tx2gene, by = c('ENTREZID_HS' = 'ENTREZID')) %>% 31 | filter(!is.na(gene_name)) %>% 32 | distinct(gene_name) %>% 33 | pull(gene_name) 34 | 35 | amdsg_hgnc <- amdsg_map %>% 36 | left_join(homologene, by = 'ENTREZID') %>% 37 | left_join(tx2gene, by = c('ENTREZID_HS' = 'ENTREZID')) %>% 38 | filter(!is.na(gene_name)) %>% 39 | distinct(gene_name) %>% 40 | pull(gene_name) 41 | 42 | 43 | writeLines(psg_hgnc, 'data-raw/macspectrum/psg_hgnc.txt') 44 | writeLines(amdsg_hgnc, 'data-raw/macspectrum/amdsg_hgnc.txt') 45 | 46 | writeLines(c(psg_hgnc, amdsg_hgnc), 'data-raw/macspectrum/psg_amdsg_hgnc.txt') 47 | 48 | -------------------------------------------------------------------------------- /data-raw/macspectrum/psgs.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/dseqr/fcfc43b8087263591a94e699250bd444cc508708/data-raw/macspectrum/psgs.rds -------------------------------------------------------------------------------- /data-raw/qcgenes/mrna_rrna.R: -------------------------------------------------------------------------------- 1 | # get mitochondrial and ribosomal genes for QC ---- 2 | library(data.table) 3 | 4 | tx2gene <- dseqr.data::load_tx2gene() 5 | 6 | # ribo genes from: https://www.genenames.org/data/genegroup/#!/group/1054 7 | ribo_genes <- fread('data-raw/single-cell/alevin-args/ribo.txt') 8 | ribo_genes <- c(ribo_genes$`Approved symbol`, ribo_genes$`Previous symbols`) 9 | ribo_genes <- tx2gene$gene_name[tx2gene$gene_name %in% toupper(ribo_genes)] 10 | ribo_genes <- unique(ribo_genes) 11 | 12 | mito_genes <- tx2gene %>% 13 | dplyr::select(seq_name, gene_name) %>% 14 | dplyr::filter(seq_name == 'MT') %>% 15 | dplyr::select(gene_name) %>% 16 | distinct() %>% 17 | pull(gene_name) 18 | 19 | write.table(mito_genes, 'inst/extdata/mrna.csv', quote = FALSE, row.names = FALSE, col.names = FALSE) 20 | write.table(ribo_genes, 'inst/extdata/rrna.csv', quote = FALSE, row.names = FALSE, col.names = FALSE) 21 | 22 | # mouse ribo genes from: http://ribosome.med.miyazaki-u.ac.jp/rpg.cgi?mode=search&org=Mus+musculus&gene= 23 | tx2gene <- dseqr.data::load_tx2gene('Mus musculus') 24 | 25 | ribo_genes <- read.csv('data-raw/single-cell/alevin-args/ribo_mouse.csv') 26 | ribo_genes <- ribo_genes$Gene.Name 27 | ribo_genes <- tx2gene$gene_name[tx2gene$gene_name %in% ribo_genes] 28 | ribo_genes <- unique(ribo_genes) 29 | 30 | mito_genes <- tx2gene %>% 31 | dplyr::select(seq_name, gene_name) %>% 32 | dplyr::filter(seq_name == 'MT') %>% 33 | dplyr::select(gene_name) %>% 34 | distinct() %>% 35 | pull(gene_name) 36 | 37 | 38 | write.table(mito_genes, 'inst/extdata/mrna_mouse.csv', quote = FALSE, row.names = FALSE, col.names = FALSE) 39 | write.table(ribo_genes, 'inst/extdata/rrna_mouse.csv', quote = FALSE, row.names = FALSE, col.names = FALSE) 40 | 41 | 42 | -------------------------------------------------------------------------------- /dseqr.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 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 | 18 | BuildType: Package 19 | PackageInstallArgs: --no-multiarch --with-keep.source 20 | PackageRoxygenize: rd,collate,namespace 21 | -------------------------------------------------------------------------------- /inst/app/global.R: -------------------------------------------------------------------------------- 1 | # things loaded in here are loaded once (even if multiple users) 2 | 3 | suppressPackageStartupMessages({ 4 | library(shiny) 5 | library(shinyjs) 6 | library(shinyBS) 7 | library(shinyWidgets) 8 | library(rlang) 9 | library(shinypanel) 10 | library(magrittr) 11 | library(dseqr) 12 | }) 13 | -------------------------------------------------------------------------------- /inst/app/tests/testthat.R: -------------------------------------------------------------------------------- 1 | shinytest2::test_app() 2 | -------------------------------------------------------------------------------- /inst/app/tests/testthat/setup.R: -------------------------------------------------------------------------------- 1 | # Load application support files into testing environment 2 | # shinytest2::load_app_env() 3 | -------------------------------------------------------------------------------- /inst/app/www/EMBL_Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/dseqr/fcfc43b8087263591a94e699250bd444cc508708/inst/app/www/EMBL_Logo.png -------------------------------------------------------------------------------- /inst/app/www/contextMenu.js: -------------------------------------------------------------------------------- 1 | var title = null; 2 | var menuHeight = 0; 3 | 4 | function setupContextMenu() { 5 | title = null; 6 | menuHeight = $("#cor-menu").height(); 7 | 8 | $('.cor-point').off().on("contextmenu", function(event) { 9 | // Avoid the real one 10 | event.preventDefault(); 11 | 12 | 13 | corpoint = $(event.target).closest('.cor-point'); 14 | corpoint.addClass('clicked'); 15 | 16 | title = corpoint.find("circle.cor").attr("title"); 17 | 18 | // set title on contextmenu 19 | $("#menu-title").text(title); 20 | 21 | // Show contextmenu 22 | $("#cor-menu") 23 | .finish() 24 | .toggle(100) // In the right position (the mouse) 25 | .css({ 26 | top: (event.pageY - menuHeight - 5) + "px", 27 | left: event.pageX + 5 + "px" 28 | }); 29 | }); 30 | // If the document is clicked somewhere 31 | $(document).on("mousedown", function(e) { 32 | // If the clicked element is not the menu 33 | if (!$(e.target).parents(".custom-menu").length > 0) { 34 | // Hide it 35 | $(".custom-menu").hide(100); 36 | corpoint.removeClass('clicked'); 37 | 38 | } 39 | }); 40 | } 41 | 42 | function initContextMenu(loadId, showId) { 43 | // If the menu element is clicked 44 | var nclick = 0; 45 | 46 | $("#cor-menu li").click(function() { 47 | // This is the triggered action name 48 | switch ($(this).attr("data-action")) { 49 | // A case for each action. Your actions here 50 | case "load": 51 | Shiny.onInputChange(loadId, title); 52 | break; 53 | case "show": 54 | Shiny.onInputChange(showId, nclick); 55 | nclick = nclick + 1; 56 | break; 57 | case "clear": 58 | alert("second"); 59 | break; 60 | } 61 | 62 | // Hide it AFTER the action was triggered 63 | $(".custom-menu").hide(100); 64 | 65 | }); 66 | } 67 | -------------------------------------------------------------------------------- /inst/app/www/drugbank_logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/dseqr/fcfc43b8087263591a94e699250bd444cc508708/inst/app/www/drugbank_logo.ico -------------------------------------------------------------------------------- /inst/app/www/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/dseqr/fcfc43b8087263591a94e699250bd444cc508708/inst/app/www/favicon.png -------------------------------------------------------------------------------- /inst/app/www/genecards_logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/dseqr/fcfc43b8087263591a94e699250bd444cc508708/inst/app/www/genecards_logo.ico -------------------------------------------------------------------------------- /inst/app/www/gtag.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 16 | 17 | -------------------------------------------------------------------------------- /inst/app/www/gtm.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /inst/app/www/isMobile.js: -------------------------------------------------------------------------------- 1 | $(document).on('shiny:sessioninitialized', function (e) { 2 | let check = false; 3 | (function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera); 4 | Shiny.onInputChange('is_mobile', check); 5 | }); 6 | -------------------------------------------------------------------------------- /inst/app/www/pathways.css: -------------------------------------------------------------------------------- 1 | .path-name-option { 2 | white-space: nowrap; 3 | overflow: hidden; 4 | text-overflow: ellipsis; 5 | max-width: calc(100% - 50px); 6 | padding-right: 10px; 7 | } 8 | 9 | .path-option-right { 10 | width: 50px; 11 | white-space: nowrap; 12 | } 13 | 14 | .path-fdr { 15 | color: #A0A0A0; 16 | text-align: right; 17 | display: inline-block; 18 | } 19 | 20 | .scroll-plot { 21 | overflow-x: hidden; 22 | overflow-y: visible; 23 | border: 1px solid #e7e7e7; 24 | height: 597px; 25 | padding: 10px; 26 | } 27 | 28 | .scroll-plot .js-plotly-plot .plotly svg a { 29 | fill: darkslategray; 30 | } 31 | 32 | .scroll-plot .js-plotly-plot .plotly svg a:hover { 33 | fill: cornflowerblue; 34 | } 35 | 36 | .scroll-plot::-webkit-scrollbar { 37 | width: 12px; 38 | height: 12px; 39 | } 40 | 41 | .scroll-plot::-webkit-scrollbar-track-piece { 42 | background-color: #C2D2E4; 43 | } 44 | 45 | .scroll-plot::-webkit-scrollbar-thumb:horizontal { 46 | height: 30px; 47 | background-color: #286090; 48 | } 49 | -------------------------------------------------------------------------------- /inst/app/www/pubchem_logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/dseqr/fcfc43b8087263591a94e699250bd444cc508708/inst/app/www/pubchem_logo.ico -------------------------------------------------------------------------------- /inst/extdata/mrna.csv: -------------------------------------------------------------------------------- 1 | ND3 2 | ND4L 3 | ND4 4 | ND1 5 | ND2 6 | ND5 7 | COX1 8 | ND6 9 | COX2 10 | CYTB 11 | ATP8 12 | ATP6 13 | COX3 14 | MT-TL1 15 | MT-TF 16 | MT-TV 17 | MT-RNR2 18 | MT-TI 19 | MT-TQ 20 | MT-TM 21 | MT-TW 22 | MT-TA 23 | MT-TN 24 | MT-TC 25 | MT-TY 26 | MT-TS1 27 | MT-TD 28 | MT-TK 29 | MT-TG 30 | MT-TR 31 | MT-TH 32 | MT-TS2 33 | MT-TL2 34 | MT-TE 35 | MT-TT 36 | MT-TP 37 | MT-RNR1 38 | -------------------------------------------------------------------------------- /inst/extdata/mrna_mouse.csv: -------------------------------------------------------------------------------- 1 | mt-Tf 2 | mt-Rnr1 3 | mt-Tv 4 | mt-Rnr2 5 | mt-Tl1 6 | mt-Nd1 7 | mt-Ti 8 | mt-Tq 9 | mt-Tm 10 | mt-Nd2 11 | mt-Tw 12 | mt-Ta 13 | mt-Tn 14 | mt-Tc 15 | mt-Ty 16 | mt-Co1 17 | mt-Ts1 18 | mt-Td 19 | mt-Co2 20 | mt-Tk 21 | mt-Atp8 22 | mt-Atp6 23 | mt-Co3 24 | mt-Tg 25 | mt-Nd3 26 | mt-Tr 27 | mt-Nd4 28 | mt-Th 29 | mt-Ts2 30 | mt-Tl2 31 | mt-Nd5 32 | mt-Nd6 33 | mt-Te 34 | mt-Cytb 35 | mt-Tt 36 | mt-Tp 37 | mt-Nd4l 38 | -------------------------------------------------------------------------------- /inst/extdata/rrna.csv: -------------------------------------------------------------------------------- 1 | RPS20 2 | MRPS10 3 | MRPS35 4 | MRPS34 5 | RPS5 6 | MRPL28 7 | RPL6 8 | RPS18 9 | RPL3 10 | RPS19 11 | RPL18A 12 | MRPL32 13 | RPL19 14 | MRPL27 15 | RPS13 16 | RPLP0 17 | MRPL51 18 | RPS12 19 | MRPL2 20 | MRPS30 21 | RPS15 22 | RPL22 23 | MRPS2 24 | RPS29 25 | MRPS7 26 | RPL23 27 | RPS4Y1 28 | RPS16 29 | MRPL34 30 | MRPL4 31 | MRPS25 32 | RPL27 33 | MRPL35 34 | MRPS36 35 | MRPL53 36 | MRPL44 37 | MRPS9 38 | MRPL47 39 | MRPS18B 40 | MRPL15 41 | RPLP1 42 | MRPS27 43 | RPL8 44 | RPL31 45 | MRPL3 46 | RPL26L1 47 | MRPL22 48 | RPL3L 49 | RPS11 50 | RPL21 51 | RPS27A 52 | MRPS5 53 | RPL32 54 | RPS3A 55 | RPL37 56 | MRPS28 57 | RPS3 58 | MRPL49 59 | FAU 60 | MRPS17 61 | RPL30 62 | MRPL17 63 | MRPL10 64 | RPL26 65 | RPL29 66 | MRPL55 67 | MRPS18C 68 | RPL9 69 | MRPL33 70 | RPL39L 71 | RPS23 72 | RPL10L 73 | RPL36AL 74 | MRPL43 75 | MRPL16 76 | RPS9 77 | RPL7L1 78 | RPS7 79 | MRPL13 80 | MRPL39 81 | RPL15 82 | RPL4 83 | MRPS12 84 | MRPL38 85 | MRPL57 86 | MRPL48 87 | MRPS22 88 | MRPL11 89 | RPL38 90 | MRPL52 91 | RPS14 92 | MRPL46 93 | MRPS23 94 | RPL27A 95 | RPS6 96 | MRPL1 97 | RPL7A 98 | RPL5 99 | RPS4X 100 | MRPS24 101 | RPLP2 102 | RPL10A 103 | RPS15A 104 | MRPS31 105 | MRPS33 106 | MRPS11 107 | RPS10 108 | RPL35A 109 | MRPL54 110 | RPS17 111 | RPS27L 112 | MRPL40 113 | MRPL12 114 | MRPL37 115 | MRPL30 116 | RPL14 117 | DAP3 118 | RPS2 119 | RPS21 120 | RPL28 121 | RPL10 122 | MRPL20 123 | RPL36 124 | RPL35 125 | RPL7 126 | RPL23A 127 | RPS26 128 | MRPL42 129 | MRPL19 130 | RPL41 131 | RPL37A 132 | RPS24 133 | RPL12 134 | MRPL24 135 | RPL39 136 | MRPL21 137 | MRPL18 138 | MRPS14 139 | RPS27 140 | MRPL9 141 | MRPL41 142 | MRPL14 143 | MRPS18A 144 | RPS8 145 | RPL36A 146 | MRPS16 147 | MRPS15 148 | RPL11 149 | MRPL50 150 | MRPS26 151 | MRPL23 152 | MRPL36 153 | RPL13A 154 | RPL24 155 | RPL34 156 | MRPS6 157 | RPS28 158 | UBA52 159 | RPS25 160 | RPL17 161 | MRPS21 162 | MRPL45 163 | RPS4Y2 164 | -------------------------------------------------------------------------------- /inst/extdata/rrna_mouse.csv: -------------------------------------------------------------------------------- 1 | Rpl13 2 | Rps11 3 | Rpl8 4 | Rps5 5 | Rps9 6 | Rplp1 7 | Rps18 8 | Rpl10 9 | Rpl30 10 | Rpl19 11 | Rpl24 12 | Rps10 13 | Rps14 14 | Rps26 15 | Rpl6 16 | Rpl28 17 | Rps3 18 | Rps4x 19 | Rpl4 20 | Rpsa 21 | Rpl21 22 | Rps29 23 | Rpl10a 24 | Rpl37 25 | Rps23 26 | Rpl27a 27 | Rpl18a 28 | Rps2 29 | Rpl9 30 | Rpl7 31 | Rps21 32 | Rpl29 33 | Rpl37a 34 | Rpl34 35 | Rps15 36 | Rpl18 37 | Rpl26 38 | Rps12 39 | Rps7 40 | Rpl27 41 | Rpl38 42 | Rpl35a 43 | Rpl15 44 | Rpl17 45 | Rps25 46 | Rpl36 47 | Rps17 48 | Rpl35 49 | Rpl3 50 | Rpl32 51 | Rps16 52 | Rpl5 53 | Rplp2 54 | Rplp0 55 | Rpl31 56 | Rps28 57 | Rpl23a 58 | Rpl11 59 | Rps8 60 | Rpl12 61 | Rps6 62 | Rps27a 63 | Rpl7a 64 | Rps20 65 | Rpl23 66 | Rpl22 67 | Rps15a 68 | Rps19 69 | Rps24 70 | Rpl39 71 | Rpl13a 72 | Rpl14 73 | Rps27 74 | Rps13 75 | Rpl41 76 | -------------------------------------------------------------------------------- /inst/extdata/slack.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/dseqr/fcfc43b8087263591a94e699250bd444cc508708/inst/extdata/slack.rds -------------------------------------------------------------------------------- /inst/extdata/txp2hgnc.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hms-dbmi/dseqr/fcfc43b8087263591a94e699250bd444cc508708/inst/extdata/txp2hgnc.zip -------------------------------------------------------------------------------- /man/SingleViolinIPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/SingleViolinIPlot.R 3 | \name{SingleViolinIPlot} 4 | \alias{SingleViolinIPlot} 5 | \title{Violin plot by identity} 6 | \usage{ 7 | SingleViolinIPlot( 8 | data, 9 | idents, 10 | hl = NULL, 11 | title = NULL, 12 | sort = FALSE, 13 | y.max = NULL, 14 | adjust = 1, 15 | pt.size = 1, 16 | pt.shape = 20, 17 | seed.use = 42, 18 | log = FALSE, 19 | color = NULL, 20 | color_dark = NULL, 21 | nsel = 1, 22 | ncells = NULL, 23 | pct.cells = NULL 24 | ) 25 | } 26 | \arguments{ 27 | \item{data}{Data to plot} 28 | 29 | \item{idents}{Idents to use} 30 | 31 | \item{hl}{Factor used to highlight specific \code{idents} via 32 | fill, alpha, and color geoms.} 33 | 34 | \item{title}{Plot title} 35 | 36 | \item{sort}{Sort identity classes (on the x-axis) by the average 37 | expression of the attribute being potted} 38 | 39 | \item{y.max}{Maximum Y value to plot} 40 | 41 | \item{adjust}{Adjust parameter for geom_violin} 42 | 43 | \item{pt.size}{size parameter for geom_jitter} 44 | 45 | \item{pt.shape}{shape parameter for geom_jitter} 46 | 47 | \item{seed.use}{Random seed to use. If NULL, don't set a seed} 48 | 49 | \item{log}{plot Y axis on log scale} 50 | 51 | \item{color}{Colors to use for fill with length equal to one less than 52 | \code{length(levels(hl))}. The last level of \code{hl} is filled with gray.} 53 | 54 | \item{color_dark}{Darker versions of \code{color} used for points and lines.} 55 | 56 | \item{nsel}{Number of selected \code{idents}. Default is 1.} 57 | 58 | \item{ncells}{Vector specifying number of cells in each \code{levels(idents)}. 59 | If specified, an annotated bar plot is drawn to indicate number of cells.} 60 | 61 | \item{pct.cells}{Vector specifying percent of cells that express the marker, 62 | once for each \code{levels(idents)}. If specified, an annotated bar plot is drawn.} 63 | } 64 | \value{ 65 | A ggplot-based Violin-by-Identity plot 66 | } 67 | \description{ 68 | Violin plot by identity 69 | } 70 | -------------------------------------------------------------------------------- /man/add_cluster_numbers.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot_scseq.R 3 | \name{add_cluster_numbers} 4 | \alias{add_cluster_numbers} 5 | \title{Add cluster numbers to annotation} 6 | \usage{ 7 | add_cluster_numbers(annot, pad_left = FALSE) 8 | } 9 | \arguments{ 10 | \item{annot}{Character vector of cluster names} 11 | 12 | \item{pad_left}{Should cluster numbers be padded on the left? Used to align 13 | numbers for violin plot.} 14 | } 15 | \value{ 16 | \code{annot} with cluster numbers pre-pended to non-numeric values. 17 | } 18 | \description{ 19 | Adds cluster number to non-numeric cluster names. 20 | E.g. if \code{annot = c('Monocytes', '2')} then 21 | \code{annot = c('1: Monocytes', '2')} is returned 22 | } 23 | \examples{ 24 | 25 | annot <- c('Monocytes', '2') 26 | add_cluster_numbers(annot) 27 | 28 | } 29 | -------------------------------------------------------------------------------- /man/add_combined_metrics.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{add_combined_metrics} 4 | \alias{add_combined_metrics} 5 | \title{Add QC metrics to integrated SingleCellExperiment} 6 | \usage{ 7 | add_combined_metrics(combined, scseqs) 8 | } 9 | \arguments{ 10 | \item{combined}{Integrated \code{SingleCellExperiment}} 11 | 12 | \item{scseqs}{list of \code{SingleCellExperiment}s used to create \code{combined}} 13 | } 14 | \value{ 15 | \code{combined} with QC metrics from \code{scseqs} added 16 | } 17 | \description{ 18 | Add QC metrics to integrated SingleCellExperiment 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/add_doublet_score.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/import_scseq.R 3 | \name{add_doublet_score} 4 | \alias{add_doublet_score} 5 | \title{Calculate doublet score for each cell} 6 | \usage{ 7 | add_doublet_score(scseq) 8 | } 9 | \arguments{ 10 | \item{scseq}{\code{SingleCellExperiment} object with \code{hvg} column in \code{rowData} 11 | and \code{npcs} in \code{metadata} slot} 12 | } 13 | \value{ 14 | \code{scseq} with column \code{doublet_score} added to \code{colData}. 15 | } 16 | \description{ 17 | Calculate doublet score for each cell 18 | } 19 | \keyword{internal} 20 | -------------------------------------------------------------------------------- /man/add_hvgs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/import_scseq.R 3 | \name{add_hvgs} 4 | \alias{add_hvgs} 5 | \title{Add top highly variable genes for subsequent dimensionality reduction} 6 | \usage{ 7 | add_hvgs(sce, hvgs = NULL) 8 | } 9 | \arguments{ 10 | \item{sce}{\code{SingleCellExperiment} object} 11 | 12 | \item{hvgs}{Character vector of genes to use. Used to specify external 13 | set of highly variable genes.} 14 | } 15 | \value{ 16 | \code{sce} a boolean vector added to \code{rowData(sce)$hvg} that 17 | indicates which rows correspond to highly variable genes. 18 | } 19 | \description{ 20 | Runs after \code{preprocess_scseq} 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /man/add_linkout.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-utils.R 3 | \name{add_linkout} 4 | \alias{add_linkout} 5 | \title{Add linkout HTML} 6 | \usage{ 7 | add_linkout( 8 | query_res, 9 | id_col, 10 | img_url, 11 | pre_url, 12 | post_url = NULL, 13 | title = id_col 14 | ) 15 | } 16 | \arguments{ 17 | \item{query_res}{\code{data.frame} returned by \code{\link{summarize_compound}}.} 18 | 19 | \item{id_col}{Character with column in \code{query_res} that contains ids to 20 | be inserted between \code{pre_url} and \code{post_url} to form the link. \code{NA} 21 | values will be ignored.} 22 | 23 | \item{img_url}{Character with url to an image to display as hyperlink.} 24 | 25 | \item{pre_url}{Character with url portion to paste before \code{id_col} column values.} 26 | 27 | \item{post_url}{Character with url portion to paste before \code{id_col} column values.} 28 | 29 | \item{title}{Character that will be added to hyperlink title attribute. Default is \code{id_col}.} 30 | } 31 | \value{ 32 | \code{query_res} with HTML for hyperlinks in \code{id_col}. 33 | } 34 | \description{ 35 | Non \code{NA} values in \code{id_col} of \code{query_res} are inserted between 36 | \code{pre_url} and \code{post_url} to form hyperlinks. Relevant HTML markup is also added. 37 | } 38 | \keyword{internal} 39 | -------------------------------------------------------------------------------- /man/add_scseq_qc_metrics.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/import_scseq.R 3 | \name{add_scseq_qc_metrics} 4 | \alias{add_scseq_qc_metrics} 5 | \title{Calculate QC metrics for SingleCellExperiment} 6 | \usage{ 7 | add_scseq_qc_metrics(sce, for_qcplots = FALSE) 8 | } 9 | \arguments{ 10 | \item{sce}{\code{SingleCellExperiment}} 11 | 12 | \item{for_qcplots}{Are the QC metrics being added for QC plots? Used by 13 | \link{import_scseq}.} 14 | } 15 | \value{ 16 | \code{sce} with qc metrics added by \code{\link[scater]{addPerCellQC}} 17 | } 18 | \description{ 19 | Calculate QC metrics for SingleCellExperiment 20 | } 21 | -------------------------------------------------------------------------------- /man/add_scseq_qcplot_metrics.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/import_scseq.R 3 | \name{add_scseq_qcplot_metrics} 4 | \alias{add_scseq_qcplot_metrics} 5 | \title{Add QC metrics to SingleCellExperiment for plotting} 6 | \usage{ 7 | add_scseq_qcplot_metrics(sce) 8 | } 9 | \arguments{ 10 | \item{sce}{\code{SingleCellExperiment}} 11 | } 12 | \value{ 13 | \code{sce} with formated qc metrics. 14 | } 15 | \description{ 16 | Add QC metrics to SingleCellExperiment for plotting 17 | } 18 | -------------------------------------------------------------------------------- /man/add_table_html.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-utils.R 3 | \name{add_table_html} 4 | \alias{add_table_html} 5 | \title{Add HTML to query results table} 6 | \usage{ 7 | add_table_html(query_res) 8 | } 9 | \arguments{ 10 | \item{query_res}{\code{data.frame} returned by \code{\link{summarize_compound}}} 11 | } 12 | \value{ 13 | \code{query_res} with pubchem cid links and correlation plot HTML. 14 | } 15 | \description{ 16 | Add HTML to query results table 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/advancedOptionsInput.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-ui.R 3 | \name{advancedOptionsInput} 4 | \alias{advancedOptionsInput} 5 | \title{advanced options input for drugs page} 6 | \usage{ 7 | advancedOptionsInput(id) 8 | } 9 | \value{ 10 | \code{shiny.tag} 11 | } 12 | \description{ 13 | advanced options input for drugs page 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/aggregate.Matrix.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/matrix_utils.R 3 | \name{aggregate.Matrix} 4 | \alias{aggregate.Matrix} 5 | \title{Compute summary statistics of a Matrix} 6 | \usage{ 7 | \method{aggregate}{Matrix}(x, groupings = NULL, form = NULL, fun = "sum", ...) 8 | } 9 | \description{ 10 | Compute summary statistics of a Matrix 11 | } 12 | -------------------------------------------------------------------------------- /man/annot_query_res.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/format_query_table.R 3 | \name{annot_query_res} 4 | \alias{annot_query_res} 5 | \title{Annotate query result} 6 | \usage{ 7 | annot_query_res(query_res, drug_annot) 8 | } 9 | \arguments{ 10 | \item{query_res}{Numeric vector of correlation values with names as HGNC symbols} 11 | 12 | \item{drug_annot}{result of \link{get_drugs_table}} 13 | } 14 | \value{ 15 | Annotated query table 16 | } 17 | \description{ 18 | Annotate query result 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/append_annot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/get_drugs_table.R 3 | \name{append_annot} 4 | \alias{append_annot} 5 | \title{Bind annotation data to pdata} 6 | \usage{ 7 | append_annot(pdata, study) 8 | } 9 | \arguments{ 10 | \item{pdata}{\code{data.frame} of pdata for either CMAP02 or L1000.} 11 | 12 | \item{study}{Character identifying study. Either \code{'CMAP02'} or \code{'L1000'}.} 13 | } 14 | \value{ 15 | \code{pdata} with bound annotation columns. 16 | } 17 | \description{ 18 | For the moment, annotation data is Broad Repurposing Hub data. 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/boxPlotly.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-bulk-utils.R 3 | \name{boxPlotly} 4 | \alias{boxPlotly} 5 | \title{Generate boxplotly for vsd normalized gene plots.} 6 | \usage{ 7 | boxPlotly(df, boxgap, boxgroupgap, plot_fname, ytitle, xtitle) 8 | } 9 | \arguments{ 10 | \item{df}{\code{data.frame} with columns: \itemize{ 11 | \item x Factor for x-labels. 12 | \item y Numeric column used for y-values. 13 | \item text Character column used for hoverinfo. 14 | \item name Character column used for legend names of \code{x} values. 15 | \item color Factor column used to generate ordered colors for boxplots for each \code{'x'} value. 16 | }} 17 | 18 | \item{boxgap}{Used for plotly layout.} 19 | 20 | \item{boxgroupgap}{Used for plotly layout.} 21 | 22 | \item{plot_fname}{Name to save plot as.} 23 | 24 | \item{ytitle}{Y axis title.} 25 | 26 | \item{xtitle}{X axis title.} 27 | } 28 | \value{ 29 | plotly 30 | } 31 | \description{ 32 | Generate boxplotly for vsd normalized gene plots. 33 | } 34 | \keyword{internal} 35 | -------------------------------------------------------------------------------- /man/boxPlotlyCells.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-bulk-utils.R 3 | \name{boxPlotlyCells} 4 | \alias{boxPlotlyCells} 5 | \title{Generate boxplotly for cell type deconvolution plots.} 6 | \usage{ 7 | boxPlotlyCells(df, boxgap, boxgroupgap, pvals, plot_fname, ytitle, xtitle) 8 | } 9 | \arguments{ 10 | \item{df}{\code{data.frame} with columns: \itemize{ 11 | \item x Factor for x-labels. 12 | \item y Numeric column used for y-values. 13 | \item text Character column used for hoverinfo. 14 | \item name Character column used for legend names of \code{x} values. 15 | \item color Factor column used to generate ordered colors for boxplots for each \code{'x'} value. 16 | }} 17 | 18 | \item{boxgap}{Used for plotly layout.} 19 | 20 | \item{boxgroupgap}{Used for plotly layout.} 21 | 22 | \item{plot_fname}{Name to save plot as.} 23 | 24 | \item{ytitle}{Y axis title.} 25 | 26 | \item{xtitle}{X axis title.} 27 | } 28 | \value{ 29 | plotly 30 | } 31 | \description{ 32 | Generate boxplotly for cell type deconvolution plots. 33 | } 34 | \keyword{internal} 35 | -------------------------------------------------------------------------------- /man/bulkPage.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-bulk-server.R 3 | \name{bulkPage} 4 | \alias{bulkPage} 5 | \title{Logic for Bulk Data Tab} 6 | \usage{ 7 | bulkPage( 8 | input, 9 | output, 10 | session, 11 | project_dir, 12 | sc_dir, 13 | bulk_dir, 14 | tx2gene_dir, 15 | indices_dir, 16 | gs_dir, 17 | add_bulk, 18 | remove_bulk 19 | ) 20 | } 21 | \arguments{ 22 | \item{input, output, session}{standard shiny module boilerplate} 23 | 24 | \item{project_dir}{path to folder with project files} 25 | 26 | \item{sc_dir}{sub folder of \code{project_dir} where single-cell data is stored} 27 | 28 | \item{bulk_dir}{sub folder of \code{project_dir} where bulk data is stored} 29 | 30 | \item{tx2gene_dir}{Path to directory containing transcript to gene maps 31 | produced by \link[dseqr.data]{load_tx2gene}.} 32 | 33 | \item{indices_dir}{Path to directory containing \code{kallisto} indices and whitelists.} 34 | 35 | \item{gs_dir}{Path to directory where gene to Gene Ontology maps produced by \link{get_genego} are saved.} 36 | 37 | \item{add_bulk}{reactive that triggers modal to upload a bulk dataset} 38 | 39 | \item{remove_bulk}{reactive that triggers modal for deleting bulk datasets} 40 | } 41 | \value{ 42 | list with reactive \code{new_dataset} that is triggered with a new 43 | bulk dataset is added. 44 | } 45 | \description{ 46 | to be called with \link[shiny]{callModule} 47 | } 48 | -------------------------------------------------------------------------------- /man/bulkPageUI.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-bulk-ui.R 3 | \name{bulkPageUI} 4 | \alias{bulkPageUI} 5 | \title{UI for Bulk Data page} 6 | \usage{ 7 | bulkPageUI(id, tab, active) 8 | } 9 | \arguments{ 10 | \item{id}{Identification string that is names-paced using \link[shiny]{NS}.} 11 | 12 | \item{tab}{Name to appear on tab} 13 | 14 | \item{active}{Name of current active \code{tab}} 15 | } 16 | \value{ 17 | shiny.tag with html for bulk data tab 18 | } 19 | \description{ 20 | UI for Bulk Data page 21 | } 22 | \examples{ 23 | 24 | bulkPageUI("bulk", tab = 'Bulk Data', active = 'Single Cell') 25 | 26 | } 27 | -------------------------------------------------------------------------------- /man/calcx.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-utils.R 3 | \name{calcx} 4 | \alias{calcx} 5 | \title{Calculate x position for correlation plot} 6 | \usage{ 7 | calcx(cor, range = c(-1, 1), width = 180, pad = 0.1) 8 | } 9 | \arguments{ 10 | \item{cor}{Numeric vector of correlation values.} 11 | 12 | \item{range}{Numeric vector of length 2 specifying maximum and minimum values of \code{cor}.} 13 | 14 | \item{width}{Plot width to scale correlation values to.} 15 | 16 | \item{pad}{Numeric value that is respectively, subtracted and added to values in \code{range}. Make it so that circles and 17 | correlation text values don't get cut off.} 18 | } 19 | \value{ 20 | Numeric vector giving x position for correlation plot in Drugs tab. 21 | } 22 | \description{ 23 | Calculate x position for correlation plot 24 | } 25 | \keyword{internal} 26 | -------------------------------------------------------------------------------- /man/check_bulk_changed.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-bulk-utils.R 3 | \name{check_bulk_changed} 4 | \alias{check_bulk_changed} 5 | \title{Check if newly uploaded pdata is the same as previously uploaded} 6 | \usage{ 7 | check_bulk_changed(prev, pdata) 8 | } 9 | \value{ 10 | \code{TRUE} is \code{pdata} column 'Group name' or 'Pair' is different 11 | from \code{prev} 12 | } 13 | \description{ 14 | Check if newly uploaded pdata is the same as previously uploaded 15 | } 16 | \keyword{internal} 17 | -------------------------------------------------------------------------------- /man/check_gras.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/parse_pug.R 3 | \name{check_gras} 4 | \alias{check_gras} 5 | \title{Check Pubchem PUG-View for GRAS notice} 6 | \usage{ 7 | check_gras(pug_view) 8 | } 9 | \arguments{ 10 | \item{pug_view}{List from reading PUG-View JSON data with \code{\link[rjson]{fromJSON}}} 11 | } 12 | \value{ 13 | Boolean indicating if \code{pug_view} has a GRAS notice. 14 | } 15 | \description{ 16 | Check Pubchem PUG-View for GRAS notice 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/check_has_scseq.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{check_has_scseq} 4 | \alias{check_has_scseq} 5 | \title{Check if folder has single-cell files} 6 | \usage{ 7 | check_has_scseq(dataset_names, sc_dir) 8 | } 9 | \arguments{ 10 | \item{dataset_names}{Character vector of folder names to check} 11 | 12 | \item{sc_dir}{Path to directory with \code{dataset_names} folders} 13 | } 14 | \value{ 15 | Boolean vector with \code{length(dataset_names)} indicating folders that 16 | have single-cell files 17 | } 18 | \description{ 19 | Check if folder has single-cell files 20 | } 21 | -------------------------------------------------------------------------------- /man/check_is_market_matrix.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/import_scseq.R 3 | \name{check_is_market_matrix} 4 | \alias{check_is_market_matrix} 5 | \title{Determine if the selected folder has cellranger market matrix format files} 6 | \usage{ 7 | check_is_market_matrix(data_dir) 8 | } 9 | \arguments{ 10 | \item{data_dir}{path to directory to check.} 11 | } 12 | \value{ 13 | \code{TRUE} if market matrix files detected, otherwise \code{FALSE}. 14 | } 15 | \description{ 16 | Determine if the selected folder has cellranger market matrix format files 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/clean_kb_scseq.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/run_kb_scseq.R 3 | \name{clean_kb_scseq} 4 | \alias{clean_kb_scseq} 5 | \title{Clean up kb output directory} 6 | \usage{ 7 | clean_kb_scseq(data_dir, sample_name = NULL) 8 | } 9 | \arguments{ 10 | \item{data_dir}{Path containing folder 'bus_output'} 11 | 12 | \item{sample_name}{Optional sample name to append to cellranger files} 13 | } 14 | \value{ 15 | Called for side effects 16 | } 17 | \description{ 18 | Clean up kb output directory 19 | } 20 | -------------------------------------------------------------------------------- /man/collapse_sorted.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{collapse_sorted} 4 | \alias{collapse_sorted} 5 | \title{Used to generate file names for single cell analyses.} 6 | \usage{ 7 | collapse_sorted(x, collapse = ",") 8 | } 9 | \arguments{ 10 | \item{x}{Character vector of selected cluster numbers} 11 | } 12 | \value{ 13 | String with sorted cluster numbers comma collapsed. 14 | } 15 | \description{ 16 | Used to generate file names for single cell analyses. 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/construct_path_df.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-path-utils.R 3 | \name{construct_path_df} 4 | \alias{construct_path_df} 5 | \title{Used by get_path_df to construct the return result} 6 | \usage{ 7 | construct_path_df(top_table) 8 | } 9 | \arguments{ 10 | \item{top_table}{Filtered result of \code{\link[limma]{toptable}} 11 | to limit number of plotted genes.} 12 | } 13 | \value{ 14 | \code{data.frame} used for plotting query genes in Drugs tab 15 | } 16 | \description{ 17 | Used by get_path_df to construct the return result 18 | } 19 | \keyword{internal} 20 | -------------------------------------------------------------------------------- /man/construct_pbulk_subsets.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-path-utils.R 3 | \name{construct_pbulk_subsets} 4 | \alias{construct_pbulk_subsets} 5 | \title{Run pseudo bulk limma fit} 6 | \usage{ 7 | construct_pbulk_subsets(summed, method = "TMMwsp", ...) 8 | } 9 | \arguments{ 10 | \item{summed}{Pseudobulk \code{SingleCellExperiment}} 11 | 12 | \item{...}{additional arguments to \link[edgeR]{filterByExpr}} 13 | } 14 | \value{ 15 | Normalized \code{ExpressionSet} 16 | } 17 | \description{ 18 | Run pseudo bulk limma fit 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/create_scseq.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/import_scseq.R 3 | \name{create_scseq} 4 | \alias{create_scseq} 5 | \title{Load kallisto/bustools quantification into a SingleCellExperiment object.} 6 | \usage{ 7 | create_scseq(data_dir, tx2gene_dir, project) 8 | } 9 | \arguments{ 10 | \item{data_dir}{Directory with raw and kallisto/bustools or CellRanger quantified single-cell RNA-Seq files.} 11 | 12 | \item{tx2gene_dir}{Path to directory containing transcript to gene maps 13 | produced by \link[dseqr.data]{load_tx2gene}.} 14 | 15 | \item{project}{String identifying sample.} 16 | } 17 | \value{ 18 | \code{SingleCellExperiment} object with empty droplets removed and ambience in rowData. 19 | } 20 | \description{ 21 | Load kallisto/bustools quantification into a SingleCellExperiment object. 22 | } 23 | \keyword{internal} 24 | -------------------------------------------------------------------------------- /man/customQueryFormInput.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-ui.R 3 | \name{customQueryFormInput} 4 | \alias{customQueryFormInput} 5 | \title{Input form for custom query on Drugs page} 6 | \usage{ 7 | customQueryFormInput(id) 8 | } 9 | \value{ 10 | \code{shiny.tag} 11 | } 12 | \description{ 13 | Input form for custom query on Drugs page 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/datasets_to_list.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{datasets_to_list} 4 | \alias{datasets_to_list} 5 | \title{Convert single-cell datasets data.frame to list} 6 | \usage{ 7 | datasets_to_list(datasets) 8 | } 9 | \arguments{ 10 | \item{datasets}{data.frame of datasets from \link{get_sc_dataset_choices}} 11 | } 12 | \value{ 13 | list 14 | } 15 | \description{ 16 | Used to allow client side updates of single-cell dataset choices. This 17 | is needed to prevent de-selection of current dataset after subset, intgration, 18 | and loading. 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/detect_10x_chemistry.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/run_kb_scseq.R 3 | \name{detect_10x_chemistry} 4 | \alias{detect_10x_chemistry} 5 | \title{Auto Detect 10x Chemistry} 6 | \usage{ 7 | detect_10x_chemistry( 8 | index_dir, 9 | data_dir, 10 | fqs, 11 | techs = c("10XV2", "10XV3"), 12 | threads = 1 13 | ) 14 | } 15 | \arguments{ 16 | \item{index_dir}{Path to kallisto index.} 17 | 18 | \item{data_dir}{Path to folder with 10x fastq.gz files.} 19 | 20 | \item{fqs}{Vector of fastq file names.} 21 | 22 | \item{techs}{10x chemistries to check. Passed to kallisto -x argument.} 23 | 24 | \item{threads}{Number of threads to use. Default is 1.} 25 | } 26 | \value{ 27 | one of \code{techs} corresponding to chemistry with most reads that agree with whitelist. 28 | } 29 | \description{ 30 | Creates samples of 10,000 reads per lane and then determins the number of reads 31 | with barcodes in agreement with the chemistry whitelist. 32 | } 33 | \keyword{internal} 34 | -------------------------------------------------------------------------------- /man/detect_cells.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/scseq_qc.R 3 | \name{detect_cells} 4 | \alias{detect_cells} 5 | \title{Determine non-empty droplets} 6 | \usage{ 7 | detect_cells(counts, qcgenes) 8 | } 9 | \arguments{ 10 | \item{counts}{dgCMatrix of counts} 11 | } 12 | \value{ 13 | Indices of columns of counts corresponding to non-empty droplets 14 | } 15 | \description{ 16 | Determine non-empty droplets 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/diff_abundance.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{diff_abundance} 4 | \alias{diff_abundance} 5 | \title{Run differential abundance analysis} 6 | \usage{ 7 | diff_abundance( 8 | obj, 9 | annot = NULL, 10 | pairs = NULL, 11 | orig.ident = NULL, 12 | filter = TRUE 13 | ) 14 | } 15 | \arguments{ 16 | \item{obj}{\code{SingleCellExperiment} or count matrix} 17 | 18 | \item{orig.ident}{factor of group identities with length \code{ncol(obj)}} 19 | } 20 | \value{ 21 | \code{data.frame} with differential abundance results calculated by 22 | \link[limma]{topTable} 23 | } 24 | \description{ 25 | Run differential abundance analysis 26 | } 27 | \keyword{internal} 28 | -------------------------------------------------------------------------------- /man/dir_exists.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{dir_exists} 4 | \alias{dir_exists} 5 | \title{Safe dir.exists} 6 | \usage{ 7 | dir_exists(x) 8 | } 9 | \arguments{ 10 | \item{x}{directory path} 11 | } 12 | \value{ 13 | a logical vector of TRUE or FALSE values 14 | } 15 | \description{ 16 | Safe dir.exists 17 | } 18 | -------------------------------------------------------------------------------- /man/disableAll.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/server-utils.R 3 | \name{disableAll} 4 | \alias{disableAll} 5 | \title{Disable multiple ids} 6 | \usage{ 7 | disableAll(ids, asis = rep(FALSE, length(ids))) 8 | } 9 | \arguments{ 10 | \item{ids}{Character vector of ids to disable} 11 | } 12 | \value{ 13 | called for side effects 14 | } 15 | \description{ 16 | Disable multiple ids 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/dl_pert_result.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-utils.R 3 | \name{dl_pert_result} 4 | \alias{dl_pert_result} 5 | \title{Download CMAP02/L1000 pert query result from S3} 6 | \usage{ 7 | dl_pert_result(res_path) 8 | } 9 | \arguments{ 10 | \item{res_path}{Path to download file to.} 11 | } 12 | \value{ 13 | \code{NULL}. Called for side effects. 14 | } 15 | \description{ 16 | Download CMAP02/L1000 pert query result from S3 17 | } 18 | \examples{ 19 | 20 | data_dir <- tempdir() 21 | res_path <- file.path(data_dir, 'cmap_res_BRD-K45319408_PC3_5um_24h.rds') 22 | dseqr:::dl_pert_result(res_path) 23 | 24 | } 25 | \keyword{internal} 26 | -------------------------------------------------------------------------------- /man/dl_pert_signature.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-path-utils.R 3 | \name{dl_pert_signature} 4 | \alias{dl_pert_signature} 5 | \title{Download CMAP02/L1000 pert signature from S3} 6 | \usage{ 7 | dl_pert_signature(sig_path, pert_type) 8 | } 9 | \arguments{ 10 | \item{sig_path}{Path to download file to.} 11 | 12 | \item{pert_type}{One of \code{'cmap'}, \code{'l1000_drugs'}, or \code{'l1000_genes'}.} 13 | } 14 | \value{ 15 | \code{NULL}. Called for side effects. 16 | } 17 | \description{ 18 | Download CMAP02/L1000 pert signature from S3 19 | } 20 | \examples{ 21 | data_dir <- tempdir() 22 | sig_path <- file.path(data_dir, '0317956-0000_PC3_1e-06M_6h.rds') 23 | dseqr:::dl_pert_signature(sig_path, pert_type = 'cmap') 24 | 25 | } 26 | \keyword{internal} 27 | -------------------------------------------------------------------------------- /man/download_kb_index.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/run_kb_scseq.R 3 | \name{download_kb_index} 4 | \alias{download_kb_index} 5 | \title{Download pre-built index using kb-python} 6 | \usage{ 7 | download_kb_index(indices_dir, species = c("human", "mouse")) 8 | } 9 | \arguments{ 10 | \item{indices_dir}{directory with indices. Output files will be saved in 11 | indices_dir/kb_version/species/} 12 | 13 | \item{species}{either 'human' or 'mouse'} 14 | } 15 | \value{ 16 | Called for side effects 17 | } 18 | \description{ 19 | Downloads index.idx and t2g.txt. 20 | } 21 | -------------------------------------------------------------------------------- /man/downsample_clusters.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot_scseq.R 3 | \name{downsample_clusters} 4 | \alias{downsample_clusters} 5 | \title{Downsample SingleCellExperiment clusters} 6 | \usage{ 7 | downsample_clusters(scseq, max.cells = 200) 8 | } 9 | \arguments{ 10 | \item{scseq}{SingleCellExperiment} 11 | 12 | \item{max.cells}{maximum number of cells in each \code{scseq$cluster}} 13 | } 14 | \value{ 15 | scseq 16 | } 17 | \description{ 18 | Gets a maximum number of cells in each cluster. Used for generate mini 19 | datasets for faster label transfer. 20 | } 21 | \keyword{internal} 22 | -------------------------------------------------------------------------------- /man/dropdownMenuButton.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ui-utils.R 3 | \name{dropdownMenuButton} 4 | \alias{dropdownMenuButton} 5 | \title{Dropdown menu button for dsLabelRowsUI} 6 | \usage{ 7 | dropdownMenuButton(id, label) 8 | } 9 | \value{ 10 | \code{shiny.tag} 11 | } 12 | \description{ 13 | Dropdown menu button for dsLabelRowsUI 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/drugsFormInput.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-ui.R 3 | \name{drugsFormInput} 4 | \alias{drugsFormInput} 5 | \title{Input form for Drugs page} 6 | \usage{ 7 | drugsFormInput(id) 8 | } 9 | \value{ 10 | \code{shiny.tag} 11 | } 12 | \description{ 13 | Input form for Drugs page 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/drugsGenesPlotlyOutput.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-ui.R 3 | \name{drugsGenesPlotlyOutput} 4 | \alias{drugsGenesPlotlyOutput} 5 | \title{UI for query/drug genes plotly} 6 | \usage{ 7 | drugsGenesPlotlyOutput(id) 8 | } 9 | \value{ 10 | \code{shiny.tag} 11 | } 12 | \description{ 13 | UI for query/drug genes plotly 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/drugsPage.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-server.R 3 | \name{drugsPage} 4 | \alias{drugsPage} 5 | \title{Logic for Drugs Tab} 6 | \usage{ 7 | drugsPage( 8 | input, 9 | output, 10 | session, 11 | project_dir, 12 | pert_query_dir, 13 | pert_signature_dir, 14 | tx2gene_dir 15 | ) 16 | } 17 | \arguments{ 18 | \item{input, output, session}{standard shiny module boilerplate} 19 | 20 | \item{project_dir}{path to folder with project files} 21 | 22 | \item{pert_query_dir}{Path to directory where pert query results (using CMAP02/L1000 as query signature) will be downloaded as requested.} 23 | 24 | \item{pert_signature_dir}{Path to directory where pert signatures for CMAP02/L1000 will be downloaded as requested.} 25 | 26 | \item{tx2gene_dir}{Path to directory containing transcript to gene maps 27 | produced by \link[dseqr.data]{load_tx2gene}.} 28 | } 29 | \value{ 30 | Called with \link[shiny]{callModule} to generate logic for 31 | single-cell tab. 32 | } 33 | \description{ 34 | Logic for Drugs Tab 35 | } 36 | -------------------------------------------------------------------------------- /man/drugsPageUI.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-ui.R 3 | \name{drugsPageUI} 4 | \alias{drugsPageUI} 5 | \title{UI for Drugs page} 6 | \usage{ 7 | drugsPageUI(id, tab, active) 8 | } 9 | \arguments{ 10 | \item{id}{Identification string that is names-paced using \link[shiny]{NS}.} 11 | 12 | \item{tab}{Name to appear on tab} 13 | 14 | \item{active}{Name of current active \code{tab}} 15 | } 16 | \value{ 17 | shiny.tag with html for drugs tab 18 | } 19 | \description{ 20 | UI for Drugs page 21 | } 22 | \examples{ 23 | 24 | drugsPageUI("drug", tab = 'Drugs', active = 'Single Cell') 25 | 26 | } 27 | -------------------------------------------------------------------------------- /man/drugsTableOutput.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-ui.R 3 | \name{drugsTableOutput} 4 | \alias{drugsTableOutput} 5 | \title{Output table for Drugs Page} 6 | \usage{ 7 | drugsTableOutput(id) 8 | } 9 | \value{ 10 | \code{shiny.tag} 11 | } 12 | \description{ 13 | Output table for Drugs Page 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/enableAll.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/server-utils.R 3 | \name{enableAll} 4 | \alias{enableAll} 5 | \title{Enable multiple ids} 6 | \usage{ 7 | enableAll(ids, asis = rep(FALSE, length(ids))) 8 | } 9 | \arguments{ 10 | \item{ids}{Character vector of ids to enable} 11 | } 12 | \value{ 13 | No return value. Called for side effects. 14 | } 15 | \description{ 16 | Enable multiple ids 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/evaluate_custom_metric.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{evaluate_custom_metric} 4 | \alias{evaluate_custom_metric} 5 | \title{Evaluate custom single-cell metric} 6 | \usage{ 7 | evaluate_custom_metric(metric, scseq) 8 | } 9 | \arguments{ 10 | \item{metric}{String with metric to evaluate} 11 | 12 | \item{scseq}{\code{SingleCellExperiment} to evaluate \code{metric} for.} 13 | } 14 | \value{ 15 | data.frame with column name \code{metric} and result. 16 | } 17 | \description{ 18 | Evaluate custom single-cell metric 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/file_exists.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{file_exists} 4 | \alias{file_exists} 5 | \title{Safe file.exists} 6 | \usage{ 7 | file_exists(x) 8 | } 9 | \arguments{ 10 | \item{x}{file path} 11 | } 12 | \value{ 13 | a logical vector of TRUE or FALSE values 14 | } 15 | \description{ 16 | Safe file.exists 17 | } 18 | -------------------------------------------------------------------------------- /man/filter_clinical.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/format_query_table.R 3 | \name{filter_clinical} 4 | \alias{filter_clinical} 5 | \title{Subset by clinical phase} 6 | \usage{ 7 | filter_clinical(query_table_nsig, show_clinical) 8 | } 9 | \arguments{ 10 | \item{query_table_nsig}{result of \link{filter_nsig}} 11 | 12 | \item{show_clinical}{if \code{TRUE}, only drugs with a clinical phase annotation are kept.} 13 | } 14 | \value{ 15 | \code{query_table_nsig}. 16 | Drugs without a clinical phase annotation are removed if \code{show_clinical} is \code{FALSE} 17 | } 18 | \description{ 19 | Subset by clinical phase 20 | } 21 | \keyword{internal} 22 | -------------------------------------------------------------------------------- /man/filter_nsig.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/format_query_table.R 3 | \name{filter_nsig} 4 | \alias{filter_nsig} 5 | \title{Subset by min signatures} 6 | \usage{ 7 | filter_nsig(query_table_summarised, min_signatures) 8 | } 9 | \arguments{ 10 | \item{query_table_summarised}{result of \link{summarise_query_table}} 11 | 12 | \item{min_signatures}{Number of independent perturbagen signatures below which a perturbation is excluded. Default is \code{3}.} 13 | } 14 | \value{ 15 | \code{query_table_summarised} with drugs filtered that contain fewer than \code{min_signatures}. 16 | } 17 | \description{ 18 | Subset by min signatures 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/format_dl_annot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-bulk-utils.R 3 | \name{format_dl_annot} 4 | \alias{format_dl_annot} 5 | \title{Format downloaded annotation} 6 | \usage{ 7 | format_dl_annot(annot) 8 | } 9 | \description{ 10 | Format downloaded annotation 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/format_query_res.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/format_query_table.R 3 | \name{format_query_res} 4 | \alias{format_query_res} 5 | \title{Format perturbation query result like web app.} 6 | \usage{ 7 | format_query_res( 8 | query_res, 9 | drug_study, 10 | sort_by = c("avg_cor", "min_cor"), 11 | direction = c("opposing", "similar", "both"), 12 | sort_abs = FALSE, 13 | show_clinical = TRUE, 14 | min_signatures = 3, 15 | cells = NULL 16 | ) 17 | } 18 | \arguments{ 19 | \item{query_res}{Numeric vector of correlation values with names as HGNC symbols} 20 | 21 | \item{drug_study}{Queried database giving rise to \code{query_res}. 22 | One of \code{'CMAP02'},\code{'L1000 Genetic'}, or \code{'L1000 Drugs'}.} 23 | 24 | \item{sort_by}{Metric to sort by. Either \code{'avg_cor'} (default) or \code{'min_cor'}.} 25 | 26 | \item{direction}{Direction of correlation to sort results by. One of \code{'both'}, \code{'similar'}, or \code{'opposing'} (default).} 27 | 28 | \item{sort_abs}{Should results be sorted based on absolute correlation? Default is \code{FALSE}.} 29 | 30 | \item{show_clinical}{Should result only contain drugs with clinical phase annotation? Default is \code{TRUE}.} 31 | 32 | \item{min_signatures}{Number of independent perturbagen signatures below which a perturbation is excluded. Default is \code{3}.} 33 | 34 | \item{cells}{Character vector of cell types to include. Default (\code{NULL}) includes all cell types.} 35 | } 36 | \value{ 37 | \code{data.frame} with annotated, filtered, and sorted query result. 38 | } 39 | \description{ 40 | Used to get unfiltered query table from downloaded perturbation query result. A condensed top-hits is shown in the 41 | web app for performance reasons. 42 | } 43 | \examples{ 44 | 45 | # generate fake result 46 | annot <- dseqr:::get_drugs_table('L1000_drugs') 47 | query_res <- rnorm(nrow(annot), 0, 0.25) 48 | names(query_res) <- annot$title 49 | formatted <- dseqr:::format_query_res(query_res, 'L1000 Drugs', sort_by = 'min_cor') 50 | 51 | } 52 | \keyword{internal} 53 | -------------------------------------------------------------------------------- /man/format_up_annot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-bulk-utils.R 3 | \name{format_up_annot} 4 | \alias{format_up_annot} 5 | \title{Format uploaded annotation} 6 | \usage{ 7 | format_up_annot(up, ref) 8 | } 9 | \description{ 10 | Format uploaded annotation 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/format_up_custom.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-utils.R 3 | \name{format_up_custom} 4 | \alias{format_up_custom} 5 | \title{Format uploaded custom query signature} 6 | \usage{ 7 | format_up_custom(top_table) 8 | } 9 | \arguments{ 10 | \item{top_table}{data.frame with logFC, dprime, or effect sizes as column 1 11 | and row.names as HGNC symbols} 12 | } 13 | \value{ 14 | \code{top_table} subsetted to rows with HGNC symbols in CMAP02/L1000 and 15 | with dprime column set to either \code{top_table$dprime}, \code{top_table$logFC}, 16 | or \code{top_table[,1]}. 17 | } 18 | \description{ 19 | Format uploaded custom query signature 20 | } 21 | \keyword{internal} 22 | -------------------------------------------------------------------------------- /man/from_crossmeta.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/from_crossmeta.R 3 | \name{from_crossmeta} 4 | \alias{from_crossmeta} 5 | \title{Covert from crossmeta to dseqr formats} 6 | \usage{ 7 | from_crossmeta(gse_name, data_dir) 8 | } 9 | \arguments{ 10 | \item{gse_name}{Name of GSE accession dataset, must be folder in data_dir} 11 | 12 | \item{data_dir}{directory that contains \code{gse_name} folder} 13 | } 14 | \description{ 15 | Convert a microarray ExpressionSet saved with 'crossmeta' into a format 16 | for direct usage in 'dseqr'. 17 | } 18 | \examples{ 19 | library(Biobase) 20 | 21 | # generate example eset 22 | sd <- 0.3*sqrt(4/rchisq(1000,df=4)) 23 | y <- matrix(rnorm(1000*6,sd=sd),1000,6) 24 | rownames(y) <- paste("Gene",1:1000) 25 | y[1:2,4:6] <- y[1:2,4:6] + 2 26 | 27 | y[100:200, c(1,2,6)] <- y[100:200, c(1,2,6)] + 0.5 28 | 29 | pdata <- data.frame(group = c(rep('healthy', 3), rep('disease', 3))) 30 | fdata <- data.frame(SYMBOL = row.names(y), 31 | PROBE = row.names(y), 32 | row.names = row.names(y)) 33 | 34 | eset <- ExpressionSet(y, 35 | phenoData = as(pdata, 'AnnotatedDataFrame'), 36 | featureData = as(fdata, 'AnnotatedDataFrame')) 37 | 38 | 39 | # save 40 | eset <- list(GSE1=eset) 41 | data_dir <- tempdir() 42 | gse_dir <- file.path(data_dir, 'GSE1') 43 | dir.create(gse_dir) 44 | saveRDS(eset, file.path(gse_dir, 'GSE1_eset.rds')) 45 | 46 | from_crossmeta('GSE1', data_dir) 47 | 48 | } 49 | -------------------------------------------------------------------------------- /man/getDeleteRowButtons.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{getDeleteRowButtons} 4 | \alias{getDeleteRowButtons} 5 | \title{Get HTML to make delete buttons in datatable rows} 6 | \usage{ 7 | getDeleteRowButtons(session, len, title = "Delete file") 8 | } 9 | \arguments{ 10 | \item{session}{Shiny session object used for namespacing.} 11 | 12 | \item{len}{Numeric number of rows} 13 | 14 | \item{title}{Title for buttons. Default is \code{'Delete file'}} 15 | } 16 | \value{ 17 | Character vector with length \code{len} with delete buttons. Event 18 | can be observed in a reactive by \code{input$delete_row} and the row clicked 19 | will have have \code{'input$delete_row_i'} where 'i' is the row. 20 | } 21 | \description{ 22 | Get HTML to make delete buttons in datatable rows 23 | } 24 | -------------------------------------------------------------------------------- /man/get_ambience.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/import_scseq.R 3 | \name{get_ambience} 4 | \alias{get_ambience} 5 | \title{Get sample ambience profiles} 6 | \usage{ 7 | get_ambience(combined) 8 | } 9 | \arguments{ 10 | \item{combined}{\code{SingleCellExperiment} object.} 11 | } 12 | \value{ 13 | matrix of ambience profiles for each sample 14 | } 15 | \description{ 16 | Get sample ambience profiles 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/get_boxplotly_cell_args.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-bulk-utils.R 3 | \name{get_boxplotly_cell_args} 4 | \alias{get_boxplotly_cell_args} 5 | \title{Get arguments for cells boxplotly} 6 | \usage{ 7 | get_boxplotly_cell_args(pdata, dtangle_est, dataset_name, contrast) 8 | } 9 | \arguments{ 10 | \item{pdata}{data.frame of phenotype data.} 11 | 12 | \item{dtangle_est}{data.frame of proportion estimates from dtangle.} 13 | 14 | \item{dataset_name}{Name of bulk dataset.} 15 | } 16 | \value{ 17 | List with items \code{'df'}, \code{'boxgap'}, \code{'boxgroupgap'}, and \code{'plot_fname'}. 18 | } 19 | \description{ 20 | Get arguments for cells boxplotly 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /man/get_boxplotly_gene_args.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-bulk-utils.R 3 | \name{get_boxplotly_gene_args} 4 | \alias{get_boxplotly_gene_args} 5 | \title{Get arguments for gene boxplotly} 6 | \usage{ 7 | get_boxplotly_gene_args(eset, explore_genes, dataset_name) 8 | } 9 | \arguments{ 10 | \item{eset}{ExpressionSet object with \code{'adjusted'} assayDataElement} 11 | 12 | \item{explore_genes}{Character vector of genes to plot} 13 | 14 | \item{dataset_name}{Name of bulk dataset.} 15 | } 16 | \value{ 17 | List with items \code{'df'}, \code{'boxgap'}, \code{'boxgroupgap'}, and \code{'plot_fname'}. 18 | } 19 | \description{ 20 | Get arguments for gene boxplotly 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /man/get_cell_choices.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-utils.R 3 | \name{get_cell_choices} 4 | \alias{get_cell_choices} 5 | \title{Get cell choices data.frame for CMAP02 or L1000} 6 | \usage{ 7 | get_cell_choices(drug_study) 8 | } 9 | \arguments{ 10 | \item{drug_study}{either 'CMAP02', 'L1000 Drugs', or 'L1000 Genetic'} 11 | } 12 | \value{ 13 | data.frame 14 | } 15 | \description{ 16 | Get cell choices data.frame for CMAP02 or L1000 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/get_cluster_choices.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{get_cluster_choices} 4 | \alias{get_cluster_choices} 5 | \title{Get cluster choices data.frame for selectize dropdown} 6 | \usage{ 7 | get_cluster_choices(clusters, sample_comparison = FALSE, with_all = FALSE, ...) 8 | } 9 | \arguments{ 10 | \item{clusters}{Character vector of cluster names} 11 | 12 | \item{sample_comparison}{is this for test vs control comparion? Default is \code{FALSE}.} 13 | 14 | \item{...}{Named arguments to \code{\link{get_cluster_stats}}.} 15 | } 16 | \value{ 17 | data.frame with columns for rendering selectizeInput cluster choices 18 | } 19 | \description{ 20 | Get cluster choices data.frame for selectize dropdown 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /man/get_cluster_markers.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-path-utils.R 3 | \name{get_cluster_markers} 4 | \alias{get_cluster_markers} 5 | \title{Loads markers for single cell cluster} 6 | \usage{ 7 | get_cluster_markers(selected_clusters, dataset_dir) 8 | } 9 | \arguments{ 10 | \item{selected_clusters}{Character vector of integers} 11 | 12 | \item{dataset_dir}{Directory to folder with single-cell dataset} 13 | } 14 | \value{ 15 | data.frame with markers 16 | } 17 | \description{ 18 | Loads markers for single cell cluster 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/get_cluster_stats.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{get_cluster_stats} 4 | \alias{get_cluster_stats} 5 | \title{Get and save cluster stats for single-cell related selectizeInputs} 6 | \usage{ 7 | get_cluster_stats( 8 | resoln_dir = NULL, 9 | scseq = NULL, 10 | top_tables = NULL, 11 | use_disk = FALSE, 12 | sample_comparison = FALSE, 13 | contrast_dir = NULL 14 | ) 15 | } 16 | \arguments{ 17 | \item{resoln_dir}{Sub directory with single cell dataset info specific to resolution.} 18 | 19 | \item{scseq}{\code{SingleCellExperiment} object to get/save stats for. 20 | if \code{NULL} (Default), will be loaded.} 21 | 22 | \item{top_tables}{List of \code{limma::topTable} results used by 23 | scSampleComparison for integrated datasets.} 24 | 25 | \item{use_disk}{Should results by saved to disk? used by scSampleComparison 26 | to persist results to disk.} 27 | 28 | \item{sample_comparison}{is this for test vs control comparion? Default is \code{FALSE}.} 29 | 30 | \item{contrast_dir}{Sub directory with single cell dataset info specific to contrast.} 31 | } 32 | \value{ 33 | List with cluster stats 34 | } 35 | \description{ 36 | Get and save cluster stats for single-cell related selectizeInputs 37 | } 38 | -------------------------------------------------------------------------------- /man/get_contrast_choices.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{get_contrast_choices} 4 | \alias{get_contrast_choices} 5 | \title{Get contrast choices data.frame for selectize dropdown} 6 | \usage{ 7 | get_contrast_choices(clusters, test) 8 | } 9 | \arguments{ 10 | \item{clusters}{Character vector of cluster names} 11 | 12 | \item{test}{Name of test contrast} 13 | } 14 | \value{ 15 | data.frame with columns for rendering selectizeInput contrast choices 16 | } 17 | \description{ 18 | Get contrast choices data.frame for selectize dropdown 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/get_contrast_markers.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{get_contrast_markers} 4 | \alias{get_contrast_markers} 5 | \title{Get markers for one cluster against one other cluster} 6 | \usage{ 7 | get_contrast_markers(con, markers) 8 | } 9 | \arguments{ 10 | \item{con}{String identifying clusters to compare e.g. \code{'1vs2'}} 11 | } 12 | \value{ 13 | Named list with data.frames for each comparison direction 14 | } 15 | \description{ 16 | Get markers for one cluster against one other cluster 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/get_cors_html.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-utils.R 3 | \name{get_cors_html} 4 | \alias{get_cors_html} 5 | \title{Get HTML for correlation values.} 6 | \usage{ 7 | get_cors_html(cors, titles, cor_titles, cors_range) 8 | } 9 | \arguments{ 10 | \item{cors}{List of numeric vectors of pearson correlations.} 11 | 12 | \item{titles}{List of character vectors of treatment titles for pearson correlations (e.g. MCF7_1e-05M_6h_3).} 13 | 14 | \item{cor_titles}{List of character vectors used for title element. Used 15 | to allow right click on correlation point to load query for perturbation signature.} 16 | 17 | \item{cors_range}{Numeric vector of length two specifying the range of correlation values.} 18 | } 19 | \value{ 20 | Character vector of HTML markup for the title/circle/text for a correlation plot. 21 | } 22 | \description{ 23 | Get HTML for correlation values. 24 | } 25 | \keyword{internal} 26 | -------------------------------------------------------------------------------- /man/get_dist.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/diff_utils.R 3 | \name{get_dist} 4 | \alias{get_dist} 5 | \title{Enhanced Distance Matrix Computation and Visualization} 6 | \usage{ 7 | get_dist(x, method = "euclidean", stand = FALSE, ...) 8 | } 9 | \arguments{ 10 | \item{x}{a numeric matrix or a data frame.} 11 | 12 | \item{method}{the distance measure to be used. This must be one of 13 | "euclidean", "maximum", "manhattan", "canberra", "binary", "minkowski", 14 | "pearson", "spearman" or "kendall".} 15 | 16 | \item{stand}{logical value; default is FALSE. If TRUE, then the data will be 17 | standardized using the function scale(). Measurements are standardized for 18 | each variable (column), by subtracting the variable's mean value and 19 | dividing by the variable's standard deviation.} 20 | 21 | \item{...}{other arguments to be passed to the function dist() when using get_dist().} 22 | } 23 | \value{ 24 | \itemize{ \item get_dist(): returns an object of class "dist". \item 25 | fviz_dist(): returns a ggplot2 } 26 | } 27 | \description{ 28 | Clustering methods classify data samples into groups of similar 29 | objects. This process requires some methods for measuring the distance or 30 | the (dis)similarity between the observations. Read more: 31 | \href{http://www.sthda.com/english/wiki/clarifying-distance-measures-unsupervised-machine-learning}{STHDA 32 | website - clarifying distance measures.}. \itemize{ \item get_dist(): 33 | Computes a distance matrix between the rows of a data matrix. Compared to 34 | the standard \code{\link[stats]{dist}}() function, it supports 35 | correlation-based distance measures including "pearson", "kendall" and 36 | "spearman" methods. \item fviz_dist(): Visualizes a distance matrix } 37 | } 38 | \examples{ 39 | data(USArrests) 40 | res.dist <- dseqr:::get_dist(USArrests, stand = TRUE, method = "pearson") 41 | } 42 | \seealso{ 43 | \code{\link[stats]{dist}} 44 | } 45 | \author{ 46 | Alboukadel Kassambara \email{alboukadel.kassambara@gmail.com} 47 | } 48 | \keyword{internal} 49 | -------------------------------------------------------------------------------- /man/get_dprimes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/query_utils.R 3 | \name{get_dprimes} 4 | \alias{get_dprimes} 5 | \title{Get dprime effect size values.} 6 | \usage{ 7 | get_dprimes(top_table) 8 | } 9 | \arguments{ 10 | \item{top_table}{data.frame of differential expression results.} 11 | } 12 | \value{ 13 | Named numeric vector. Names are gene names, values are effect size values. 14 | } 15 | \description{ 16 | These are used to query against drug effect size matrices. 17 | } 18 | \examples{ 19 | 20 | # generate fake previous result 21 | top_table <- data.frame(dprimes=rnorm(5), row.names = paste0('gene', 1:5)) 22 | 23 | dprimes <- dseqr:::get_dprimes(top_table) 24 | 25 | } 26 | \keyword{internal} 27 | -------------------------------------------------------------------------------- /man/get_drug_paths.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-utils.R 3 | \name{get_drug_paths} 4 | \alias{get_drug_paths} 5 | \title{Get file paths to drug query results} 6 | \usage{ 7 | get_drug_paths(data_dir, suffix, ftype = ".qs") 8 | } 9 | \arguments{ 10 | \item{data_dir}{Folder with drug query results} 11 | 12 | \item{suffix}{string that appears after e.g. \code{'cmap_res_'} in the drug query result filenames.} 13 | } 14 | \value{ 15 | List with file paths to drug query results 16 | } 17 | \description{ 18 | Get file paths to drug query results 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/get_drugbank.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/parse_pug.R 3 | \name{get_drugbank} 4 | \alias{get_drugbank} 5 | \title{Extract DrugBank URL from PUG-View} 6 | \usage{ 7 | get_drugbank(pug_view) 8 | } 9 | \arguments{ 10 | \item{pug_view}{List from reading PUG-View JSON data with \code{\link[rjson]{fromJSON}}} 11 | } 12 | \value{ 13 | Character vector with DrugBank ID or NA if none exists 14 | } 15 | \description{ 16 | Extract DrugBank URL from PUG-View 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/get_drugs_table.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/get_drugs_table.R 3 | \name{get_drugs_table} 4 | \alias{get_drugs_table} 5 | \title{Get Drugs metadata table for CMAP02 or L1000} 6 | \usage{ 7 | get_drugs_table(study) 8 | } 9 | \arguments{ 10 | \item{study}{either \code{'CMAP02'} or \code{'L1000_genes'} or \code{'L1000_drugs'}} 11 | } 12 | \value{ 13 | \code{data.frame} of meta data for CMAP02 or L1000 14 | } 15 | \description{ 16 | Get Drugs metadata table for CMAP02 or L1000 17 | } 18 | \examples{ 19 | 20 | cmap_meta <- dseqr:::get_drugs_table('CMAP02') 21 | l1000_meta <- dseqr:::get_drugs_table('L1000_genes') 22 | 23 | } 24 | \keyword{internal} 25 | -------------------------------------------------------------------------------- /man/get_expression_colors.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{get_expression_colors} 4 | \alias{get_expression_colors} 5 | \title{Get expression colors for scatterplot} 6 | \usage{ 7 | get_expression_colors(ft.scaled) 8 | } 9 | \arguments{ 10 | \item{ft.scaled}{expression values scaled from 0 to 1} 11 | } 12 | \value{ 13 | character vector of colors 14 | } 15 | \description{ 16 | Get expression colors for scatterplot 17 | } 18 | \examples{ 19 | 20 | ft <- rnorm(100) 21 | ft.scaled <- scales::rescale(ft) 22 | colors <- get_expression_colors(ft.scaled) 23 | 24 | } 25 | -------------------------------------------------------------------------------- /man/get_founder.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{get_founder} 4 | \alias{get_founder} 5 | \title{Determine the founder of a single-cell dataset} 6 | \usage{ 7 | get_founder(sc_dir, dataset_name) 8 | } 9 | \arguments{ 10 | \item{sc_dir}{Directory with single-cell datasets.} 11 | 12 | \item{dataset_name}{Name of dataset to determine founder for.} 13 | } 14 | \value{ 15 | Name of founder. 16 | } 17 | \description{ 18 | Founder is not necesarily the parent, but rather the original ancestor. 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/get_genego.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-path-utils.R 3 | \name{get_genego} 4 | \alias{get_genego} 5 | \title{Get gene to GO map for pathway analysis} 6 | \usage{ 7 | get_genego(species = "Hs", gs_dir = NULL) 8 | } 9 | \arguments{ 10 | \item{species}{Species identifier} 11 | 12 | \item{gs_dir}{Directory to save genego to} 13 | } 14 | \value{ 15 | genego 16 | } 17 | \description{ 18 | Get gene to GO map for pathway analysis 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/get_gonames.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-path-utils.R 3 | \name{get_gonames} 4 | \alias{get_gonames} 5 | \title{Get names of gene set} 6 | \usage{ 7 | get_gonames(genego, gs_dir = NULL) 8 | } 9 | \arguments{ 10 | \item{genego}{result of \code{\link{get_genego}}} 11 | 12 | \item{gs_dir}{Directory to save results to} 13 | } 14 | \value{ 15 | Description of \code{gslist} gene sets 16 | } 17 | \description{ 18 | Get names of gene set 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/get_group_levels.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-bulk-utils.R 3 | \name{get_group_levels} 4 | \alias{get_group_levels} 5 | \title{Get group levels for bulk data plots} 6 | \usage{ 7 | get_group_levels(pdata) 8 | } 9 | \arguments{ 10 | \item{pdata}{Data.frame of phenotype data} 11 | } 12 | \description{ 13 | Get group levels for bulk data plots 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/get_label_transfer_choices.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{get_label_transfer_choices} 4 | \alias{get_label_transfer_choices} 5 | \title{Get label transfer choices data.frame} 6 | \usage{ 7 | get_label_transfer_choices(anal_options, selected_anal, preds) 8 | } 9 | \arguments{ 10 | \item{anal_options}{Names list of analysis options with names \code{'Individual'} and \code{'Integrated'}.} 11 | 12 | \item{preds}{Named list of predicted cluster labels. Names are values in \code{anal_options} lists.} 13 | } 14 | \value{ 15 | data.frame with columns \code{value}, \code{label}, \code{type}, and \code{preds}. 16 | } 17 | \description{ 18 | Used for Single Cell tab label transfer selectizeInput 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/get_mds.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/diff_utils.R 3 | \name{get_mds} 4 | \alias{get_mds} 5 | \title{Get scalings for MDS plots} 6 | \usage{ 7 | get_mds(exprs, adj, group) 8 | } 9 | \arguments{ 10 | \item{exprs}{\code{matrix} of expression values.} 11 | 12 | \item{adj}{\code{matrix} of expression values with surrogate variables/pairs regressed out.} 13 | 14 | \item{group}{Character vector with values \code{'control'} and \code{'test'} indicating group membership.} 15 | } 16 | \value{ 17 | List of tibbles with MDS scalings with and without SVA 18 | } 19 | \description{ 20 | For interactive MDS plot of expression values with and without surrogate variable analysis. 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /man/get_metric_choices.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{get_metric_choices} 4 | \alias{get_metric_choices} 5 | \title{Get choices data.frame for custom metrics (for subsetting)} 6 | \usage{ 7 | get_metric_choices(scseq) 8 | } 9 | \arguments{ 10 | \item{scseq}{\code{SingleCellExperiment}} 11 | } 12 | \value{ 13 | data.frame 14 | } 15 | \description{ 16 | Get choices data.frame for custom metrics (for subsetting) 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/get_metric_features.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{get_metric_features} 4 | \alias{get_metric_features} 5 | \title{Get features from custom metric} 6 | \usage{ 7 | get_metric_features(metric) 8 | } 9 | \arguments{ 10 | \item{metric}{Custom metric to extract features from.} 11 | } 12 | \value{ 13 | Character vector of feature names extracted from \code{metric} 14 | } 15 | \description{ 16 | Get features from custom metric 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/get_nearest_row.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{get_nearest_row} 4 | \alias{get_nearest_row} 5 | \title{Search for closest row in a truth matrix for each row in a test matrix.} 6 | \usage{ 7 | get_nearest_row(truth, test) 8 | } 9 | \arguments{ 10 | \item{truth}{matrix to pick nearest from for all rows in \code{test}.} 11 | 12 | \item{test}{matrix to test each row of and find closest rows in \code{truth}.} 13 | } 14 | \value{ 15 | vector of rows in \code{truth} that are the nearest to each row in \code{test}. 16 | } 17 | \description{ 18 | from Stack Overflow: 40668623 19 | } 20 | \examples{ 21 | set.seed(123) ## for reproducibility 22 | D <- 2 #amount of dimensions 23 | K <- 5 24 | events <- 2*K #number of events 25 | truth <- matrix(data=runif(events, min = 0, max = 1), nrow=K) 26 | E <- 2 27 | test <- matrix(data=runif(2*E, min = 0, max = 1), nrow=E) 28 | 29 | \dontrun{ 30 | #[1] 4 3 31 | get_nearest_row(truth, test) 32 | } 33 | 34 | } 35 | \keyword{internal} 36 | -------------------------------------------------------------------------------- /man/get_npc_choices.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/import_scseq.R 3 | \name{get_npc_choices} 4 | \alias{get_npc_choices} 5 | \title{Get number of clusters different number of PCs} 6 | \usage{ 7 | get_npc_choices(sce, type = "PCA") 8 | } 9 | \arguments{ 10 | \item{sce}{\code{SingleCellExperiement}} 11 | } 12 | \value{ 13 | result of \code{scran::getClusteredPCs} 14 | } 15 | \description{ 16 | Used to pick number of PCs to retain 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/get_open_a.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-utils.R 3 | \name{get_open_a} 4 | \alias{get_open_a} 5 | \title{Get Opening HTML a Tag} 6 | \usage{ 7 | get_open_a(pre_url, ids, post_url, title) 8 | } 9 | \arguments{ 10 | \item{pre_url}{Character with url portion to paste before \code{id_col} column values.} 11 | 12 | \item{ids}{non \code{NA} ids to be inserted between \code{pre_url} and \code{post_url} to form the link.} 13 | 14 | \item{post_url}{Character with url portion to paste before \code{id_col} column values.} 15 | 16 | \item{title}{Character that will be added to hyperlink title attribute. Default is \code{id_col}.} 17 | } 18 | \value{ 19 | Character vector of opening HTML a tags 20 | } 21 | \description{ 22 | If there are multiple-entry \code{ids} (e.g. \code{'2250, | 60823'}), the first entry 23 | is added to the href attribute and subsequent entries are added to onclick javascript. 24 | } 25 | \keyword{internal} 26 | -------------------------------------------------------------------------------- /man/get_palette.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot_scseq.R 3 | \name{get_palette} 4 | \alias{get_palette} 5 | \title{Get a pallete for cluster plots} 6 | \usage{ 7 | get_palette(levs, dark = FALSE, with_all = FALSE) 8 | } 9 | \arguments{ 10 | \item{levs}{Character vector of levels to get colour pallete for.} 11 | 12 | \item{dark}{Use dark palettes? Default is \code{FALSE}.} 13 | 14 | \item{with_all}{if \code{TRUE}, adds an additional level to get colors for. 15 | Default is \code{FALSE}} 16 | } 17 | \value{ 18 | Character vector with colour codes of \code{length(levs)}. 19 | } 20 | \description{ 21 | Get a pallete for cluster plots 22 | } 23 | \examples{ 24 | levs <- c('CD14 Mono', 'CD16 Mono', 'NK Cells') 25 | get_palette(levs) 26 | 27 | } 28 | -------------------------------------------------------------------------------- /man/get_path_df.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-path-utils.R 3 | \name{get_path_df} 4 | \alias{get_path_df} 5 | \title{Get data.frame for plotting gene expression values of a pathway} 6 | \usage{ 7 | get_path_df(top_table, path_id = NULL, pert_signature = NULL, nmax = 200) 8 | } 9 | \arguments{ 10 | \item{path_id}{String with KEGG pathway id.} 11 | 12 | \item{nmax}{Maximum number of genes to keep from CMAP02/L1000 common and CMAP02 only genes for Drug and genetic query genes. Default is 200 13 | so that all drug and genetic query genes are shown.} 14 | } 15 | \value{ 16 | \code{data.frame} with columns: \itemize{ 17 | \item Gene gene names. 18 | \item Dprime standardized unbiased effect size values. 19 | \item sd standard deviations of \code{Dprime}. 20 | \item Link url to GeneCards page for gene. 21 | } 22 | } 23 | \description{ 24 | Get data.frame for plotting gene expression values of a pathway 25 | } 26 | \keyword{internal} 27 | -------------------------------------------------------------------------------- /man/get_path_res.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-bulk-utils.R 3 | \name{get_path_res} 4 | \alias{get_path_res} 5 | \title{Get and save pathway results for ebfit object} 6 | \usage{ 7 | get_path_res( 8 | de, 9 | goana_path, 10 | gs_dir, 11 | species = "Hs", 12 | genego = NULL, 13 | gonames = NULL, 14 | coef = ncol(de), 15 | nmin = 50, 16 | max_fdr = 0.05, 17 | min_abs_logfc = 0 18 | ) 19 | } 20 | \arguments{ 21 | \item{de}{Result of \code{\link[crossmeta]{fit_ebayes}} or 22 | \code{link[crossmeta]{get_top_table}}} 23 | 24 | \item{goana_path}{Path to save goana Gene Ontology result} 25 | } 26 | \value{ 27 | List with GO and KEGG results 28 | } 29 | \description{ 30 | Used to avoid code reuse for single-cell and bulk 31 | } 32 | \keyword{internal} 33 | -------------------------------------------------------------------------------- /man/get_pred_annot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{get_pred_annot} 4 | \alias{get_pred_annot} 5 | \title{Get predicted annotation for label transfer} 6 | \usage{ 7 | get_pred_annot(ref_preds, ref_name, dataset_name, sc_dir) 8 | } 9 | \arguments{ 10 | \item{ref_preds}{data.frame generated in \code{labelTransferForm} on event \code{submit_transfer}} 11 | 12 | \item{ref_name}{Name of reference analysis that labels are transfered from.} 13 | 14 | \item{dataset_name}{Name of analysis that labels are transfered to.} 15 | 16 | \item{sc_dir}{Directory containing folders with analyses for \code{ref_name} and \code{dataset_name}.} 17 | } 18 | \value{ 19 | Character vector of predicted labels from \code{ref_name}. 20 | } 21 | \description{ 22 | Clusters with an average prediction scores below \code{min.score} retain their original labels. 23 | } 24 | \keyword{internal} 25 | -------------------------------------------------------------------------------- /man/get_presto_markers.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/import_scseq.R 3 | \name{get_presto_markers} 4 | \alias{get_presto_markers} 5 | \title{Get cluster markers using presto} 6 | \usage{ 7 | get_presto_markers(scseq) 8 | } 9 | \arguments{ 10 | \item{scseq}{SingleCellExperiment object} 11 | } 12 | \value{ 13 | list of data.frames, one for each cluster 14 | } 15 | \description{ 16 | Get cluster markers using presto 17 | } 18 | \examples{ 19 | 20 | if (requireNamespace("SingleCellExperiment", quietly = TRUE)) { 21 | data('object_sce', package = 'presto') 22 | object_sce$cluster <- object_sce$cell_type 23 | markers <- get_presto_markers(object_sce) 24 | } 25 | 26 | } 27 | \keyword{internal} 28 | -------------------------------------------------------------------------------- /man/get_query_cols.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/format_query_table.R 3 | \name{get_query_cols} 4 | \alias{get_query_cols} 5 | \title{Get query columns} 6 | \usage{ 7 | get_query_cols(is_genetic) 8 | } 9 | \arguments{ 10 | \item{is_genetic}{Should gene columns be returned? If \code{FALSE} drug columns are returned.} 11 | } 12 | \value{ 13 | Character vector of column names. 14 | } 15 | \description{ 16 | Gets appropriate column names for query study. 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/get_resoln_name.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{get_resoln_name} 4 | \alias{get_resoln_name} 5 | \title{Get the applied resolution dataset name} 6 | \usage{ 7 | get_resoln_name(sc_dir, dataset_name) 8 | } 9 | \arguments{ 10 | \item{sc_dir}{directory with \code{dataset_name} folder} 11 | 12 | \item{dataset_name}{name of single-cell dataset} 13 | } 14 | \value{ 15 | the resolution dataset name based on the last applied resolution 16 | } 17 | \description{ 18 | e.g. PBMCS_1/snn1 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/get_sc_dataset_choices.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{get_sc_dataset_choices} 4 | \alias{get_sc_dataset_choices} 5 | \title{Get data.frame of single-cell dataset choices} 6 | \usage{ 7 | get_sc_dataset_choices(sc_dir, prev = NULL) 8 | } 9 | \arguments{ 10 | \item{sc_dir}{Directory containing single-cell datasets} 11 | 12 | \item{prev}{name of previously selected dataset} 13 | } 14 | \value{ 15 | data.frame of single-cell dataset choices for selectizeInput 16 | } 17 | \description{ 18 | Get data.frame of single-cell dataset choices 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/get_species.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/import_scseq.R 3 | \name{get_species} 4 | \alias{get_species} 5 | \title{Get species for human or mouse depending on gene ids} 6 | \usage{ 7 | get_species(x) 8 | } 9 | \arguments{ 10 | \item{x}{dgCMatrix or data.frame where rownames are gene ids} 11 | } 12 | \value{ 13 | either 'Homo sapiens' or 'Mus musculus' 14 | } 15 | \description{ 16 | Get species for human or mouse depending on gene ids 17 | } 18 | \keyword{#} 19 | \keyword{'ENSG2'))} 20 | \keyword{'ENSMUSG2'))} 21 | \keyword{<-} 22 | \keyword{=} 23 | \keyword{c('ENSG1',} 24 | \keyword{c('ENSMUSG1',} 25 | \keyword{data.frame(row.names} 26 | \keyword{get_species(x)} 27 | \keyword{human} 28 | \keyword{identifiers} 29 | \keyword{internal} 30 | \keyword{mouse} 31 | \keyword{x} 32 | -------------------------------------------------------------------------------- /man/get_top.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-utils.R 3 | \name{get_top} 4 | \alias{get_top} 5 | \title{Reduce entries in query results} 6 | \usage{ 7 | get_top(query_cors, arrange_by, ntop, decreasing = FALSE) 8 | } 9 | \arguments{ 10 | \item{query_cors}{\code{data.frame} with columns \code{'Compound'} and \code{arrange_by}.} 11 | 12 | \item{arrange_by}{String indicating column name in \code{query_cors} do sort by.} 13 | 14 | \item{ntop}{Integer indicating the number of rows to keep after sorting by \code{arrange_by}.} 15 | 16 | \item{decreasing}{Should compounds be ordered from most similar to most 17 | dissimilar. \code{TRUE} used for genetic perturbations.} 18 | } 19 | \value{ 20 | Character vector of \code{ntop} compounds. 21 | } 22 | \description{ 23 | Gets all entries for compounds that have a correlation less than the top entries with a clinical phase. 24 | } 25 | \keyword{internal} 26 | -------------------------------------------------------------------------------- /man/get_top_cors.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-utils.R 3 | \name{get_top_cors} 4 | \alias{get_top_cors} 5 | \title{Get top correlated compounds for drug query} 6 | \usage{ 7 | get_top_cors(query_table, ntop, is_genetic = FALSE) 8 | } 9 | \arguments{ 10 | \item{query_table}{data.frame with columns \code{'Correlation'} and \code{'Compound'}.} 11 | 12 | \item{ntop}{Integer indicating the number of rows to keep after sorting by \code{arrange_by}.} 13 | 14 | \item{is_genetic}{Boolean indicating if the query results are from L1000 genetic perturbations.} 15 | } 16 | \value{ 17 | data.table summarized by Compound with top results. 18 | } 19 | \description{ 20 | Get top correlated compounds for drug query 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /man/get_tsne_coords.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{get_tsne_coords} 4 | \alias{get_tsne_coords} 5 | \title{Get median x-y coordinates for clusters in TSNE plot data} 6 | \usage{ 7 | get_tsne_coords(plot_data) 8 | } 9 | \arguments{ 10 | \item{plot_data}{data.frame with columns \code{'ident'}, \code{'TSNE_1'}, and \code{'TSNE_2'}.} 11 | } 12 | \description{ 13 | Get median x-y coordinates for clusters in TSNE plot data 14 | } 15 | -------------------------------------------------------------------------------- /man/get_violin_data.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot_scseq.R 3 | \name{get_violin_data} 4 | \alias{get_violin_data} 5 | \title{Get data for single-cell violin plots} 6 | \usage{ 7 | get_violin_data( 8 | feature, 9 | scseq, 10 | selected_cluster, 11 | by.sample = FALSE, 12 | decreasing = feature \%in\% c("ribo_percent", "log10_sum", "log10_detected"), 13 | with_all = FALSE, 14 | h5logs = NULL 15 | ) 16 | } 17 | \arguments{ 18 | \item{feature}{Feature name to generate violin plot for. Either a row or \code{colData} of \code{scseq}.} 19 | 20 | \item{scseq}{\code{SingleCellExperiment}.} 21 | 22 | \item{selected_cluster}{Name of the selected cluster.} 23 | 24 | \item{by.sample}{if \code{TRUE} plot \code{feature} violin for each \code{scseq$batch}. Default (\code{FALSE}) 25 | will plot \code{feature} for each \code{scseq$cluster}.} 26 | 27 | \item{decreasing}{if \code{TRUE}, violinlines with smaller mean values of \code{feature} will show up on top. 28 | Used to show features where smaller values indicate potential QC issues.} 29 | } 30 | \value{ 31 | list used by \link{VlnPlot} 32 | } 33 | \description{ 34 | Get data for single-cell violin plots 35 | } 36 | \keyword{internal} 37 | -------------------------------------------------------------------------------- /man/get_wikipedia.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/parse_pug.R 3 | \name{get_wikipedia} 4 | \alias{get_wikipedia} 5 | \title{Extract Wikipedia URL from PUG-View} 6 | \usage{ 7 | get_wikipedia(pug_view) 8 | } 9 | \arguments{ 10 | \item{pug_view}{List from reading PUG-View JSON data with \code{\link[rjson]{fromJSON}}} 11 | } 12 | \value{ 13 | Character vector with Wikipedia page 14 | } 15 | \description{ 16 | Extract Wikipedia URL from PUG-View 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/handle_sc_progress.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{handle_sc_progress} 4 | \alias{handle_sc_progress} 5 | \title{Update Progress from Background Processes} 6 | \usage{ 7 | handle_sc_progress(bgs, progs, reactive_result) 8 | } 9 | \arguments{ 10 | \item{bgs}{\code{reactivevalues} of \link[callr]{r_bg}} 11 | 12 | \item{progs}{\code{reactivevalues} of \link[shiny]{Progress}} 13 | 14 | \item{reactive_result}{\code{reactive} that is updated when bg completes.} 15 | } 16 | \description{ 17 | Update Progress from Background Processes 18 | } 19 | \keyword{internal} 20 | -------------------------------------------------------------------------------- /man/html_space.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{html_space} 4 | \alias{html_space} 5 | \title{Format character vectors that will be recognized by HTML} 6 | \usage{ 7 | html_space(x, justify = "right") 8 | } 9 | \arguments{ 10 | \item{x}{any \R object (conceptually); typically numeric.} 11 | 12 | \item{justify}{should a \emph{character} vector be left-justified (the 13 | default), right-justified, centred or left alone. Can be abbreviated.} 14 | } 15 | \value{ 16 | Formatted \code{x} with   substituted for each space. 17 | } 18 | \description{ 19 | Format character vectors that will be recognized by HTML 20 | } 21 | \keyword{internal} 22 | -------------------------------------------------------------------------------- /man/id_from_tab.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ui-utils.R 3 | \name{id_from_tab} 4 | \alias{id_from_tab} 5 | \title{Convert tab name to formated id} 6 | \usage{ 7 | id_from_tab(tab) 8 | } 9 | \arguments{ 10 | \item{tab}{The name of the tab (e.g. \code{'Single Cell'})} 11 | } 12 | \description{ 13 | used by navbarUI and *PageUI for dseqr app 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/identify_sc_files.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/run_kb_scseq.R 3 | \name{identify_sc_files} 4 | \alias{identify_sc_files} 5 | \title{Get 10X FastQ paths for a read type and sort by increasing lane number} 6 | \usage{ 7 | identify_sc_files(data_dir, read_type = "R1") 8 | } 9 | \arguments{ 10 | \item{data_dir}{Path to folder with 10X fastq.gz scRNA-seq files} 11 | 12 | \item{read_type}{One of \code{'R1'} or \code{'R2'} for CB+UMI and read sequences respectively.} 13 | } 14 | \value{ 15 | Character vector of lane ordered paths to FastQ read type files. 16 | } 17 | \description{ 18 | Get 10X FastQ paths for a read type and sort by increasing lane number 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/import_scseq.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/import_scseq.R 3 | \name{import_scseq} 4 | \alias{import_scseq} 5 | \title{Import raw single cell fastq or cellranger files for app} 6 | \usage{ 7 | import_scseq( 8 | dataset_name, 9 | uploaded_data_dir, 10 | sc_dir, 11 | tx2gene_dir, 12 | species = NULL, 13 | progress = NULL, 14 | value = 0, 15 | founder = dataset_name, 16 | npcs = 30, 17 | cluster_alg = "leiden", 18 | resoln = 1, 19 | ref_name = NULL, 20 | metrics = c("low_lib_size", "low_n_features", "high_subsets_mito_percent", 21 | "low_subsets_ribo_percent", "high_doublet_score") 22 | ) 23 | } 24 | \arguments{ 25 | \item{dataset_name}{Name of dataset} 26 | 27 | \item{uploaded_data_dir}{Directory with fastq or cellranger files} 28 | 29 | \item{sc_dir}{Single cell directory for app. Will store results in \code{dataset_name} subdirectory} 30 | 31 | \item{tx2gene_dir}{Path to directory containing transcript to gene maps 32 | produced by \link[dseqr.data]{load_tx2gene}.} 33 | 34 | \item{species}{Name of species. Used for R object imports only (detected for cellranger files).} 35 | 36 | \item{progress}{Optional shiny \code{Progress} object. Default will print progress.} 37 | 38 | \item{value}{Integer indicating step of pipeline.} 39 | 40 | \item{founder}{Name of dataset that \code{dataset_name} originates from.} 41 | } 42 | \description{ 43 | Import raw single cell fastq or cellranger files for app 44 | } 45 | \keyword{internal} 46 | -------------------------------------------------------------------------------- /man/init_dseqr.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/run_dseqr.R 3 | \name{init_dseqr} 4 | \alias{init_dseqr} 5 | \title{Initialize dseqr folders/files for a new app} 6 | \usage{ 7 | init_dseqr(user_name, data_dir = "/srv/dseqr") 8 | } 9 | \arguments{ 10 | \item{user_name}{User name for new dseqr app.} 11 | 12 | \item{data_dir}{Path to put \code{anal_name} directory where app will be 13 | initialized. Default is \code{'/srv/dseqr'} (for hosting app on server).} 14 | } 15 | \description{ 16 | Creates necessary folders/files for a new dseqr app inside of /srv/shiny-server/dseqr. 17 | } 18 | \examples{ 19 | 20 | data_dir <- tempdir() 21 | init_dseqr('example', data_dir) 22 | 23 | } 24 | -------------------------------------------------------------------------------- /man/integrate_saved_scseqs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{integrate_saved_scseqs} 4 | \alias{integrate_saved_scseqs} 5 | \title{Integrate previously saved SingleCellExperiments} 6 | \usage{ 7 | integrate_saved_scseqs( 8 | sc_dir, 9 | integration_name, 10 | dataset_names = NULL, 11 | scseqs = NULL, 12 | integration_type = c("harmony", "fastMNN", "Azimuth", "symphony"), 13 | exclude_clusters = NULL, 14 | exclude_cells = NULL, 15 | subset_metrics = NULL, 16 | is_include = NULL, 17 | founder = integration_name, 18 | pairs = NULL, 19 | hvgs = NULL, 20 | ref_name = NULL, 21 | npcs = 30, 22 | cluster_alg = "leiden", 23 | resoln = 1, 24 | progress = NULL, 25 | value = 0, 26 | tx2gene_dir = NULL 27 | ) 28 | } 29 | \arguments{ 30 | \item{sc_dir}{Directory with saved single-cell datasets.} 31 | 32 | \item{integration_name}{Name for new integrated analysis.} 33 | 34 | \item{integration_type}{Charactor vector of one or more integration types.} 35 | 36 | \item{exclude_clusters}{Charactor vector of clusters for excluding cells. Only included to save to args.} 37 | 38 | \item{exclude_cells}{Character vector of cell names to exclude.} 39 | 40 | \item{subset_metrics}{Metrics to subset based on.} 41 | 42 | \item{is_include}{Boolean - are cells that match \code{subset_metrics} included or excluded?} 43 | 44 | \item{progress}{optional Shiny \code{Progress} object.} 45 | } 46 | \value{ 47 | TRUE is successful, otherwise FALSE 48 | } 49 | \description{ 50 | Performs integration and saves as a new analysis. 51 | Used by \code{explore_scseq_clusters} shiny app. 52 | } 53 | \seealso{ 54 | \code{\link{run_fastmnn}} \code{\link{run_harmony}} 55 | } 56 | \keyword{internal} 57 | -------------------------------------------------------------------------------- /man/integrate_scseqs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/import_scseq.R 3 | \name{integrate_scseqs} 4 | \alias{integrate_scseqs} 5 | \title{Integrate multiple scRNA-seq samples} 6 | \usage{ 7 | integrate_scseqs( 8 | scseqs, 9 | species, 10 | tx2gene_dir, 11 | type = c("harmony", "fastMNN", "Azimuth", "symphony"), 12 | pairs = NULL, 13 | hvgs = NULL, 14 | ref_name = NULL 15 | ) 16 | } 17 | \arguments{ 18 | \item{scseqs}{List of \code{SingleCellExperiment} objects} 19 | 20 | \item{type}{One of \code{'harmony'} (default) or \code{'fastMNN'} specifying integration to use.} 21 | 22 | \item{pairs}{data.frame with columns \code{'sample'} with sample 23 | names of \code{scseqs} and \code{'pair'} with integers indicating paired 24 | samples. If not \code{NULL} (default), then harmony includes pairings 25 | as a covariate.} 26 | } 27 | \value{ 28 | Integrated \code{SingleCellExperiment} object. 29 | } 30 | \description{ 31 | Integrate multiple scRNA-seq samples 32 | } 33 | \keyword{internal} 34 | -------------------------------------------------------------------------------- /man/interpret.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{interpret} 4 | \alias{interpret} 5 | \title{Check safety of evaluating string as R code.} 6 | \usage{ 7 | interpret( 8 | expr_str, 9 | max_length = 200, 10 | whitelist = c("&", ">=", "<=", ">", "<", "|", "==", "!=", "*") 11 | ) 12 | } 13 | \arguments{ 14 | \item{expr_str}{String to evaluate,} 15 | 16 | \item{max_length}{maximum length of string to evaluate,} 17 | 18 | \item{whitelist}{R functions to allow use of.} 19 | } 20 | \value{ 21 | \code{TRUE} if expression is safe, otherwise \code{FALSE}. 22 | } 23 | \description{ 24 | Check safety of evaluating string as R code. 25 | } 26 | \keyword{internal} 27 | -------------------------------------------------------------------------------- /man/isTruthy.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{isTruthy} 4 | \alias{isTruthy} 5 | \title{Truthy and falsy values} 6 | \usage{ 7 | isTruthy(x) 8 | } 9 | \arguments{ 10 | \item{x}{An expression whose truthiness value we want to determine} 11 | } 12 | \value{ 13 | a logical vector of TRUE or FALSE values 14 | } 15 | \description{ 16 | Truthy and falsy values 17 | } 18 | -------------------------------------------------------------------------------- /man/isTruthyAll.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/server-utils.R 3 | \name{isTruthyAll} 4 | \alias{isTruthyAll} 5 | \title{Check truthiness of multiple objects} 6 | \usage{ 7 | isTruthyAll(...) 8 | } 9 | \arguments{ 10 | \item{...}{objects to check truthiness of} 11 | } 12 | \description{ 13 | Check truthiness of multiple objects 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/is_invertible.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-bulk-utils.R 3 | \name{is_invertible} 4 | \alias{is_invertible} 5 | \title{Check uploaded bulk pdata to make sure the study design is invertible} 6 | \usage{ 7 | is_invertible(pdata) 8 | } 9 | \description{ 10 | Check uploaded bulk pdata to make sure the study design is invertible 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/justifiedButtonGroup.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ui-utils.R 3 | \name{justifiedButtonGroup} 4 | \alias{justifiedButtonGroup} 5 | \title{Full width button group with validation} 6 | \usage{ 7 | justifiedButtonGroup( 8 | ..., 9 | label, 10 | container_id = NULL, 11 | help_id = NULL, 12 | class = "" 13 | ) 14 | } 15 | \arguments{ 16 | \item{...}{actionButtons} 17 | 18 | \item{label}{Character vector. Label above button group.} 19 | 20 | \item{container_id}{id of container. Used to toggle 'has-error' class with shinyjs::toggleClass.} 21 | 22 | \item{help_id}{id of help block. Used to show help message in change shinyjs::html} 23 | 24 | \item{class}{classes to add to btn-group divs.} 25 | } 26 | \description{ 27 | Full width button group with validation 28 | } 29 | \keyword{internal} 30 | -------------------------------------------------------------------------------- /man/keep_curr_selected.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{keep_curr_selected} 4 | \alias{keep_curr_selected} 5 | \title{Take currently selected row and keep it in the same position} 6 | \usage{ 7 | keep_curr_selected(datasets, prev, curr) 8 | } 9 | \arguments{ 10 | \item{datasets}{current data.frame of single-cell datasets} 11 | 12 | \item{prev}{previous data.frame of single-cell datasets} 13 | 14 | \item{curr}{name of currently selected row from \code{prev}} 15 | } 16 | \value{ 17 | \code{datasets} with \code{curr} at same row as it is in \code{prev} 18 | } 19 | \description{ 20 | Used to stop dataset change when adding new datasets 21 | } 22 | -------------------------------------------------------------------------------- /man/limit_cells.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-utils.R 3 | \name{limit_cells} 4 | \alias{limit_cells} 5 | \title{Limit Query Results to Specific Cell Lines} 6 | \usage{ 7 | limit_cells(query_table, cells = NULL) 8 | } 9 | \arguments{ 10 | \item{query_table}{\code{data.frame} with \code{cell_line} column.} 11 | 12 | \item{cells}{Character vector of cell lines to limit \code{query_table} by. If \code{NULL} (default), 13 | no filtering occurs.} 14 | } 15 | \value{ 16 | \code{query_table} for specified \code{cells} 17 | } 18 | \description{ 19 | Limit Query Results to Specific Cell Lines 20 | } 21 | \keyword{internal} 22 | -------------------------------------------------------------------------------- /man/load_bulk_datasets.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-bulk-utils.R 3 | \name{load_bulk_datasets} 4 | \alias{load_bulk_datasets} 5 | \title{Load previous bulk datasets dataframe} 6 | \usage{ 7 | load_bulk_datasets(data_dir, with.explore = FALSE) 8 | } 9 | \arguments{ 10 | \item{data_dir}{Path to folder container \code{'bulk'} and \code{'single-cell'} directories} 11 | } 12 | \value{ 13 | data.frame with columns "dataset_name" and "dataset_dir" 14 | } 15 | \description{ 16 | Load previous bulk datasets dataframe 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/load_cellranger_counts.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/import_scseq.R 3 | \name{load_cellranger_counts} 4 | \alias{load_cellranger_counts} 5 | \title{Load cell ranger counts} 6 | \usage{ 7 | load_cellranger_counts(data_dir) 8 | } 9 | \arguments{ 10 | \item{data_dir}{Path to folder with cell ranger files.} 11 | } 12 | \value{ 13 | dgCMatrix 14 | } 15 | \description{ 16 | Mainly to avoid having to download massive datasets that have already been 17 | quantified. 18 | } 19 | \keyword{internal} 20 | -------------------------------------------------------------------------------- /man/load_custom_anals.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-utils.R 3 | \name{load_custom_anals} 4 | \alias{load_custom_anals} 5 | \title{Load data.frame of custom anals for selectizeInput} 6 | \usage{ 7 | load_custom_anals(data_dir) 8 | } 9 | \arguments{ 10 | \item{data_dir}{Path to directory containing \code{'custom_queries'} folder.} 11 | } 12 | \value{ 13 | \code{data.frame} used to show available custom queries in Drugs tab 14 | } 15 | \description{ 16 | Load data.frame of custom anals for selectizeInput 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/load_custom_results.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-utils.R 3 | \name{load_custom_results} 4 | \alias{load_custom_results} 5 | \title{Load results of previous custom query} 6 | \usage{ 7 | load_custom_results(res_paths, is_pert) 8 | } 9 | \arguments{ 10 | \item{res_paths}{List of named strings with paths to results.} 11 | } 12 | \value{ 13 | List of names results loaded from \code{res_paths}. 14 | } 15 | \description{ 16 | Will only load \code{res_paths} that exist. L1000 results won't exist 17 | if no genes selected for custom query were in the L1000 measured genes. 18 | } 19 | \keyword{internal} 20 | -------------------------------------------------------------------------------- /man/load_drug_es.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{load_drug_es} 4 | \alias{load_drug_es} 5 | \title{Load drug effect size matrices for drug queries} 6 | \usage{ 7 | load_drug_es() 8 | } 9 | \value{ 10 | list of matrices 11 | } 12 | \description{ 13 | Load drug effect size matrices for drug queries 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/load_kallisto_counts.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/import_scseq.R 3 | \name{load_kallisto_counts} 4 | \alias{load_kallisto_counts} 5 | \title{Read kallisto/bustools market matrix and annotations} 6 | \usage{ 7 | load_kallisto_counts(data_dir) 8 | } 9 | \arguments{ 10 | \item{data_dir}{Path to folder with 'genecount' directory which contains 11 | 'genes.mtx', 'genes.genes.txt', and 'genes.barcodes.txt' files generated 12 | by kallisto/bustools.} 13 | } 14 | \value{ 15 | sparse dgTMatrix with barcodes in columns and genes in rows. 16 | } 17 | \description{ 18 | Read kallisto/bustools market matrix and annotations 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/load_pert_anals.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-utils.R 3 | \name{load_pert_anals} 4 | \alias{load_pert_anals} 5 | \title{Load data.frame of CMAP02/L1000 perturbations for right click load signature on correlation points} 6 | \usage{ 7 | load_pert_anals() 8 | } 9 | \value{ 10 | \code{data.frame} used to show available pertubation queries in Drugs tab 11 | } 12 | \description{ 13 | Load data.frame of CMAP02/L1000 perturbations for right click load signature on correlation points 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/load_pert_signature.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-path-utils.R 3 | \name{load_pert_signature} 4 | \alias{load_pert_signature} 5 | \title{Get perturbation signature} 6 | \usage{ 7 | load_pert_signature(pert, pert_type, pert_signature_dir, pvals = FALSE) 8 | } 9 | \arguments{ 10 | \item{pert}{Name of perturbation signature.} 11 | 12 | \item{pert_type}{One of \code{'cmap'}, \code{'l1000_genes'}, or \code{'l1000_drugs'}.} 13 | 14 | \item{pvals}{If \code{TRUE} returns adjusted pvalues for signature. If \code{FALSE} (default) returns signature.} 15 | } 16 | \description{ 17 | Get perturbation signature 18 | } 19 | \keyword{internal} 20 | -------------------------------------------------------------------------------- /man/load_resoln.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{load_resoln} 4 | \alias{load_resoln} 5 | \title{Load the applied resolution name} 6 | \usage{ 7 | load_resoln(dataset_dir) 8 | } 9 | \arguments{ 10 | \item{dataset_dir}{directory corresponding to single-cell dataset} 11 | } 12 | \value{ 13 | the last applied resolution name (e.g. \code{'snn1'}) 14 | } 15 | \description{ 16 | e.g. snn1 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/load_scseq_datasets.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-path-utils.R 3 | \name{load_scseq_datasets} 4 | \alias{load_scseq_datasets} 5 | \title{Generate data.frame of integrated single cell RNA-Seq datasets} 6 | \usage{ 7 | load_scseq_datasets(data_dir) 8 | } 9 | \arguments{ 10 | \item{data_dir}{Directory to folder with single-cell analysis folders.} 11 | } 12 | \value{ 13 | data.frame with columns: \itemize{ 14 | \item dataset_name \code{NA} included for consistency with \code{load_bulk_anals}. 15 | \item dataset_dir Directory name in \code{data_dir} with single cell analysis. 16 | \item anal_name Name of single cell analysis. Same as \code{dataset_dir}. 17 | 18 | } 19 | } 20 | \description{ 21 | Used together with \code{\link{load_bulk_datasets}} to create data.frame 22 | for selectizeInput choices. 23 | } 24 | \keyword{internal} 25 | -------------------------------------------------------------------------------- /man/load_scseq_qcgenes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/import_scseq.R 3 | \name{load_scseq_qcgenes} 4 | \alias{load_scseq_qcgenes} 5 | \title{Load mitochondrial and ribsomal gene names} 6 | \usage{ 7 | load_scseq_qcgenes(species = "Homo sapiens", tx2gene = NULL) 8 | } 9 | \value{ 10 | Named list with \code{rrna} and \code{mrna} character vectors. 11 | } 12 | \description{ 13 | Load mitochondrial and ribsomal gene names 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/load_scseq_qs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{load_scseq_qs} 4 | \alias{load_scseq_qs} 5 | \title{Load SingleCellExperiment from qs file} 6 | \usage{ 7 | load_scseq_qs( 8 | dataset_dir, 9 | meta = NULL, 10 | groups = NULL, 11 | with_logs = FALSE, 12 | with_counts = FALSE 13 | ) 14 | } 15 | \arguments{ 16 | \item{dataset_dir}{Path to folder with scseq.qs file} 17 | 18 | \item{meta}{data.frame with column \code{group} and \code{row.names} as sample 19 | names corresponding to \code{scseq$batch}. Default (\code{NULL}) loads previous 20 | specification from file.} 21 | 22 | \item{groups}{character vector of length two. First value is test group name 23 | and second in control group name.} 24 | 25 | \item{with_logs}{should logcounts be loaded? Default is \code{FALSE} to increase 26 | speed and reduce memory usage.} 27 | 28 | \item{with_counts}{should counts be loaded? Default is \code{FALSE} to increase 29 | speed and reduce memory usage.} 30 | } 31 | \value{ 32 | SingleCellExperiment 33 | } 34 | \description{ 35 | Also attaches clusters from last applied leiden resolution and stores resolution. 36 | } 37 | -------------------------------------------------------------------------------- /man/load_scseq_subsets.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{load_scseq_subsets} 4 | \alias{load_scseq_subsets} 5 | \title{Load subsets of scseqs for integration/subsetting} 6 | \usage{ 7 | load_scseq_subsets( 8 | dataset_names, 9 | sc_dir, 10 | subset_metrics = NULL, 11 | is_include = NULL, 12 | ... 13 | ) 14 | } 15 | \arguments{ 16 | \item{dataset_names}{Character vector of single cell analysis names to load.} 17 | 18 | \item{sc_dir}{The directory with single-cell datasets} 19 | } 20 | \value{ 21 | List of \code{SingleCellExperiment} objects. 22 | } 23 | \description{ 24 | Sets orig.ident to \code{ident}. 25 | } 26 | \keyword{internal} 27 | -------------------------------------------------------------------------------- /man/make_unique.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{make_unique} 4 | \alias{make_unique} 5 | \title{Make Character Strings Unique} 6 | \usage{ 7 | make_unique(names, sep = ".") 8 | } 9 | \arguments{ 10 | \item{names}{a character vector.} 11 | 12 | \item{sep}{a character string used to separate a duplicate name from its sequence number.} 13 | } 14 | \value{ 15 | A character vector of same length as names with duplicates changed, in the current locale's encoding. 16 | } 17 | \description{ 18 | Make Character Strings Unique 19 | } 20 | -------------------------------------------------------------------------------- /man/merge_linkouts.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-utils.R 3 | \name{merge_linkouts} 4 | \alias{merge_linkouts} 5 | \title{Merge columns with image links} 6 | \usage{ 7 | merge_linkouts(query_res, cols) 8 | } 9 | \arguments{ 10 | \item{query_res}{\code{data.frame} after calling \code{\link{add_linkout}} to \code{cols}.} 11 | 12 | \item{cols}{Character vector of columns in \code{query_res} that \code{\link{add_linkout}} has been called on.} 13 | } 14 | \value{ 15 | \code{query_res} with column \code{'External Links'} formed from pasting \code{cols} together. \code{cols} are removed. 16 | } 17 | \description{ 18 | Merge columns with image links 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/merge_samples.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/merge_utils.R 3 | \name{merge_samples} 4 | \alias{merge_samples} 5 | \title{Merge samples that are from the sample subject} 6 | \usage{ 7 | merge_samples(data_dir, merge_list, new_founder = NULL) 8 | } 9 | \arguments{ 10 | \item{data_dir}{of single-cell} 11 | 12 | \item{merge_list}{Names are new name, values are current names to merge} 13 | 14 | \item{new_founder}{Name of new founder for dataset for grouping in select menu. 15 | Default (\code{NULL}) keeps previous founder.} 16 | } 17 | \value{ 18 | called for side effects 19 | } 20 | \description{ 21 | Merge samples that are from the sample subject 22 | } 23 | \examples{ 24 | 25 | if (interactive()) { 26 | 27 | # FILL THIS IN 28 | sc_dir <- '' 29 | 30 | dataset_names <- c('SJIALD_VS_HEALTHY_merged_QC1.0_fastMNN') 31 | 32 | merge_list <- list( 33 | 'SJIALD_20200716' = c('SJIALD_1-20200716_QC3.0_NO_NEUTRO', 'SJIALD_2-20200716_QC3.0_NO_NEUTRO'), 34 | 'SJIALD_FID12518' = c('SJIALD_FID12518_Diseased_QC2.0')) 35 | 36 | new_founder <- 'SJIALD_VS_HEALTHY_merged' 37 | 38 | for (dataset_name in dataset_names) { 39 | data_dir <- file.path(sc_dir, dataset_name) 40 | merge_samples(data_dir, merge_list, new_founder) 41 | } 42 | 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /man/navbar2UI.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ui-utils.R 3 | \name{navbar2UI} 4 | \alias{navbar2UI} 5 | \title{UI for secondary navbar} 6 | \usage{ 7 | navbar2UI(hide) 8 | } 9 | \arguments{ 10 | \item{hide}{should delete and add be disabled (for demo)} 11 | } 12 | \value{ 13 | shiny.tag with html for secondary navbar 14 | } 15 | \description{ 16 | UI for secondary navbar 17 | } 18 | \examples{ 19 | 20 | navbar2UI(hide = FALSE) 21 | 22 | } 23 | -------------------------------------------------------------------------------- /man/navbarUI.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ui-utils.R 3 | \name{navbarUI} 4 | \alias{navbarUI} 5 | \title{UI for navbar} 6 | \usage{ 7 | navbarUI(tabs, active, logout_url = NULL) 8 | } 9 | \arguments{ 10 | \item{tabs}{Character vector of tab names to display} 11 | 12 | \item{active}{the active tab name} 13 | 14 | \item{logout_url}{url to logout from. NULL results in no Logout link} 15 | } 16 | \value{ 17 | shiny.tag with html for navbar 18 | } 19 | \description{ 20 | UI for navbar 21 | } 22 | \examples{ 23 | 24 | # UI with only Single-Cell page 25 | navbarUI('Single Cell', 'Single Cell') 26 | 27 | } 28 | -------------------------------------------------------------------------------- /man/normalize_scseq.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/import_scseq.R 3 | \name{normalize_scseq} 4 | \alias{normalize_scseq} 5 | \title{Utility wrapper to run normalization and log transformation} 6 | \usage{ 7 | normalize_scseq(scseq) 8 | } 9 | \arguments{ 10 | \item{scseq}{\code{SingleCellExperiment} object} 11 | } 12 | \value{ 13 | Normalized and log transformed \code{scseq}. 14 | } 15 | \description{ 16 | Utility wrapper to run normalization and log transformation 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/plot_biogps.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot_scseq.R 3 | \name{plot_biogps} 4 | \alias{plot_biogps} 5 | \title{Plot BioGPS data for a HGNC symbol} 6 | \usage{ 7 | plot_biogps(gene) 8 | } 9 | \arguments{ 10 | \item{gene}{Character vector of gene name.} 11 | } 12 | \value{ 13 | ggplot 14 | } 15 | \description{ 16 | Plot BioGPS data for a HGNC symbol 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/plot_dprimes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-utils.R 3 | \name{plot_dprimes} 4 | \alias{plot_dprimes} 5 | \title{Generate plotly of dprimes values for Drugs tab.} 6 | \usage{ 7 | plot_dprimes(path_df, drugs = TRUE) 8 | } 9 | \arguments{ 10 | \item{path_df}{result of \link{get_path_df}.} 11 | } 12 | \value{ 13 | plotly 14 | } 15 | \description{ 16 | Also used for pseudobulk single-cell datasets. 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/plot_violin.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot_scseq.R 3 | \name{plot_violin} 4 | \alias{plot_violin} 5 | \title{Violin Plot} 6 | \usage{ 7 | plot_violin( 8 | feature = NULL, 9 | scseq = NULL, 10 | selected_cluster = NULL, 11 | by.sample = FALSE, 12 | with_all = FALSE, 13 | with.height = FALSE, 14 | violin_data = NULL, 15 | is_mobile = FALSE, 16 | hide_pct = is_mobile, 17 | hide_ncells = is_mobile, 18 | decreasing = feature \%in\% c("ribo_percent", "log10_sum", "log10_detected") 19 | ) 20 | } 21 | \arguments{ 22 | \item{feature}{Character, gene name.} 23 | 24 | \item{scseq}{\code{SingleCellExperiment} object.} 25 | 26 | \item{selected_cluster}{Integer indicating which \code{level(scseq$cluster)} to highlight 27 | (if \code{by.sample} is \code{FALSE}) or to subset data to (if \code{by.sample} is \code{TRUE}). 28 | To plot by sample without subsetting to a cluster, set to \code{nlevels(scseq$cluster) + 1}.} 29 | 30 | \item{by.sample}{Boolean indicating if violin plots should be by sample or by cluster (default).} 31 | 32 | \item{with_all}{Set to \code{TRUE} if plotting by sample to get same colors as Shiny app.} 33 | 34 | \item{with.height}{if \code{TRUE} returns a list object with plot and appropriate height.} 35 | 36 | \item{violin_data}{Used for Shiny app. Result of \code{get_violin_data}. 37 | Used when logcounts are seperate from \code{SingleCellExperiment} as in the Shiny app.} 38 | 39 | \item{is_mobile}{If \code{TRUE} shortens up y-axis labels to fit mobile better.} 40 | 41 | \item{hide_pct}{If \code{TRUE}, barplots indicating number of cells are hidden.} 42 | 43 | \item{hide_ncells}{If \code{TRUE}, barplots indicating percent expression are hidden.} 44 | 45 | \item{decreasing}{if \code{FALSE} (default) violins are ordered, bottom to top, 46 | by increasing mean expression.} 47 | } 48 | \value{ 49 | \code{ggplot} or list 50 | } 51 | \description{ 52 | Violin Plot 53 | } 54 | -------------------------------------------------------------------------------- /man/plotlyMDS.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/diff_utils.R 3 | \name{plotlyMDS} 4 | \alias{plotlyMDS} 5 | \title{Plot MDS plotlys} 6 | \usage{ 7 | plotlyMDS( 8 | scaling, 9 | scaling_adj = NULL, 10 | group_colors = c("#337ab7", "#e6194b"), 11 | adjusted = FALSE, 12 | title = "Sammon MDS plots" 13 | ) 14 | } 15 | \arguments{ 16 | \item{scaling}{tibble with coordinate columns MDS1 and MDS2 calculated from expression data without correction for surrogate variables} 17 | 18 | \item{scaling_adj}{Optional. Same as \code{scaling} but using expression data adjusted for surrogate variables. 19 | If omitted, an MDS plot is created only for \code{scaling}.} 20 | 21 | \item{group_colors}{colors to use, one for each unique groups in \code{scaling$Group}.} 22 | 23 | \item{title}{Plot title.} 24 | } 25 | \value{ 26 | plotly object 27 | } 28 | \description{ 29 | Plot MDS plotlys 30 | } 31 | \keyword{internal} 32 | -------------------------------------------------------------------------------- /man/process_raw_scseq.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/import_scseq.R 3 | \name{process_raw_scseq} 4 | \alias{process_raw_scseq} 5 | \title{Process Count Data for App} 6 | \usage{ 7 | process_raw_scseq( 8 | scseq, 9 | dataset_name, 10 | sc_dir, 11 | tx2gene_dir, 12 | cluster_alg = "leiden", 13 | npcs = 30, 14 | resoln = 1, 15 | hvgs = NULL, 16 | ref_name = NULL, 17 | founder = NULL, 18 | progress = NULL, 19 | value = 0 20 | ) 21 | } 22 | \arguments{ 23 | \item{scseq}{\code{SingleCellExperiment}} 24 | 25 | \item{dataset_name}{Name of dataset to save} 26 | 27 | \item{sc_dir}{Directory to save dataset to} 28 | 29 | \item{tx2gene_dir}{Path to directory containing transcript to gene maps 30 | produced by \link[dseqr.data]{load_tx2gene}.} 31 | 32 | \item{cluster_alg}{Cluster algorith. Either \code{'leiden'} (default) or \code{'walktrap'}.} 33 | 34 | \item{npcs}{Number of principal components to use. Default is 30.} 35 | 36 | \item{resoln}{\code{resolution_parameter} used by \link[igraph]{cluster_leiden} if 37 | \code{cluster_alg = 'leiden'}.} 38 | 39 | \item{hvgs}{Character vector of a priori genes to use for PCA. If \code{NULL} (default), 40 | highly variable genes are calulated by \link[scran]{getTopHVGs}.} 41 | 42 | \item{ref_name}{Name of symphony or Azimuth reference to use for reference-based analysis.} 43 | 44 | \item{founder}{Name of original founding dataset (may be ancestor of \code{from_dataset}).} 45 | 46 | \item{progress}{Shiny progress object. Default (\code{NULL}) prints to stdout.} 47 | 48 | \item{value}{Initial value of progress.} 49 | } 50 | \description{ 51 | Performs the following: 52 | - normalization 53 | - adds HVGs 54 | - dimensionality reduction 55 | - clustering 56 | } 57 | \details{ 58 | Then calls run_post_cluster 59 | } 60 | \keyword{internal} 61 | -------------------------------------------------------------------------------- /man/qread.safe.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/server-utils.R 3 | \name{qread.safe} 4 | \alias{qread.safe} 5 | \title{Read qs file safely} 6 | \usage{ 7 | qread.safe(file, .nofile = NULL, .nullfile = NULL) 8 | } 9 | \arguments{ 10 | \item{file}{The file name/path.} 11 | 12 | \item{.nofile}{return value when file doesn't exist} 13 | 14 | \item{.nullfile}{return value when file value is \code{NULL}} 15 | } 16 | \value{ 17 | The de-serialized object. 18 | } 19 | \description{ 20 | Read qs file safely 21 | } 22 | -------------------------------------------------------------------------------- /man/query_budger.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/query_utils.R 3 | \name{query_budger} 4 | \alias{query_budger} 5 | \title{Find drugs that maximally affect a selection of genes} 6 | \usage{ 7 | query_budger(query_genes, drug_es) 8 | } 9 | \arguments{ 10 | \item{query_genes}{Named list of character vectors with \code{'dn'} indicating genes that want to down-regulated and 11 | \code{'up'} indicating genes that want to up-regulate.} 12 | 13 | \item{drug_es}{A matrix of differential expression values for drugs.} 14 | } 15 | \value{ 16 | Named numeric vector where most negative results are predicted to have the strongest desired effect as 17 | indicated by \code{query_genes}. 18 | } 19 | \description{ 20 | Results are based on the average effect on the query genes. Genes to upregulate are multiplied by -1 so that 21 | strong positive results for these genes contribute towards a more negative average effect. All results are divided 22 | by the absolute of the average minimum effect (after -1 multiplication of genes to upregulate) of the query genes. 23 | This ensures that results will be between -1 and 1 for consistency with correlation values for \code{\link{query_drugs}}. 24 | } 25 | \keyword{internal} 26 | -------------------------------------------------------------------------------- /man/query_drugs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/query_utils.R 3 | \name{query_drugs} 4 | \alias{query_drugs} 5 | \title{Get correlation between query and drug signatures.} 6 | \usage{ 7 | query_drugs(query_genes, drug_es, ngenes = 200) 8 | } 9 | \arguments{ 10 | \item{query_genes}{Named numeric vector of differential expression values for 11 | query genes. Names are HGNC symbols.} 12 | 13 | \item{drug_es}{A matrix of differential expression values for drugs.} 14 | 15 | \item{ngenes}{The number of top differentially-regulated (up and down) query genes to use.} 16 | } 17 | \value{ 18 | Named vector of pearson correlations between query and drug combination signatures. 19 | } 20 | \description{ 21 | Determines the pearson correlation between the query and each drug signature. 22 | } 23 | \details{ 24 | Drugs with the largest positive and negative pearson correlation are predicted to, 25 | respectively, mimic and reverse the query signature. Values range from +1 to -1. 26 | } 27 | \examples{ 28 | 29 | # load CMAP02 data 30 | cmap_es <- dseqr.data::load_data('cmap_es_ind.qs') 31 | 32 | # use first cmap_es signature as query 33 | dprimes <- cmap_es[1:100, 1] 34 | names(dprimes) <- row.names(cmap_es)[1:100] 35 | 36 | # get correlations between query and drug signatures 37 | res <- dseqr:::query_drugs(dprimes, cmap_es) 38 | 39 | } 40 | \keyword{internal} 41 | -------------------------------------------------------------------------------- /man/remove_dataset_files.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-bulk-utils.R 3 | \name{remove_dataset_files} 4 | \alias{remove_dataset_files} 5 | \title{Delete stale dataset files after changing sample groups or running sva} 6 | \usage{ 7 | remove_dataset_files( 8 | data_dir, 9 | patterns = c("^adjusted_\\\\d+svs.qs$", "^iqr_keep_\\\\d+svs.qs$", "^vsd.qs$", 10 | "^svobj.qs$", "^numsv.qs$", "^lm_fit_\\\\d+svs.qs$", "^mds_\\\\d+svs.qs$", 11 | "cmap_res_.+_\\\\d+svs.qs$", "go_.+_\\\\d+svs.qs$", "goana_.+_\\\\d+svs.qs$", 12 | "kegg_.+_\\\\d+svs.qs$", "kegga_.+_\\\\d+svs.qs$", 13 | "l1000_drugs_res_.+_\\\\d+svs.qs$", "l1000_genes_res_.+_\\\\d+svs.qs$", 14 | "diff_expr_symbol_.+_\\\\d+svs.qs$"), 15 | exclude = NULL 16 | ) 17 | } 18 | \arguments{ 19 | \item{data_dir}{Path to folder with dataset files} 20 | 21 | \item{patterns}{patterns to remove. Default is all.} 22 | } 23 | \description{ 24 | Delete stale dataset files after changing sample groups or running sva 25 | } 26 | \keyword{internal} 27 | -------------------------------------------------------------------------------- /man/req.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{req} 4 | \alias{req} 5 | \title{Check for required values} 6 | \usage{ 7 | req(..., cancelOutput = FALSE) 8 | } 9 | \arguments{ 10 | \item{...}{Values to check for truthiness.} 11 | 12 | \item{cancelOutput}{If TRUE and an output is being evaluated, stop processing 13 | as usual but instead of clearing the output, leave it in whatever state it happens to be in.} 14 | } 15 | \value{ 16 | The first value that was passed in. 17 | } 18 | \description{ 19 | Check for required values 20 | } 21 | -------------------------------------------------------------------------------- /man/rightClickMenu.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-ui.R 3 | \name{rightClickMenu} 4 | \alias{rightClickMenu} 5 | \title{Custom right click menu for selecting correlation point as query} 6 | \usage{ 7 | rightClickMenu() 8 | } 9 | \description{ 10 | Custom right click menu for selecting correlation point as query 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/run_custom_query.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-utils.R 3 | \name{run_custom_query} 4 | \alias{run_custom_query} 5 | \title{Run custom query} 6 | \usage{ 7 | run_custom_query(query_genes, res_paths, session) 8 | } 9 | \arguments{ 10 | \item{query_genes}{Named list of character vectors with \code{'up'} indicating genes to upregulate and \code{'dn'} 11 | containing genes to downregulate.} 12 | 13 | \item{res_paths}{List of paths to save results to.} 14 | 15 | \item{session}{session object from Shiny. Used to indicate progress.} 16 | } 17 | \value{ 18 | List with query results. 19 | } 20 | \description{ 21 | Run custom query 22 | } 23 | \keyword{internal} 24 | -------------------------------------------------------------------------------- /man/run_drug_queries.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{run_drug_queries} 4 | \alias{run_drug_queries} 5 | \title{Run drug queries} 6 | \usage{ 7 | run_drug_queries(top_table, drug_paths, es, ngenes = 200) 8 | } 9 | \value{ 10 | \code{res} with drug query results added to \code{'cmap'} \code{'l1000'} slots. 11 | } 12 | \description{ 13 | Used by run_comparison 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/run_fastmnn.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/import_scseq.R 3 | \name{run_fastmnn} 4 | \alias{run_fastmnn} 5 | \title{Run fastMNN integration} 6 | \usage{ 7 | run_fastmnn(logcounts, subset.row, scseqs) 8 | } 9 | \arguments{ 10 | \item{logcounts}{dgCMatrix of logcounts.} 11 | 12 | \item{subset.row}{A vector specifying which features to use for correction.} 13 | 14 | \item{scseqs}{list of \code{SingleCellExperiment} objects to integrate.} 15 | } 16 | \value{ 17 | Integrated \code{SingleCellExperiment} with logcounts assay, corrected reducedDim, and batch annotation. 18 | } 19 | \description{ 20 | Run fastMNN integration 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /man/run_harmony.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/import_scseq.R 3 | \name{run_harmony} 4 | \alias{run_harmony} 5 | \title{Run harmony integration} 6 | \usage{ 7 | run_harmony(logcounts, subset_row, batch, pairs = NULL) 8 | } 9 | \arguments{ 10 | \item{logcounts}{dgCMatrix of logcounts.} 11 | 12 | \item{subset_row}{Vector specifying the subset of features to use for dimensionality reduction. 13 | This can be a character vector of row names, an integer vector of row indices or a logical vector.} 14 | 15 | \item{pairs}{} 16 | } 17 | \value{ 18 | Integrated \code{SingleCellExperiment} with logcounts assay, corrected reducedDim, and batch annotation. 19 | } 20 | \description{ 21 | Run harmony integration 22 | } 23 | \keyword{internal} 24 | -------------------------------------------------------------------------------- /man/run_integrate_saved_scseqs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{run_integrate_saved_scseqs} 4 | \alias{run_integrate_saved_scseqs} 5 | \title{Integration Utility Function for Background Process} 6 | \usage{ 7 | run_integrate_saved_scseqs( 8 | sc_dir, 9 | tx2gene_dir, 10 | dataset_names, 11 | integration_name, 12 | integration_types, 13 | ref_name 14 | ) 15 | } 16 | \arguments{ 17 | \item{sc_dir}{Directory with saved single-cell datasets.} 18 | 19 | \item{integration_name}{Name for new integrated analysis.} 20 | 21 | \item{integration_types}{Character vector of integration types to run.} 22 | } 23 | \value{ 24 | TRUE is successful, otherwise FALSE 25 | } 26 | \description{ 27 | Used as background process via \link[callr]{r_bg} 28 | } 29 | \keyword{internal} 30 | -------------------------------------------------------------------------------- /man/run_kb_scseq.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/run_kb_scseq.R 3 | \name{run_kb_scseq} 4 | \alias{run_kb_scseq} 5 | \title{Run kallisto/bustools for quantifying 10X scRNA-seq data} 6 | \usage{ 7 | run_kb_scseq(indices_dir, data_dir, species = "human", threads = 4) 8 | } 9 | \arguments{ 10 | \item{indices_dir}{Directory with kallisto indices built with \code{build_kallisto_index}.} 11 | 12 | \item{data_dir}{Path to folder with 10X fastq.gz scRNA-seq files} 13 | 14 | \item{species}{Species to use index from. Currently supports 'human' or 'mouse'.} 15 | 16 | \item{threads}{Number of threads to use. Default is 1.} 17 | } 18 | \value{ 19 | called for side effects. 20 | } 21 | \description{ 22 | Run kallisto/bustools for quantifying 10X scRNA-seq data 23 | } 24 | \seealso{ 25 | \link{download_kb_index} 26 | } 27 | -------------------------------------------------------------------------------- /man/run_limma_scseq.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{run_limma_scseq} 4 | \alias{run_limma_scseq} 5 | \title{Run limma on pseudobulk experiment} 6 | \usage{ 7 | run_limma_scseq( 8 | summed, 9 | meta, 10 | species, 11 | trend = FALSE, 12 | method = "TMMwsp", 13 | with_fdata = FALSE, 14 | progress = NULL, 15 | value = 0, 16 | ... 17 | ) 18 | } 19 | \arguments{ 20 | \item{summed}{pseudobulk \code{SingleCellExperiment}. If \code{NULL}, \code{summed_path} must be supplied 21 | and the call is assumed to originate from \link[callr]{r_bg}.} 22 | 23 | \item{meta}{data.frame of sample metadata with column \code{group} and \code{row.names} 24 | set with \code{summed$batch}} 25 | 26 | \item{species}{species name used to retrieve feature annotation.} 27 | 28 | \item{trend}{Should limma-trend analysis be run (default is \code{FALSE})? Slightly faster than 29 | limma-voom (default). Used for pseudobulk grid differential expression analyses.} 30 | 31 | \item{method}{normalization method to be used.} 32 | 33 | \item{with_fdata}{if \code{TRUE}, adds Entrez IDs to fit object which are needed to 34 | downstream GO pathway analyses.} 35 | 36 | \item{progress}{progress object or \code{NULL}.} 37 | 38 | \item{value}{Initial value of progress.} 39 | 40 | \item{...}{additional arguments to \link[edgeR]{filterByExpr}.} 41 | } 42 | \value{ 43 | List with a fit object, model matrix, and normalized expression matrix. 44 | } 45 | \description{ 46 | Run limma on pseudobulk experiment 47 | } 48 | \keyword{internal} 49 | -------------------------------------------------------------------------------- /man/run_pca.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/import_scseq.R 3 | \name{run_pca} 4 | \alias{run_pca} 5 | \title{Run PCA on SingleCellExperiment} 6 | \usage{ 7 | run_pca(sce) 8 | } 9 | \arguments{ 10 | \item{sce}{\code{SingleCellExperiment} with \code{rowData(sce)$hvg} a boolean 11 | vector indicating rows (genes) to use as highly variable genes.} 12 | } 13 | \value{ 14 | \code{sce} with PCA reduction 15 | } 16 | \description{ 17 | Run PCA on SingleCellExperiment 18 | } 19 | \keyword{internal} 20 | -------------------------------------------------------------------------------- /man/run_post_cluster.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{run_post_cluster} 4 | \alias{run_post_cluster} 5 | \title{Post-Cluster Processing of SingleCellExperiment} 6 | \usage{ 7 | run_post_cluster( 8 | scseq, 9 | dataset_name, 10 | sc_dir, 11 | resoln = 1, 12 | progress = NULL, 13 | value = 0, 14 | reset_annot = TRUE 15 | ) 16 | } 17 | \arguments{ 18 | \item{scseq}{SingleCellExperiment} 19 | 20 | \item{dataset_name}{Name of dataset} 21 | 22 | \item{sc_dir}{Directory with single-cell datasets} 23 | 24 | \item{resoln}{resolution parameter} 25 | 26 | \item{progress}{progress} 27 | 28 | \item{value}{value} 29 | 30 | \item{reset_annot}{if \code{TRUE} then overwrites saved annotation with cluster indices. 31 | Set to \code{FALSE} when Azimuth is used as cluster annotation is defined.} 32 | } 33 | \description{ 34 | Performs the following: 35 | - downsampling (used for label transfer) 36 | - pseudobulk 37 | - saving data 38 | } 39 | -------------------------------------------------------------------------------- /man/run_reduction.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/import_scseq.R 3 | \name{run_reduction} 4 | \alias{run_reduction} 5 | \title{Run TSNE or UMAP} 6 | \usage{ 7 | run_reduction(sce, type = c("auto", "TSNE", "UMAP"), dimred = "PCA") 8 | } 9 | \arguments{ 10 | \item{sce}{\code{SingleCellExperiment}} 11 | 12 | \item{type}{One of \code{c('auto', 'TSNE', 'UMAP')}. If \code{'auto'} (default), 13 | runs UMAP is more than 5000 cells, otherwise TSNE.} 14 | 15 | \item{dimred}{reducedDim to run TSNE or UMAP on} 16 | } 17 | \value{ 18 | \code{sce} with \code{'TSNE'} or \code{'UMAP'} \code{reducedDim} 19 | } 20 | \description{ 21 | Run TSNE or UMAP 22 | } 23 | \keyword{internal} 24 | -------------------------------------------------------------------------------- /man/run_scseq_qc.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/scseq_qc.R 3 | \name{run_scseq_qc} 4 | \alias{run_scseq_qc} 5 | \title{Run quality control for single-cell dataset} 6 | \usage{ 7 | run_scseq_qc( 8 | sce, 9 | metrics = c("low_lib_size", "low_n_features", "high_subsets_mito_percent", 10 | "low_subsets_ribo_percent", "high_doublet_score") 11 | ) 12 | } 13 | \arguments{ 14 | \item{sce}{\code{SingleCellExperiment}.} 15 | 16 | \item{metrics}{Character vector of metrics to remove outliers for.} 17 | } 18 | \value{ 19 | \code{sce} with outliers removed. 20 | } 21 | \description{ 22 | Run quality control for single-cell dataset 23 | } 24 | \keyword{internal} 25 | -------------------------------------------------------------------------------- /man/save_lmfit.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/diff_utils.R 3 | \name{save_lmfit} 4 | \alias{save_lmfit} 5 | \title{Save lmfit result to disk} 6 | \usage{ 7 | save_lmfit(lm_fit, dataset_dir, numsv = 0, anal_suffix = "") 8 | } 9 | \arguments{ 10 | \item{lm_fit}{Result of run_limma or run_limma_scseq} 11 | 12 | \item{dataset_dir}{directory to save results in} 13 | 14 | \item{numsv}{Number of surrogate variables modeled. Default is 0.} 15 | 16 | \item{anal_suffix}{suffix to append to saved name.} 17 | } 18 | \description{ 19 | Save lmfit result to disk 20 | } 21 | \keyword{internal} 22 | -------------------------------------------------------------------------------- /man/save_scseq_args.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{save_scseq_args} 4 | \alias{save_scseq_args} 5 | \title{Save arguments for integration/subsetting} 6 | \usage{ 7 | save_scseq_args(args, dataset_name, sc_dir) 8 | } 9 | \arguments{ 10 | \item{args}{Arguments to save} 11 | 12 | \item{dataset_name}{Name of analysis} 13 | 14 | \item{sc_dir}{Directory with single-cell analyses} 15 | } 16 | \description{ 17 | Save arguments for integration/subsetting 18 | } 19 | \keyword{internal} 20 | -------------------------------------------------------------------------------- /man/save_scseq_data.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{save_scseq_data} 4 | \alias{save_scseq_data} 5 | \title{Save Single Cell RNA-seq data for app} 6 | \usage{ 7 | save_scseq_data(scseq_data, dataset_name, sc_dir, overwrite = TRUE) 8 | } 9 | \arguments{ 10 | \item{scseq_data}{Named list with \code{scseq}, \code{markers}, and/or \code{annot}} 11 | 12 | \item{dataset_name}{The analysis name.} 13 | 14 | \item{sc_dir}{Path to directory with single-cell datasets.} 15 | 16 | \item{overwrite}{overwrite \code{dataset_name} sub-directory?} 17 | } 18 | \description{ 19 | Save Single Cell RNA-seq data for app 20 | } 21 | \keyword{internal} 22 | -------------------------------------------------------------------------------- /man/scPage.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-server.R 3 | \name{scPage} 4 | \alias{scPage} 5 | \title{Logic for Single Cell Tab} 6 | \usage{ 7 | scPage( 8 | input, 9 | output, 10 | session, 11 | sc_dir, 12 | indices_dir, 13 | tx2gene_dir, 14 | gs_dir, 15 | is_mobile, 16 | add_sc, 17 | remove_sc, 18 | integrate_sc, 19 | export_sc 20 | ) 21 | } 22 | \arguments{ 23 | \item{input, output, session}{standard shiny module boilerplate} 24 | 25 | \item{sc_dir}{sub folder of \code{project_dir} where single-cell data is stored} 26 | 27 | \item{indices_dir}{Path to directory containing \code{kallisto} indices and whitelists.} 28 | 29 | \item{tx2gene_dir}{Path to directory containing transcript to gene maps 30 | produced by \link[dseqr.data]{load_tx2gene}.} 31 | 32 | \item{gs_dir}{Path to directory where gene to Gene Ontology maps produced by \link{get_genego} are saved.} 33 | 34 | \item{is_mobile}{is the page being shown on a mobile device? If \code{TRUE}, 35 | then various styles are updated accordingly.} 36 | 37 | \item{add_sc}{reactive that is used to trigger the modal to import single-cell datasets.} 38 | 39 | \item{remove_sc}{reactive that is used to trigger the modal to delete single-cell datasets.} 40 | 41 | \item{integrate_sc}{reactive that is used to trigger the modal to integrate single-cell datasets.} 42 | 43 | \item{export_sc}{reactive that is used to trigger the modal to export single-cell datasets.} 44 | } 45 | \value{ 46 | Called with \link[shiny]{callModule} to generate logic for 47 | single-cell tab. 48 | } 49 | \description{ 50 | Logic for Single Cell Tab 51 | } 52 | -------------------------------------------------------------------------------- /man/scPageUI.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-ui.R 3 | \name{scPageUI} 4 | \alias{scPageUI} 5 | \title{UI for Single Cell Exploration page} 6 | \usage{ 7 | scPageUI(id, tab, active) 8 | } 9 | \arguments{ 10 | \item{id}{Identification string that is names-paced using \link[shiny]{NS}.} 11 | 12 | \item{tab}{Name to appear on tab} 13 | 14 | \item{active}{Name of current active \code{tab}} 15 | } 16 | \value{ 17 | shiny.tag with html for single-cell tab 18 | } 19 | \description{ 20 | UI for Single Cell Exploration page 21 | } 22 | \examples{ 23 | 24 | scPageUI('sc', tab = 'Single Cell', active = 'Single Cell') 25 | 26 | } 27 | -------------------------------------------------------------------------------- /man/sc_dl_filename.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{sc_dl_filename} 4 | \alias{sc_dl_filename} 5 | \title{Utility to generate filename for single cell download csv} 6 | \usage{ 7 | sc_dl_filename(cluster, anal, comparison_type) 8 | } 9 | \arguments{ 10 | \item{cluster}{Character vector of cluster names} 11 | 12 | \item{anal}{result of diff_expr_scseq} 13 | 14 | \item{comparison_type}{either 'samples' or 'clusters'} 15 | } 16 | \value{ 17 | File name string 18 | } 19 | \description{ 20 | Utility to generate filename for single cell download csv 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /man/scseq_part_path.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{scseq_part_path} 4 | \alias{scseq_part_path} 5 | \title{Get path to saved scseq part} 6 | \usage{ 7 | scseq_part_path(data_dir, dataset_name, part) 8 | } 9 | \arguments{ 10 | \item{data_dir}{Path to directory with analyses.} 11 | 12 | \item{dataset_name}{Name of analysis.} 13 | 14 | \item{part}{either \code{'annot'}, \code{'scseq'}, or \code{'markers'}.} 15 | } 16 | \value{ 17 | Path to analysis \code{part}. 18 | } 19 | \description{ 20 | Get path to saved scseq part 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /man/selectedAnalInput.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-ui.R 3 | \name{selectedAnalInput} 4 | \alias{selectedAnalInput} 5 | \title{Analysis input for Drugs page} 6 | \usage{ 7 | selectedAnalInput(id, label = "Select a dataset or query signature:") 8 | } 9 | \description{ 10 | Analysis input for Drugs page 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/selectedDrugStudyInput.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-ui.R 3 | \name{selectedDrugStudyInput} 4 | \alias{selectedDrugStudyInput} 5 | \title{Select drugs study (CMAP or L1000) for drugs page} 6 | \usage{ 7 | selectedDrugStudyInput(id) 8 | } 9 | \description{ 10 | Select drugs study (CMAP or L1000) for drugs page 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/selectedPertSignatureInput.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-ui.R 3 | \name{selectedPertSignatureInput} 4 | \alias{selectedPertSignatureInput} 5 | \title{UI for seperate drugsPertInput for CMAP/L1000} 6 | \usage{ 7 | selectedPertSignatureInput(id) 8 | } 9 | \description{ 10 | UI for seperate drugsPertInput for CMAP/L1000 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/send_slack_error.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/recover_error.R 3 | \name{send_slack_error} 4 | \alias{send_slack_error} 5 | \title{Send shiny errors to slack} 6 | \usage{ 7 | send_slack_error(project, user) 8 | } 9 | \arguments{ 10 | \item{project}{The project that the error originated from} 11 | 12 | \item{user}{The user that the error originated from} 13 | } 14 | \value{ 15 | Generates an alert in browser 16 | } 17 | \description{ 18 | Send shiny errors to slack 19 | } 20 | -------------------------------------------------------------------------------- /man/sort_clusters.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{sort_clusters} 4 | \alias{sort_clusters} 5 | \title{shortest distance between cluster centroids} 6 | \usage{ 7 | sort_clusters(label_coords) 8 | } 9 | \arguments{ 10 | \item{label_coords}{data.frame with columns label, x, and y giving coordinates 11 | of cluster labels} 12 | } 13 | \value{ 14 | \code{label_coords} sorted by shortest path 15 | } 16 | \description{ 17 | TODO: use to order clusters by similarity 18 | } 19 | \keyword{internal} 20 | -------------------------------------------------------------------------------- /man/sort_query_table_clin.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/format_query_table.R 3 | \name{sort_query_table_clin} 4 | \alias{sort_query_table_clin} 5 | \title{final sorting/filtering of query table} 6 | \usage{ 7 | sort_query_table_clin( 8 | query_table_clin, 9 | sort_by, 10 | sort_abs, 11 | direction, 12 | drug_study, 13 | remove_html = FALSE 14 | ) 15 | } 16 | \arguments{ 17 | \item{query_table_clin}{result of \code{filter_clinical}} 18 | 19 | \item{sort_by}{Metric to sort by. Either \code{'avg_cor'} (default) or \code{'min_cor'}.} 20 | 21 | \item{sort_abs}{Should results be sorted based on absolute correlation? Default is \code{FALSE}.} 22 | 23 | \item{direction}{Direction of correlation to sort results by. One of \code{'both'}, \code{'similar'}, or \code{'opposing'} (default).} 24 | 25 | \item{drug_study}{Queried database giving rise to \code{query_res}. 26 | One of \code{'CMAP02'},\code{'L1000 Genetic'}, or \code{'L1000 Drugs'}.} 27 | 28 | \item{remove_html}{Should html columns be removed? For non-webapp usage.} 29 | } 30 | \value{ 31 | Final query table 32 | } 33 | \description{ 34 | final sorting/filtering of query table 35 | } 36 | \keyword{internal} 37 | -------------------------------------------------------------------------------- /man/standardize_cellranger.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/import_scseq.R 3 | \name{standardize_cellranger} 4 | \alias{standardize_cellranger} 5 | \title{Rename CellRanger files for loading by Read10X} 6 | \usage{ 7 | standardize_cellranger(data_dir) 8 | } 9 | \arguments{ 10 | \item{data_dir}{Path to folder with CellRanger files.} 11 | } 12 | \description{ 13 | Rename CellRanger files for loading by Read10X 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/subset_saved_scseq.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{subset_saved_scseq} 4 | \alias{subset_saved_scseq} 5 | \title{Subset SingleCellExperiment} 6 | \usage{ 7 | subset_saved_scseq( 8 | sc_dir, 9 | founder, 10 | from_dataset, 11 | dataset_name, 12 | exclude_clusters = NULL, 13 | subset_metrics = NULL, 14 | is_integrated = FALSE, 15 | is_include = FALSE, 16 | progress = NULL, 17 | hvgs = NULL, 18 | ref_name = NULL, 19 | tx2gene_dir = NULL 20 | ) 21 | } 22 | \arguments{ 23 | \item{sc_dir}{Directory with saved single-cell datasets.} 24 | 25 | \item{founder}{Name of original founding dataset (may be ancestor of \code{from_dataset}).} 26 | 27 | \item{from_dataset}{Name of parent dataset.} 28 | 29 | \item{dataset_name}{Name for new subset dataset.} 30 | 31 | \item{exclude_clusters}{Charactor vector of clusters for excluding cells.} 32 | 33 | \item{subset_metrics}{Character vector of metrics for excluding cells.} 34 | 35 | \item{progress}{Optional shiny progress object.} 36 | } 37 | \value{ 38 | TRUE is successful, otherwise FALSE 39 | } 40 | \description{ 41 | Subset SingleCellExperiment 42 | } 43 | \keyword{internal} 44 | -------------------------------------------------------------------------------- /man/summarise_query_table.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/format_query_table.R 3 | \name{summarise_query_table} 4 | \alias{summarise_query_table} 5 | \title{Summarise annotated query table} 6 | \usage{ 7 | summarise_query_table( 8 | query_table_annot, 9 | is_genetic, 10 | cells, 11 | sort_abs, 12 | remove_html = FALSE, 13 | ntop = 1500 14 | ) 15 | } 16 | \arguments{ 17 | \item{query_table_annot}{result of \link{annot_query_res}} 18 | 19 | \item{is_genetic}{Boolean indicating if the query results are from L1000 genetic perturbations.} 20 | 21 | \item{cells}{Character vector of cell types to include. Default (\code{NULL}) includes all cell types.} 22 | 23 | \item{sort_abs}{Should results be sorted based on absolute correlation? Default is \code{FALSE}.} 24 | 25 | \item{remove_html}{Should html columns be removed? For non-webapp usage.} 26 | 27 | \item{ntop}{Integer indicating the number of rows to keep after sorting by \code{arrange_by}.} 28 | } 29 | \value{ 30 | summarised query table 31 | } 32 | \description{ 33 | Summarise annotated query table 34 | } 35 | \keyword{internal} 36 | -------------------------------------------------------------------------------- /man/summarize_compound.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-utils.R 3 | \name{summarize_compound} 4 | \alias{summarize_compound} 5 | \title{Summarize query results and annotations by perturbation} 6 | \usage{ 7 | summarize_compound(query_table, is_genetic = FALSE, ntop = 1500) 8 | } 9 | \arguments{ 10 | \item{query_table}{\code{data.frame} of perturbation correlations and annotations.} 11 | 12 | \item{is_genetic}{is \code{query_table} from L1000 genetic perts?} 13 | 14 | \item{ntop}{Integer indicating the number of rows to keep after sorting by \code{arrange_by}.} 15 | } 16 | \value{ 17 | \code{data.frame} of perturbation correlations and annotations summarized by perturbation. 18 | } 19 | \description{ 20 | Takes a \code{data.frame} with one row per signatures and summarizes to one row per compound. 21 | } 22 | \details{ 23 | Variables related to individual signatures (cell line, dose, duration, and sample number) are 24 | pasted together and added as a list to \code{'title'} column. Query correlation values are also added as a list to 25 | the \code{'Correlation'} column. 26 | 27 | Clinical status is summarized by keeping the most advanced phase only (e.g. Launched > Phase 3). For all other variables, 28 | all unique entries are paste together seperated by \code{'|'}. 29 | } 30 | \keyword{internal} 31 | -------------------------------------------------------------------------------- /man/tabPane.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ui-utils.R 3 | \name{tabPane} 4 | \alias{tabPane} 5 | \title{UI for a tab pane} 6 | \usage{ 7 | tabPane(tab, active, ...) 8 | } 9 | \arguments{ 10 | \item{tab}{The name of the tab} 11 | 12 | \item{active}{The name of the active tab} 13 | 14 | \item{...}{The UI elements to place in the tab} 15 | } 16 | \value{ 17 | shiny div tag with UI for tab 18 | } 19 | \description{ 20 | UI for a tab pane 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /man/theme_dimgray.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/scseq_reports.R 3 | \name{theme_dimgray} 4 | \alias{theme_dimgray} 5 | \title{Make ggplot axes and text dimgray} 6 | \usage{ 7 | theme_dimgray(with_nums = TRUE) 8 | } 9 | \arguments{ 10 | \item{with_nums}{Include axis ticks/text? Default is TRUE.} 11 | } 12 | \value{ 13 | ggplot2 \code{theme} object 14 | } 15 | \description{ 16 | Make ggplot axes and text dimgray 17 | } 18 | \examples{ 19 | 20 | library(ggplot2) 21 | ggplot(mtcars, aes(wt, mpg)) + geom_point() + theme_dimgray() 22 | 23 | } 24 | -------------------------------------------------------------------------------- /man/theme_no_xaxis.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/scseq_reports.R 3 | \name{theme_no_xaxis} 4 | \alias{theme_no_xaxis} 5 | \title{Remove ggplot xaxis title, text, and ticks} 6 | \usage{ 7 | theme_no_xaxis() 8 | } 9 | \value{ 10 | ggplot2 \code{theme} object 11 | } 12 | \description{ 13 | Remove ggplot xaxis title, text, and ticks 14 | } 15 | \examples{ 16 | 17 | library(ggplot2) 18 | ggplot(mtcars, aes(wt, mpg)) + geom_point() + theme_no_xaxis() 19 | 20 | } 21 | -------------------------------------------------------------------------------- /man/theme_no_yaxis.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/scseq_reports.R 3 | \name{theme_no_yaxis} 4 | \alias{theme_no_yaxis} 5 | \title{Remove ggplot yaxis title, text, and ticks} 6 | \usage{ 7 | theme_no_yaxis() 8 | } 9 | \value{ 10 | ggplot2 \code{theme} object 11 | } 12 | \description{ 13 | Remove ggplot yaxis title, text, and ticks 14 | } 15 | \examples{ 16 | 17 | library(ggplot2) 18 | ggplot(mtcars, aes(wt, mpg)) + geom_point() + theme_no_yaxis() 19 | 20 | } 21 | -------------------------------------------------------------------------------- /man/theme_pubr.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/theme_pubr.R 3 | \name{theme_pubr} 4 | \alias{theme_pubr} 5 | \title{Publication ready theme} 6 | \usage{ 7 | theme_pubr( 8 | base_size = 12, 9 | base_family = "", 10 | border = FALSE, 11 | margin = TRUE, 12 | legend = c("top", "bottom", "left", "right", "none"), 13 | x.text.angle = 0 14 | ) 15 | } 16 | \arguments{ 17 | \item{base_size}{base font size} 18 | 19 | \item{base_family}{base font family} 20 | 21 | \item{border}{logical value. Default is FALSE. If TRUE, add panel border.} 22 | 23 | \item{margin}{logical value. Default is TRUE. If FALSE, reduce plot margin.} 24 | 25 | \item{legend}{character specifying legend position. Allowed values are one of 26 | c("top", "bottom", "left", "right", "none"). Default is "top" side position. 27 | to remove the legend use legend = "none". Legend position can be also 28 | specified using a numeric vector c(x, y). In this case it is possible to 29 | position the legend inside the plotting area. x and y are the coordinates of 30 | the legend box. Their values should be between 0 and 1. c(0,0) corresponds 31 | to the "bottom left" and c(1,1) corresponds to the "top right" position. For 32 | instance use legend = c(0.8, 0.2).} 33 | 34 | \item{x.text.angle}{Rotation angle of x axis tick labels. Default value is 0. 35 | Use 90 for vertical text.} 36 | } 37 | \description{ 38 | Create a publication ready theme. From package ggpubr. 39 | } 40 | \examples{ 41 | library(ggplot2) 42 | 43 | p <- ggplot(mtcars, aes(x = wt, y = mpg)) + 44 | geom_point(aes(color = gear)) 45 | 46 | # Default plot 47 | p 48 | 49 | # Use theme_pubr() 50 | p + dseqr:::theme_pubr() 51 | 52 | 53 | } 54 | \keyword{internal} 55 | -------------------------------------------------------------------------------- /man/transfer_prev_annot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{transfer_prev_annot} 4 | \alias{transfer_prev_annot} 5 | \title{Transfer annotation when change resolution} 6 | \usage{ 7 | transfer_prev_annot(resoln, prev_resoln, dataset_name, sc_dir) 8 | } 9 | \arguments{ 10 | \item{resoln}{new resolution} 11 | 12 | \item{prev_resoln}{previous resolution} 13 | 14 | \item{dataset_name}{name of single-cell dataset} 15 | 16 | \item{sc_dir}{directory with folder named \code{dataset_name}} 17 | } 18 | \value{ 19 | saves new annotation in resolution subdirectory 20 | } 21 | \description{ 22 | Transfer annotation when change resolution 23 | } 24 | \keyword{internal} 25 | -------------------------------------------------------------------------------- /man/validate_custom_query.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-utils.R 3 | \name{validate_custom_query} 4 | \alias{validate_custom_query} 5 | \title{Validate custom query} 6 | \usage{ 7 | validate_custom_query(dn_genes, up_genes, custom_name) 8 | } 9 | \arguments{ 10 | \item{dn_genes}{Character vector of genes to upregulate} 11 | 12 | \item{up_genes}{Character vector of genes to downregulate} 13 | 14 | \item{custom_name}{Name for new custom analysis} 15 | } 16 | \value{ 17 | \code{NULL} if valid, otherwise an error message 18 | } 19 | \description{ 20 | Validate custom query 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /man/validate_integration.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{validate_integration} 4 | \alias{validate_integration} 5 | \title{Validate dataset selection for integration} 6 | \usage{ 7 | validate_integration(types, name, ref_name, dataset_names, sc_dir) 8 | } 9 | \value{ 10 | \code{NULL} if valid, otherwise an error message 11 | } 12 | \description{ 13 | Validate dataset selection for integration 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/validate_metric.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{validate_metric} 4 | \alias{validate_metric} 5 | \title{Validate a custom metric} 6 | \usage{ 7 | validate_metric(metric, scseq) 8 | } 9 | \arguments{ 10 | \item{metric}{String with custom metric to evaluate.} 11 | 12 | \item{scseq}{\code{SingleCellExperiment} to evaluate \code{metric} for.} 13 | } 14 | \value{ 15 | Either a data.frame is successful or a object with class 'try-error'. 16 | } 17 | \description{ 18 | Validate a custom metric 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/validate_pdata.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-bulk-utils.R 3 | \name{validate_pdata} 4 | \alias{validate_pdata} 5 | \title{Validate pdata before differential expression analysis} 6 | \usage{ 7 | validate_pdata(pdata) 8 | } 9 | \arguments{ 10 | \item{pdata}{data.frame with column \code{'Group'}} 11 | } 12 | \value{ 13 | NULL if valid, otherwise a character vector indicating what's wrong 14 | } 15 | \description{ 16 | Validate pdata before differential expression analysis 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/validate_preds.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-sc-utils.R 3 | \name{validate_preds} 4 | \alias{validate_preds} 5 | \title{Check that label predictions aren't from overwritten datasets} 6 | \usage{ 7 | validate_preds(preds, sc_dir) 8 | } 9 | \arguments{ 10 | \item{preds}{List of predictions} 11 | 12 | \item{sc_dir}{Directory with single-cell datasets} 13 | } 14 | \value{ 15 | \code{preds} that were generated from current datasets 16 | } 17 | \description{ 18 | Check that label predictions aren't from overwritten datasets 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/validate_up_annot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-bulk-utils.R 3 | \name{validate_up_annot} 4 | \alias{validate_up_annot} 5 | \title{Validate uploaded bulk annotation} 6 | \usage{ 7 | validate_up_annot(up, ref) 8 | } 9 | \description{ 10 | Validate uploaded bulk annotation 11 | } 12 | \keyword{internal} 13 | -------------------------------------------------------------------------------- /man/validate_up_custom.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/modules-drugs-utils.R 3 | \name{validate_up_custom} 4 | \alias{validate_up_custom} 5 | \title{Validate uploaded custom query} 6 | \usage{ 7 | validate_up_custom(top_table, custom_name) 8 | } 9 | \arguments{ 10 | \item{top_table}{data.frame with logFC, dprime, or effect sizes as column 1 11 | and row.names as HGNC symbols} 12 | 13 | \item{custom_name}{Name for new custom analysis} 14 | } 15 | \value{ 16 | \code{NULL} if valid, otherwise an error message 17 | } 18 | \description{ 19 | Validate uploaded custom query 20 | } 21 | \keyword{internal} 22 | -------------------------------------------------------------------------------- /renv/.gitignore: -------------------------------------------------------------------------------- 1 | sandbox/ 2 | cellar/ 3 | library/ 4 | local/ 5 | lock/ 6 | python/ 7 | staging/ 8 | -------------------------------------------------------------------------------- /setup/get_sysdeps_run.R: -------------------------------------------------------------------------------- 1 | install.packages('maketools') 2 | 3 | lock <- renv:::renv_lockfile_read('renv.lock') 4 | pkgs <- names(lock$Packages) 5 | 6 | sysdeps_run <- NULL 7 | for (pkg in pkgs) { 8 | deps <- maketools::package_sysdeps(pkg) 9 | if (!nrow(deps)) next 10 | 11 | sysdeps_run <- c(sysdeps_run, deps$package) 12 | } 13 | 14 | sysdeps_run <- unique(sysdeps_run) 15 | writeLines(sysdeps_run, 'sysdeps_run.txt') 16 | 17 | remove.packages('maketools') 18 | 19 | -------------------------------------------------------------------------------- /setup/install_debian_packages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Bash "strict mode", to help catch problems and bugs in the shell 4 | # script. Every bash script you write should include this. See 5 | # http://redsymbol.net/articles/unofficial-bash-strict-mode/ for 6 | # details. 7 | set -euo pipefail 8 | 9 | export DEBIAN_FRONTEND=noninteractive 10 | 11 | apt-get update 12 | 13 | # Install required Debian packages 14 | apt-get -y install --no-install-recommends "$@" 15 | 16 | # Delete cached files we don't need anymore 17 | apt-get clean 18 | rm -rf /var/lib/apt/lists/* 19 | -------------------------------------------------------------------------------- /setup/run_ci_tests.R: -------------------------------------------------------------------------------- 1 | Sys.setenv('NOT_CRAN' = 'true') 2 | args <- c('--no-manual', '--no-build-vignettes') 3 | rcmdcheck::rcmdcheck(error_on = 'error', build_args = args, args = args) 4 | testthat::test_file('inst/app/tests/testthat/test-shinytest2.R', stop_on_failure = TRUE) 5 | -------------------------------------------------------------------------------- /setup/sysdeps_build_debian.txt: -------------------------------------------------------------------------------- 1 | pkg-config 2 | libcurl4-openssl-dev 3 | libv8-dev 4 | libxml2-dev 5 | libssl-dev 6 | libbz2-dev 7 | liblzma-dev 8 | libhdf5-dev 9 | zlib1g-dev 10 | libpng-dev 11 | libjpeg-dev 12 | libcairo2-dev 13 | libxt-dev 14 | libharfbuzz-dev 15 | libfribidi-dev 16 | libfreetype6-dev 17 | libtiff-dev 18 | patch 19 | git 20 | wget 21 | -------------------------------------------------------------------------------- /tests/testthat.R: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(dseqr) 3 | 4 | test_check("dseqr") 5 | -------------------------------------------------------------------------------- /tests/testthat/setup.R: -------------------------------------------------------------------------------- 1 | # Load application support files into testing environment 2 | shinytest2::load_app_env() 3 | -------------------------------------------------------------------------------- /tests/testthat/test_calcx.R: -------------------------------------------------------------------------------- 1 | test_that("calcx return midpoint of width when correlation is 0", { 2 | xpos <- calcx(0, width=200) 3 | expect_equal(xpos, 100) 4 | }) 5 | 6 | test_that("calcx without padding returns exactly devided values", { 7 | expect_equal(calcx(-1, width=200, pad = 0), 0) 8 | expect_equal(calcx(-0.5, width=200, pad = 0), 50) 9 | expect_equal(calcx(0, width=200, pad = 0), 100) 10 | expect_equal(calcx(0.5, width=200, pad = 0), 150) 11 | expect_equal(calcx(1, width=200, pad = 0), 200) 12 | }) 13 | 14 | test_that("calcx with padding avoids endpoints", { 15 | expect_gt(calcx(-1), calcx(-1, pad = 0)) 16 | expect_lt(calcx(1), calcx(1, pad = 0)) 17 | }) 18 | -------------------------------------------------------------------------------- /tests/testthat/test_summarize_compound.R: -------------------------------------------------------------------------------- 1 | library(tibble) 2 | 3 | query_res <- tibble('Correlation' = c(0.2, 0.3, 0.4), 4 | 'title' = rep('MCF7_1e-2M_6h_3', 3), 5 | 'cor_title' = rep('MCF7_1e-2M_6h_3', 3), 6 | 'Compound' = rep('LY1', 3), 7 | 'Cell Line' = rep('MCF7', 3), 8 | 'Dose' = rep('1e-2M', 3), 9 | 'Duration' = rep('6h', 3), 10 | 'Samples(n)' = rep(3, 3), 11 | 'Clinical Phase' = factor(c('Phase 1', 'Phase 2', 'Phase 3'), ordered = TRUE), 12 | 'MOA' = c('dog', 'cat', NA), 13 | 'Target' = rep(NA_character_, 3)) 14 | 15 | query_res <- summarize_compound(query_res) 16 | 17 | test_that("summarize_compound collapses multiple results into 1", { 18 | expect_equal(nrow(query_res), 1) 19 | }) 20 | 21 | test_that("summarize_compound puts all correlations into a list", { 22 | expect_equal(query_res$Correlation, I(list(c(0.2, 0.3, 0.4)))) 23 | }) 24 | 25 | test_that("summarize_compound creates title column with list", { 26 | expect_equal(query_res$title, I(list(rep('MCF7_1e-2M_6h_3', 3)))) 27 | }) 28 | 29 | # test_that("summarize_compound pastes unique non-NA entries for other columns", { 30 | # expect_equal(query_res$MOA, "dog | cat") 31 | # }) 32 | 33 | test_that("summarize_compound keeps most advanced clinical phase only", { 34 | expect_equal(as.character(query_res$`Clinical Phase`), "Phase 3") 35 | }) 36 | 37 | test_that("summarize_compound keeps NA if all are NA", { 38 | expect_true(is.na(query_res$Target)) 39 | }) 40 | -------------------------------------------------------------------------------- /tests/testthat/test_validate_bulk_labels.R: -------------------------------------------------------------------------------- 1 | test_that("three unpaired samples is valid", { 2 | 3 | up_df <- data.frame(name = c('A.fastq.gz', 'B.fastq.gz', 'C.fastq.gz')) 4 | pairs <- reps <- rep(NA, nrow(up_df)) 5 | expect_null(validate_bulk_labels(up_df, reps, pairs, paired = FALSE)) 6 | }) 7 | 8 | test_that("two unpaired samples is not valid", { 9 | 10 | up_df <- data.frame(name = c('A.fastq.gz', 'B.fastq.gz')) 11 | pairs <- reps <- rep(NA, nrow(up_df)) 12 | expect_match(validate_bulk_labels(up_df, reps, pairs, paired = FALSE), 'At least 3 samples') 13 | }) 14 | 15 | test_that("three paired samples is valid", { 16 | 17 | up_df <- data.frame(name = c('A1.fastq.gz', 'A2.fastq.gz', 'B1.fastq.gz', 'B2.fastq.gz', 'C1.fastq.gz', 'C2.fastq.gz')) 18 | reps <- rep(NA, nrow(up_df)) 19 | pairs <- c(1, 1, 2, 2, 3, 3) 20 | expect_null(validate_bulk_labels(up_df, reps, pairs, paired = TRUE)) 21 | }) 22 | 23 | test_that("two paired samples is not valid", { 24 | 25 | up_df <- data.frame(name = c('A1.fastq.gz', 'A2.fastq.gz', 'B1.fastq.gz', 'B2.fastq.gz')) 26 | reps <- rep(NA, nrow(up_df)) 27 | pairs <- c(1, 1, 2, 2) 28 | expect_match(validate_bulk_labels(up_df, reps, pairs, paired = TRUE), 'At least 3 samples') 29 | }) 30 | 31 | test_that("Paired files must all have an associated pair", { 32 | 33 | up_df <- data.frame(name = c('A1.fastq.gz', 'A2.fastq.gz', 'B1.fastq.gz', 'B2.fastq.gz', 'C1.fastq.gz', 'C2.fastq.gz')) 34 | reps <- rep(NA, nrow(up_df)) 35 | pairs <- c(1, 1, 2, 2, 3, 3) 36 | expect_null(validate_bulk_labels(up_df, reps, pairs, paired = TRUE)) 37 | 38 | # remove a pair 39 | pairs[1:2] <- NA 40 | expect_match(validate_bulk_labels(up_df, reps, pairs, paired = TRUE), 'must belong to a pair') 41 | }) 42 | --------------------------------------------------------------------------------