sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
d5d7ee26f807935d101a1ea279c02ea9cc7aa7d891f1ed10fb6ef34ca0619342
R
16,119
418
# Load required R libraries library(SKAT) library(parallel) # import # Define the function to perform the SKAT test perform_skat_test <- function(gene_name, gene_chromosome, region_start, region_end, gene_snps, genotype_prefix, result_folder, result_file, is_binary = TRUE) { tryCatch({ genotype_prefix <- paste0(g...
99d3492ad5be12a497e9a584cfd95b14c50821343061c31180c74a357a088cb7
R
16,126
529
#' @importFrom methods is new #' @importFrom R6 R6Class #' @importFrom utils read.delim #' @importClassesFrom Matrix dsparseMatrix dsparseVector dgCMatrix dgRMatrix CsparseMatrix RsparseMatrix Predictor <- R6::R6Class( classname = "lgb.Predictor", cloneable = FALSE, public = list( # Initialize will create a...
f770ac2e30d326923bcb3c1bc14b00abf4c4985a62913abcbfb43007039d6fbb
R
16,149
651
# Test product_to_platesize ---- test_that( "product_to_platesize works", { expect_equal( object = product_to_platesize(product = "Target 96"), expected = 96L ) expect_equal( object = product_to_platesize(product = "Target 48"), expected = 48L ) } ) # Test olink_display_p...
8b2f5e56891d271aad7839e76952cdaa5842186f957adfdbbaff7a3d66d3a2b6
R
16,153
472
# ============================================================================== # Script Name: Correlation_Heatmap.R # Description: Calculate Pearson correlation coefficients between samples based # on TPM expression matrix and generate a heatmap. # Input: gene_tpm.addAnno.xls # Output: F...
bc51a19c96e1d58642658dbf834762c9f49b613636bd100e0d9b3aa2f87fc72b
R
16,169
308
#' Run Iterative Regional Ablation on Discovered Biomarkers #' #' Reads a CSV file of discovered biomarkers (typically from `run_experiments`), #' and for each biomarker, performs an iterative single-region ablation using #' `region_ablation` to minimize aggregated Sample Size Estimate (SSE). #' Results of the ablation...
dad457350702570a412b3c26abc5d6c6eccbb55f5d2cd3e8da519663fa28b145
R
16,188
326
# Libraries are loaded from R/_libraries.R message("[CLUSTER_DATA_UPLOAD] Loading cluster_data_upload module") # Define a named vector of choices for clustering methods clusterdata_file <- c("Continue from clustering", "Upload saved R data") names(clusterdata_file) <- c("memory_data", "uploaded_data") message("[CLUST...
0b3399fa4a471bd67438ea13a75176ae9f9fbab96d9be2cf8d8aa021a4a47d1f
R
16,199
589
#' Get names of all Olink platforms. #' #' @author #' Klev Diamanti #' #' @keywords internal #' #' @return A character vector with names of all Olink platforms. #' get_all_olink_platforms <- function() { # return all Olink platforms olk_all_platforms <- accepted_olink_platforms |> dplyr::pull( .data[["n...
3538fc1445dff1b47667727e0522a36ab30253b976b25a62824c2abc14f85f86
R
16,230
355
#' Function to add bezier control points for horizontal layout. #' #' @param data A \code{data.frame} containing x and y coordinates. #' @param strength The proportion to move the control point along the y-axis towards the other end of the bezier curve. #' @return A \code{vector} of rescaled coordinate values. #' @auth...
5f6b26599c329f4779b3068505f45cbb79bdbcae36a7bee58d5d1186746d7636
R
16,336
359
#' Function to break PAF alignment into matching bases between query and target sequence. #' In addition, locations of inserted bases in query and target sequence can be reported as well. #' #' @param paf.aln A \code{data.frame} or \code{tibble} containing a single PAF record with 12 mandatory columns #' along with CIG...
fccf2feeb7dde12de97d9be4658b30dee744576e7c1d773ba3fc4b7d1963ccb2
R
16,340
412
################################ ## Functions to do subsetting ## ################################ #' @title Subset groups #' @name subset_groups #' @description Method to subset (or sort) groups #' @param object a \code{\link{MOFA}} object. #' @param groups character vector with the groups names, numeric vector with...
2b5d29fb274683a545e182667634df3f89aade003700abf2b93d9882da109e45
R
16,349
380
# Yang Yang 2020 # This script is for analyzing chromothripsis, using modified ShatterSeek code. # # Input files: # 1. independent-specimens.wgs.primary-plus.tsv # this file is used to choose independent specimens # 2. analyses/copy_number_consensus_call/results/pbta-cnv-consensus.seg.gz # CNV file is needed in shatter...
cbd85c444ef94cf640ba978203d7b3d8bd98ba9b1a673ea3902b870a9ca0f797
R
16,354
402
--- title: "Annotate SNV subtype status for LGAT biospecimens" output: html_notebook author: K S Gaonkar date: 2020 --- In this PR we will use identify LGAT biospecimens from pathology diagnosis and annotate subtype specific SNV status per biospecimen. As per [issue](https://github.com/AlexsLemonade/OpenPBTA-analysi...
dc098a95fc4d77956dc7e68206eba516471629c7920bc4299bda7559c33d566b
R
16,360
521
# The working directory is the directory that contains this test R file, if this # file is executed by test_dir # # testthat package is loaded, if this file is executed by test_dir context("tests/test_get_opr_mut_freq_tbl.R") # import_function is defined in tests/helper_import_function.R and tested in # annotator/tests...
3ab055904529e6f3b1475b195b0fe78fb065903f7b039e600fed85acf88802e7
R
16,403
258
library(dplyr) library(parallel) library(purrr) library(tidyr) source("/cbica/projects/luo_wm_dev/two_axes/code/results/main_figures_functions.R") # Spin tests for Figures 6 and 7 ## saves out the spun p-values, empirical test statistic, and dof where appropriate in a csv for each dataset ################## # Set Va...
9ea00a052a58a96448f89a9eb50659460e9503af12385c2b0cb49eb5cc358860
R
16,421
356
#' Run a Defined Set of Single- and Multi-Cohort Discovery Experiments #' #' Orchestrates multiple biomarker discovery runs using specified single-cohort #' (`biodiscvr_single`) and multi-cohort (`biodiscvr_multicohort`) functions. #' Executes a sequence of experiments defined in a configuration file, including #' base...
669ce8b65f615d4edadac24411dbda74f4503fb39f6f7bc656bf87f7acda61a5
R
16,453
401
# ============================================================================== # S4_clustering.R # Server logic for Step 3: Clustering Analysis and Cell Annotation # Implements: # - Step 3.1: Preprocessing & Data Assessment (Normalization, Integration, PCA) # - Step 3.2: Clustering Algorithm Selection & Visual...
7a7df69989b6425802e89e7fd248c7693f75d0a3cd4dbeb1f8d1664883fa57b5
R
16,512
494
# Differential expression analysis of RNA-seq data # Budhaditya Basu # NIHes1-KO vs Control samples #Raw data is available at SRA data: PRJNA1256699 #https://www.ncbi.nlm.nih.gov/sra/PRJNA1256699 library(DESeq2) library(ggplot2) library(pheatmap) library(RColorBrewer) library(org.Mm.eg.db) library(tidy...
6cab9d039e17588da37c0eced0c8b189b5b29e88aede93d075c2cf596f2eda33
R
16,526
388
rm(list=ls()) ## COMMON LIBRARIES AND FUNCTIONS source("100.common-variables.r") source("101.common-functions.r") source("200.variables.r") ## SCRIPT SPECIFIC LIBRARIES ## SCRIPT SPECIFIC FUNCTIONS ## SCRIPT CODE ## ## for( TESTING in c(1) ) { Print.Disclaimer( ) ## ## Load and clean real data ## (...
6ea27fbe4fcb8e86387d42cc81db57bb35badd0bc5a879842f2fde8189c8efe0
R
16,538
418
--- title: "Figure 3" author: "Maksym Zarodniuk" date: "Compiled on `r format(Sys.time(), '%d %B, %Y')`" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(warning = FALSE, message = FALSE) ``` ```{r, include=FALSE} library(knitr) library(DESeq2) library(tidyverse) library(ComplexHeatmap) s...
312795f6dfecca3a941593cf70c30e00f1a700cd2e63969c93d9ce2a7a511bb0
R
16,553
461
# S. Spielman for ALSF CCDL, 2022 # # Makes PDF panels from the `immune-deconv` module for Figures 5 and S6, specifically: ## Panel 5C, immune cell fractions across immune cells, faceted by cancer group ## Panel 5E, CD274 expression across molecular subtypes ## Panel S6E, immune cell fractions across molecular subtypes...
e546675a8c874e0ba0a17dc92d46918025bdac9d2bd37ce590859e3e634ee72d
R
16,578
347
##' generate network based on Enrichment results ##' @rdname richNetwork ##' @param object richResult,GSEAResult object or dataframe ##' @param gene vector contains gene names or dataframe with DEGs information ##' @param top number of terms to display ##' @param pvalue cutoff value of pvalue (if padj set as NULL) ##' ...
1f0674eb2946afbeee9f018da323ad1245fe895403eafa39869e96f28f8d5d89
R
16,610
419
#' Density of empirical distribution #' #' @param x Vector of quantiles #' @param xs Vector of possible values; if continuous, when sorted, each value #' of xs represents the lower limit of the interval to which the corresponding #' probability applies, while the next value of \code{xs} represents the upper #' bound...
29c64211c21ccdd0bee26bd6370dbf5057616a27d729d6dfcb3e640a9c1447c1
R
16,668
412
# --- test-mult-g-comp.R --- # # This script contains a comprehensive test suite for the `mult.g.comp` function. # It should be placed in the `tests/testthat/` directory of the R package. # The `mult.g.comp` function is assumed to be available in the test environment, # typically handled by `devtools::test()` or `devto...
3428a183261d5bd0acba2e8f7b321e5365c27dbd7f814b8532340bb4dcbb125e
R
16,701
257
#' bayesReact method for motif activity inference #' @description #' Function for predicting motif activity from ranked sequence data using a simple Bayesian model implemented in STAN. #' bayesReact_core can be run locally and used for motif activity inference for a set of motifs across a small data set. #' For larger ...
55a06f1a6e1c632b371e0bc12532d6119394661712bbb7a61361a7d75e246460
R
16,722
555
#' Checking for needed packages and valid inputs #' #' @param colnames Character. Determines how to label the columns. #' Must be 'assay', 'oid', or 'both' (default 'both'). #' @param ... Additional arguments used in \code{pheatmap::pheatmap} #' #' @return Null or error/warnings #' #' @keywords internal #' @noRd #' plo...
7624e81bd72cafc19315196dd4157ae4f1ee98aa3d08c679cd00b0b3493e9d8a
R
16,725
434
# 3. Neuroimmune DRAs ---------------------------------------------------------- ## 3.1 Load packages and functions --------------------------------------------- source("./codes/my_packages.R") source("./codes/my_functions.R") # set working directory setwd("./data/Neuro_tables/GSEbatch/") getwd() ## 3.2 Network neu...
8c33b6944c25e5a27c983a8cddfa88a2008b50fc9a3334d157878a5174e6e99b
R
16,822
555
--- title: "Results of Univariate Analysis" author: "Kenji Fujisaki" date: '`r format(Sys.time(), "%Y/%m/%d")`' output: html_document: toc: true toc_float: true toc_depth: 4 number_section: true code_folding: hide --- **What does this script return?** Descriptive statistics and test results for u...
de4fd677a648545224d0731715c8b612f3f3da36441af9389a7c4ff52496b23b
R
16,894
431
#' @title create a MOFA object #' @name create_mofa #' @description Method to create a \code{\link{MOFA}} object #' @param data Input data can be in several formats: #' \itemize{ #' \item{\strong{data.frame}:}{ it requires 5 columns: sample, group, feature, view, value. #' The "group" column indicates the conditi...
b5d386596ee2c43fe280717e4a93431680f179bfe8ec2ed43c75cdf6ffd0db4e
R
16,956
401
#' Run PCA on a BANKSY matrix. #' #' @details #' This function runs PCA on the BANKSY matrix #' (see \link[Banksy]{getBanksyMatrix}) with features scaled to zero mean and #' unit standard deviation. #' #' When \code{lazy=TRUE}, PCA is computed without materializing the full BANKSY #' matrix in memory using an implicit ...
ed979d7c25e6e11ad42ed2fb3c4f24827067da33db141e0dc47204837bb16d3f
R
16,993
260
#' bayesReact method for motif activity inference #' @description #' Function for predicting motif activity from ranked sequence data using a simple Bayesian model implemented in STAN. #' bayesReact_core can be run locally and used for motif activity inference for a set of motifs across a small data set. #' For larger ...
38461769aae52ee8b3e5ec0b8459d6f3959b94c1024d979801aa0d4920b7e440
R
17,068
408
--- title: "Tp53 SNV hotspots" author: "K S Gaonkar, Jo Lynne Rokita" output: html_notebook params: base_run: label: "1/0 to run with base histology" value: 0 input: integer --- In this notebook we will add TP53 alteration status as discussed in [#837](https://github.com/AlexsLemonade/OpenPBTA-analysis/i...
021c6ea39649b61676482ac0b08130276c447f02997fcfdf2a996e411d8dfe09
R
17,078
236
#' bayesReact parallelization for motif activity inference on large data sets #' @description #' This function is a wrapper for bayesReact_core(), allowing for motif activity inference on large data sizes, including single-cell atlases. #' bayesReact_parallel() performs data partitioning and currently utilizes the Slur...
7720be80b3f97d6bf9506302e14b77b84a2df37c6bea796d7913146280daba1f
R
17,111
427
##' richGO ##' #' @name richGO #' @title GO Enrichment analysis function #' @param x vector contains gene names or dataframe with DEGs information #' @param godata GO annotation data #' @param ontology BP,MF or CC #' @param pvalue cutoff pvalue #' @param padj cutoff p adjust value #' @param organism organism #' @param ...
c4dcf8d5558db40d9cf0e64c0333046e91814018fc38ea96113c3087c583aeed
R
17,144
475
# This script uses the original first version of the cross-product normalization # for each pair of Olink products. Specifically, we will use: # - OlinkAnalyze v 4.0.1 for Olink Explore HT - Olink Explore 3072 # - OlinkAnalyze v 4.2.0 for Olink Reveal - Olink Explore 3072 # - OlinkAnalyze v 4.4.0 for Olink Explore HT -...
8c18db876384ea7063974878bcc83022eb8ff106cc45583dbdece2a015e0573e
R
17,147
238
#' bayesReact parallelization for motif activity inference on large data sets #' @description #' This function is a wrapper for bayesReact_core(), allowing for motif activity inference on large data sizes, including single-cell atlases. #' bayesReact_parallel() performs data partitioning and currently utilizes the Slur...
d8e4062f9edf2eda1028971ae065921ece04769c88ff1464ec4be19742f33273
R
17,155
423
############################################ ## Functions to load a trained MOFA model ## ############################################ #' @title Load a trained MOFA #' @name load_model #' @description Method to load a trained MOFA \cr #' The training of mofa is done using a Python framework, and the model output is s...
d076caceff6564fc87b735ca134e6629a46e9f3a2e8119e13c8870b0381f4aa1
R
17,161
339
#' Visualize genome-wide PAF alignments. #' #' This function takes genome-wide alignments of de novo assembly to the reference genome PAF format #' and visualize the alignments with respect to all reference chromosomes in a single plot #' #' @param chromosomes User defined chromosomes (target sequence IDs) to be plotte...
f8a98e5c9de20135ec8191c8861b88fc9502458ff28399094fe906d5e37fff15
R
17,164
565
library(Biobase) library(GEOquery) library(Seurat) library(readxl) library(ggplot2) library(dplyr) library(harmony) library(GenomicRanges) library(Seurat) library(patchwork) library(cowplot) library(data.table) library(scales) library(org.Hs.eg.db) library(rtracklayer) library(gghighlight) library(dplyr) library(Seura...
6c22f7af4b869328339785bf6fd7aa0494ea7d3989327f19746b76d661d25ba4
R
17,166
512
library(miloR) library(SingleCellExperiment) library(scater) library(scran) library(dplyr) library(scuttle) library(ggrepel) library(Seurat) library(ggplot2) library(gghighlight) library(ggbeeswarm) library(ggpubr) library(RColorBrewer) library(knitr) library(gprofiler2) ###################### #### 3D vs FOETAL #### #...
be235ce487c58b7f7da4ef46cd010da7c9f695c017317cef532a70f7600b71e2
R
17,169
351
options(Seurat.object.assay.version = "v3") # use old Seurat object version library(Seurat) library(ggplot2) library(dplyr) library(stringr) library(ggpubr) library(gridExtra) library(cowplot) source("~/PD_project_analysis/scripts/MV_utils.R") dir_main <- ("/home/ubuntu/PDSCRBNG/18_04_24_merFISH_data") # Directory w...
d16804123d00f8bd52a9d8111a34edcf6f598be4664aab71d2c88b1401e52f61
R
17,183
634
# Test reference results from reference_results.rds against refResults.RData testthat::test_that( "reference results match", { # environments to avoid name conflicts ---- # new version env_new_v <- new.env() # get data if available, otherwise skip the test lst_new_v <- get_example_data("refere...
99be5a7af680571cb631bcb091f68f0ebe8949447de0321fbe0e0a4b903ee39b
R
17,223
475
# Functions for constructions # # Author: Xuran Wang #' Construct artificial bulk tissue expression from single cell data #' #' Artificial bulk tissue expression is generated by adding gene expressions of all cells from #' same subjects. #' #' @param sce SingleCellExperiment, single cell dataset #' @param cl...
b55122125215ff099cb6cec1eb6cc5799d4a4fb14b5e41de9d892fd0986eb728
R
17,230
368
#' @name lgb_shared_params #' @title Shared parameter docs #' @description Parameter docs shared by \code{lgb.train}, \code{lgb.cv}, and \code{lightgbm} #' @param callbacks List of callback functions that are applied at each iteration. #' @param data a \code{lgb.Dataset} object, used for training. Some functions, such ...
da77fcc3829cbd8287ada15023ccb8c929cfcc85d7d578c4da7c5e5df13e049b
R
17,253
391
# Meta-analysis of scRNA-seq data of Neocortex developmental time points - Part 1 : QC --------------------- # E10-P4 # Rahul Jose # SCB, RGCB # October 2024 # Primary Aim : # For the identification of NIHes1 and NDHes1 cells across developmental timepoints # Data --------------------------------------------...
78f6de6f7f85d326a0059f746d2f6c08624bd72b746e6720cdd92eb76f571720
R
17,255
464
# pROC: Tools Receiver operating characteristic (ROC curves) with # (partial) area under the curve, confidence intervals and comparison. # Copyright (C) 2010-2014 Xavier Robin, Alexandre Hainard, Natacha Turck, # Natalia Tiberti, Frédérique Lisacek, Jean-Charles Sanchez # and Markus Müller # # This program is free soft...
aa309a79bf00b57ea47bc71c50ad2796cbe8ffae5a25d03bb8241cd8decf409e
R
17,263
609
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #################### VIRIDIS SHORTCUTS #################### #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #' Viridis Shortcuts #' #' Quick shortcuts to access viridis palettes #' #' @return A color pale...
59ab54e50473b2c4365916ee25eca569f4cf29d1833f2107cd79530ead06ff7c
R
17,303
483
# TODO: Add comment # # Author: fec ############################################################################### library(R6) library(survival) library(dplyr) library(caret) FeatureReductionContainer <- R6Class("FeatureReductionContainer", public = list( initialize = function(outcome, features) { ...
9600f3a505acf0d2aa3611c6c7edf9d43fd9b85a252c4dca859b5cfde149aca6
R
17,370
452
rm(list = ls()) # Packages ---- library(dplyr) library(gamlss) library(ggplot2) theme_set(theme_light()) source("code/f_derivedPCA_WI_m.R") # library(FactoMineR) # library(factoextra) COL = c(black = "black" ,red = rgb(100, 38, 33, maxColorValue = 100) ,green = rgb(38, 77, 19, maxColorV...
64c463f79da33e5bea66e24d02d21e1632eea0663008d5bdf159c7abf129bb31
R
17,390
475
## RareComb helpers (minimal set used in the pipeline) library(dplyr) library(tidyr) library(tibble) library(biomaRt) library(parallel) library(doParallel) library(foreach) ## number of cores for parallel sections if (!exists("numCores")) { nc <- parallel::detectCores() numCores <- max(1L, nc - 1L) } ## Ensembl ...
4d94b498200320256a6a012e407f9f43b0ec93070622a39d127fca6cb4baa778
R
17,446
433
# Using control qMRI data to fit LMs and project PD ST scores # load in some libraries library(ggplot2) library(tidyverse) library(reshape2) library(ggpubr) library(hydroGOF) library(matrixStats) # define directories d0 <- getwd(); qMRI.data.dir <- paste(d0, "/../../raw_data/4layers_qMRI/", sep = "") cell.data.dir <-...
032ad1f5855adf7b1299967efa9c2be942a98fd4ea8e578e4e4e83108e68f765
R
17,496
484
--- title: "Methylation Analysis with methylkey" author: "Vincent Cahais" date: "`r Sys.Date()`" output: rmarkdown::html_vignette: toc: true vignette: > %\VignetteIndexEntry{Methylation Analysis with methylkey} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r setup, include=FALSE} kni...
6fa4d0c22eab171c33ad77c21a574e06d966555746989c2a202a8731457dfc82
R
17,503
572
# Test olink_lod ---- test_that( "olink_lod - works - Explore HT", { ht_fixed_lod_url <- "https://7074596.fs1.hubspotusercontent-na1.net/hubfs/7074596/000-documents/10-excel%20file/Explore%20HT_Fixed%20LOD.csv" # nolint: line_length_linter # input is tibble ---- df_ht <- get_example_data("example_HT_...
aee11cd7235fe53f31fc54612f111cce118f1916a7ebbcf3606832dad80b0a31
R
17,565
397
# --- Internal Helper Functions --- # Repeatability as error% (Standard Deviation of Residuals) # Input: A fitted model object (e.g., from lmer) # Output: Standard deviation of residuals .fRep <- function(fit) { return(stats::sd(stats::residuals(fit))) } # Group separation (t-statistic of the time:DX interaction) #...
5ebec262b70d90363f2e9333926bde2ad46927363fd00de6b7d5952526ff2a6e
R
17,579
530
--- title: "Results of Classifier-Based MVPA" author: "Kenji Fujisaki" date: '`r format(Sys.time(), "%Y/%m/%d")`' output: html_document: toc: true toc_float: true toc_depth: 4 number_section: true code_folding: hide --- **What does this script return?** Descriptive statistics and test results fo...
9166665c615efea8bec1e1b774ac9fc4ee342b0d6b715147832dd11a51db8083
R
17,581
525
#!/usr/bin/env Rscript # Load required libraries suppressPackageStartupMessages({ library(Seurat) }) # Get command line arguments args <- commandArgs(trailingOnly = TRUE) # Help function show_help <- function() { cat("Seurat Object Inspector\n") cat("======================\n\n") cat("DESCRIPTION:\n") cat("...
7f63f2802a53ee67219c9d242ad911d5c9bc07ec68f7eb11f0205bff7018cdd8
R
17,637
572
--- title: "Results of Similarity-Based MVPA" author: "Kenji Fujisaki" date: '`r format(Sys.time(), "%Y/%m/%d")`' output: html_document: toc: true toc_float: true toc_depth: 4 number_section: true code_folding: hide --- **What does this script return?** Descriptive statistics and test results fo...
7e255943059689f1a209a2e07a2e42be68fc79ae1e78ce86ab42b1c814f99625
R
17,698
368
## Script for processing 7-, 22-wo and 82-wo ChP 4V and LV samples from our lab ## Subset to only Fibroblasts based on metadata processed objects ## Run until log normalization ## Save seuratobject library('Seurat') library('dplyr') library('gridExtra') library('scater') source('/home/clintdn/VIB/DATA/Sophie/RNA-seq_...
73736c55e348d0499c97aabda78762aa866296197ceab462ff9264151f6daa27
R
17,717
518
# The working directory is the directory that contains this test R file, if this # file is executed by test_dir # # testthat package is loaded, if this file is executed by test_dir context("tests/test_annotate_long_format_table.R") # import_function is defined in tests/helper_import_function.R and tested in # annotator...
165d26a884ab8f67f61b1e586c8aa66a50b004b5b496fc63d859cea38c9a76dc
R
17,744
446
library(Seurat) library(ggplot2) library(gghighlight) library(ggbeeswarm) library(ggpubr) library(RColorBrewer) library(tidyverse) library(dplyr) library(purrr) library(ggplot2) library(cowplot) rootMain <- "figures/main/" rootSupp <- "figures/supp/" rootOthers <- "figures/others/" querySeurat <- readRDS("saved/toZe...
2d7c8f7c2845fb39db22165b7e9f05a272ba3edd3de8bd8134dee69389d14979
R
17,965
488
################################################## ### 03 --- examples pruning ---------------------- ################################################## # libraries library(raster) library(terra) library(RColorBrewer) library(sf) library(dplyr) library(DBI) library(stars) library(ggplot2) library(exactextractr) librar...
d87dbd456cf4a9dc35aeec4a390ada79d5c80596778d92fe41b28f44835de74f
R
17,975
678
#' Plots for each bridgeable assays between two products. #' #' @author #' Amrita Kar #' Klev Diamanti #' #' Generates a combined plot per assay containing a violin and boxplot for IQR #' ranges; correlation plot of NPX values; a median count bar plot and KS plots #' from the 2 products. #' #' @param df A tibble co...
12f44e4c34d305ab4cb34bc06d80ca8f281a0bd9bd98846e64afdd403ac02cd8
R
17,977
367
--- output: github_document --- <!-- README.md is generated from README.Rmd. Please edit that file --> ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE, fig.path = "doc/Figures/README-", out.width = "100%") # for tibbles... options(pillar.neg=F, # do no print n...
e347c90ee2c879f4d85166acacc70fb5ec746cd82f28d1d48b3b19730f4e677d
R
17,991
549
############################# ## iTReX maintenance tools ## ## Author: Yannick Berker ## ############################# #' Save arguments in rds files named after arguments. #' #' @param ... Variables to be saved (not quoted). debug_save <- function(...) { debug_dir <- Sys.getenv("ITREX_DEBUG_DIR") if (nchar(debug...
88e2c9f7e10e0ed49f15ceb09442d2e3c43146372f85e29037752b950838038d
R
18,104
476
# -------------------- # title: FigureS9 Code # author: Hu Zheng # date: 2026-01-01 # -------------------- library(Seurat) library(tidyverse) library(ggpointdensity) library(cowplot) library(RColorBrewer) library(scCustomize) library(ggradar) library(scRNAtoolVis) library(viridis) library(Biorplot) source('bin/Palett...
e1631e6e5286c10b779ded83d1b00761b7da8ae9d7779196985f4dcc03e3aecd
R
18,127
423
################################################################################ ### Wright et al., 2021 ### Mouse Adult Distal Colon (MADC) ### scRNA-seq Reprocessing Via Seuratv5 ### 50-day-old Wnt1-cre^(cre/wt) ; R26R-H2B-mCherry^(ch/wt) mice ###################################################################...
cadff7bdc86ffb9306198c88a6011cfb85276af14d7c069319095fa6e04c438d
R
18,150
494
library(Seurat) library(ggplot2) library(purrr) library(scrattch.vis) library(scrattch.hicat) library(Matrix) library(dplyr) library(tidyr) library(parallel) library(bigstatsr) library(data.table) library(arrow) library(BiocNeighbors) library(ggraph) library(igraph) library(tidyverse) library(ggnewscale) library(ggrepe...
552d67974f31c28615b3c8fd541881d0a1f42c892024d4713c9b545478c80508
R
18,178
339
# Author: Sangeeta Shukla and Alvin Farrel # Function: # 1. summarize Differential expression from RNASeq data # 2. tabulate corresponding P-value # This was compares 1 cancer group (Combined or Cohort specific) with one GTEx tissue type. # The input arguments are the indices of the comparison of the cancer groups a...
c647ea4baa30ef7a2b303cc7be3753629becd4ee063ac37d2649b5ad168a9969
R
18,249
284
# Osprey GUI tutorial This tutorial describes each step of the **Osprey** analysis workflow using the graphical user interface. We will learn how to start the GUI, select the job file, load the raw data, process them into spectra, model the processed spectra, co-register the voxel to anatomical images, segment the an...
c2e3420065c3c095a9dd1b183e45b3c9532460b9987c2ccc38a6a17e9e857556
R
18,253
544
--- title: "script04_analysis" author: "Shamini Ayyadhury" date: "`r Sys.Date()`" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ## R Markdown This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more ...
d4a99e7224606ca989ecabdf0d28bb9efca15ca9ff971e30fac05a4bd4cbce73
R
18,337
669
# Test that a relevant error is thrown when a txt file was provided as parquet. test_that( "read_npx_parquet - error - random non-parquet file", { withr::with_tempfile( new = "txtfile_p", pattern = "txt-file_as_parquet-file", fileext = ".txt", code = { # write some text in a txt...
8c35c30fc9031d8a338c3d42f2fbc30e6bfb45e09225df95050b794bb8f9fd21
R
18,357
447
#' Load default parameters #' #' \code{load_default_params} loads default parameters for the decision model #' and creates a list #' #' @return #' A list of all parameters used for the decision model #' #' @export load_model_params <- function( file.mort, # Path to background mortality data file.surv, ...
67a0b2e65dcda62611fe59e8814729f0db1586fff23870404cd7a23684b96d64
R
18,381
447
# pROC: Tools Receiver operating characteristic (ROC curves) with # (partial) area under the curve, confidence intervals and comparison. # Copyright (C) 2010-2014 Xavier Robin, Alexandre Hainard, Natacha Turck, # Natalia Tiberti, Frédérique Lisacek, Jean-Charles Sanchez # and Markus Müller # # This program is free soft...
34247955f3e0bf2f8fda43c116e50fb321c3bec031c3174f947825aeb2dbef55
R
18,473
601
--- title: "PedcBio CNV file preparation" output: html_document --- ```{r load library} library(tidyverse) library(readr) ``` ### Define directories ```{r define directories} root_dir <- rprojroot::find_root(rprojroot::has_dir(".git")) data_dir <- file.path(root_dir, "data") analysis_dir <- file.path(root_dir, "analy...
93a8946af6fe0e21f73490e935438c58bc541a3eeba69b5d1ec30ab85f16c4e5
R
18,575
473
--- output: html_document author: "Mathis Nozais" output: html_document: code_folding: hide code_download: true editor_options: chunk_output_type: console --- ################# Script for CRISPR bulkRNA analysis for "BEX" paper. Made for Docker RNA 431 ################# ```{r} library(Rsubread) library...
80f08e5836b3b99dbc69c4bdd8b2064c1bcaaee5fc21f3ad79b401903e354fb8
R
18,670
255
################################################################################ # Phenotype Association Analysis for Co-occurring Rare Variants # Analysis script for Figure 4 ################################################################################ ## Load helper functions source("path/to/function_definition.R...
c43edf211f81e4c4bb97acc6d765c0dbe2f4268d20d7fb16146a3756cd7c02f2
R
18,685
545
library(Seurat) library(ggplot2) library(purrr) library(scrattch.vis) library(scrattch.hicat) library(Matrix) library(dplyr) library(tidyr) library(parallel) library(bigstatsr) library(data.table) library(arrow) library(BiocNeighbors) library(ggraph) library(igraph) library(tidyverse) library(ggnewscale) library(ggrepe...
ac6397890f816d5471625a31f8f6ad318608992407562a9fde76b85cfde4224a
R
18,700
409
################################################################################ ### May-Zhang et al., 2021 ### Mouse Colon, Duodenum, and Ileum 6wks snRNA-seq Reprocessing Via Seurat ### 6Wks Phox2b H2B-CFP+ high intensity nuclei ### InDrop Runs ###################################################################...
fee2b93b08f7f039255e6fcbdf03fd1fb879913293b69ef5eafcc2af352e91f3
R
18,778
556
--- title: "Molecularly Subtyping Embryonal Tumors - Final Table" output: html_notebook: toc: TRUE toc_float: TRUE author: Stephanie J. Spielman and Jaclyn Taroni for ALSF CCDL date: 2020 --- This notebook identifies samples to include in subset files for the purpose of molecularly subtyping embryonal tumor...
53b33c2e33432f7820e4be5cebb5209a802afcf7b314ba724fdf2356e0d52b71
R
18,788
363
# The script is intended viewed in R studio # Blocks are titled # "=" symbol was used as an assignment operator # Setting options getOption("scipen") # Default number notation is 0 options(scipen=999) options(stringsAsFactors = FALSE) options(show.error.messages = TRUE) ################### Package import ############...
10fa7a02e57bd2a1b1bddc86bc6de031ce1b943b2eb5352476a7dfa742644072
R
18,791
501
library(lme4) library(lmerTest) library(dplyr) library(emmeans) library(boot) set.seed(123) permute_sign_flipping_contrasts <- function(data, formula, compute_contrast_fn, subject_col =...
5e1b293a4b92fcd92627b10c6a2b708878e95b70439dbe8df4ec06001a837c95
R
18,819
291
#!/usr/bin/env Rscript #### For thalamus integration set #### Loading libraries library(dplyr) library(Seurat) library(patchwork) library(ggplot2) library(harmony) input_dir = "/path/to/DecontX_scDblFinder/" ################################################## ######## First QC ################################ ######...
5ab9d3d7fde0f2793a4e08dd7a3d600b0dfe6a90dd42ae71033079f5a1138b95
R
18,848
437
############################ ## iTReX module functions ## ## Author: Dina ElHarouni ## ############################ get_conc_unit <- function(input) { switch(input$conc_select, "other" = input$conc_text, input$conc_select ) } MRA.mod <- function(input, drdata, output_dir, control_dir, PID, ...
587cb2822d993463f4e6f89d543bb4e1d3aa7056bb805787476c014b6297ca77
R
18,858
364
--- title: "Object QC Functions" date: 'Compiled: `r format(Sys.Date(), "%B %d, %Y")`' output: rmarkdown::html_vignette theme: united df_print: kable vignette: > %\VignetteIndexEntry{Object QC Functions} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- *** <style> p.caption { font-size: 0.9em; ...
062b437c748c71c815099d73ac8ac41fb5fdd46e702432efe2a147ae0aef8c17
R
18,859
361
#' Subset PAF alignments at desired genomic range. #' #' This function takes loaded PAF alignments using \code{\link{readPaf}} function and then subsets #' as well as cuts PAF alignments at desired target coordinates. This function can only be applied #' to PAF alignments containing a single query and target sequence. ...
c20c985325482303eeb4b503035024dc962fab5742e867f0bcbcdbf4d69208ca
R
18,893
622
if (!requireNamespace("here", quietly = TRUE)) install.packages("here") source(here::here("stats","learning_models","_setup.R")) scr_acq_ext <- scr_df %>% filter(PHASE %in% c("acquisition", "retention", "extinction"), TUS == "active") %>% mutate( PHASE = ifelse(PHASE == "acquisition", 1, ifelse(PHASE...
8d6465e6c3cbb8ad05f4058f45b197de4918219c9a4b67e87a4f5903dc954736
R
18,910
438
# Utility functions # # Author: Xuran Wang # Copyright Xuran Wang (2018) ########################################################################## #' Calculate relative abundance #' @param X non-negative matrix for calculate relative abundance #' @param by.col logical, default as TRUE #' @export relative....
f63d10e7317fc3cc7719abd979c59ff895da4c51a256dc92e13499446eae8eac
R
18,965
418
library(Seurat) library(ggplot2) library(patchwork) library(dplyr) library(tidyverse) library(stringr) library(cowplot) library(optparse) library(grDevices) library(RColorBrewer) # Define the command line options option_list <- list( make_option(c("-i", "--input_dir"), type = "character", default = "", help = "Input...
8840f54e87c7115aa0c9095a47d8b3f8a2531297948d5fb0f5b403144147293d
R
19,014
391
--- title: "Integrate molecular subtyping results" output: html_notebook: toc: true toc_float: true author: Krutika Gaonkar, Eric Wafula, Jo Lynne Rokita date: 2020, 2022 --- The purpose of this notebook is to integrate molecular subtyping results from [molecular-subtyping-pathology](https://github.com/Ale...
b68b84a1ed85e16e333f88c1db950a280d976497297b31690484da936f8d7bbd
R
19,017
438
library(pROC) data(aSAH) level.values <- list( forward = c("Good", "Poor"), reversed = c("Poor", "Good") ) smooth.methods <- c("binormal", "density", "fitdistr", "logcondens", "logcondens.smooth") for (marker in c("ndka", "wfns", "s100b")) { for (levels.direction in names(level.values)) { for (percent in c...
181aa4cd3ed529842ced3ab484cee0e492d289f1dfdf2bf1c386dff34f620a85
R
19,029
387
# Author: Ryan Corbett & Jo Lynne Rokita # Function: Script to subtype MB SHH tumors # Load packages suppressPackageStartupMessages({ library(tidyverse) library(data.table) }) # Set directory paths root_dir <- rprojroot::find_root(rprojroot::has_dir(".git")) # Set file paths data_dir <- file.path(root_dir, "dat...
c0125dec7df80f887b07ef0efd9362a52ca5bafd6a4dedd223d62d729f542be3
R
19,123
483
## ---------------------------------------------------------------- ## ORA helper functions (shared across enrichment functions) ## ---------------------------------------------------------------- #' Validate common enrichment inputs #' @param x gene vector or data.frame #' @param annot annotation data.frame (2+ colu...
99b08c8d72cb8ec214c75402ab57f00bfac5d6ccf4f44fa2c76fff200036af2b
R
19,182
490
# Documentation #' Lasy logistic regression function #' #' @description This function performs logistic regression and print results in tibble output. #' This function aims to provide the results of the regression analysis in the format, which is frequently #' desired in academic journals. #' #' @param data data frame ...
dc0064bd24924485581e5004282f1ce8057c14107a5defa3843281d81939c343
R
19,184
553
# JN Taroni and SJ Spielman for ALSF CCDL 2021-2022 # # Makes publication ready OncoPrint panels, specifically for primary-only (PDFs) #### Directories --------------------------------------------------------------- # Detect the ".git" folder -- this will in the project root directory. # Use this as the root director...
7419defc01f6f15ae095950fa6d2daf2d7ef065cf77c27080f842b240119a9ce
R
19,210
393
# script to do some qMRI layer analysis # load in some libraries library(ggplot2) library(tidyverse) library(reshape2) library(emmeans) # define directories d0 <- getwd(); qMRI.data.dir <- paste(d0, "/../../raw_data/4layers_qMRI/", sep = "") dems.dir<- paste(d0, "/../../raw_data/participant_info/", sep = "") results....
2be47bf996d2bc72c0427e7faaf6ceb5ea9639951e4620376ed99d445220e8b8
R
19,225
449
#' @title Generate data files required for shiny app #' @description Generate data files required for shiny app. Five files will be generated, #' namely (i) the shinycell config \code{prefix_conf.rds}, (ii) the gene #' mapping object config \code{prefix_gene.rds}, (iii) the single-cell gene #' expression \code{prefi...
ebcc73d77716486462ba37f617a10751d2806119a09c4cb402fd86181621b541
R
19,230
479
library(Seurat) library(destiny) library(slingshot) library(conflicted) library(scran) library(purrr) library(SingleCellExperiment) library(ggthemes) library(ggrastr) library(base64enc) library(ggplot2) library(readxl) library(Biobase) library(ggbeeswarm) library(cowplot) library(stringr) obj <- readRDS("saved/toZe...
9f1fc5c51fcc607b439986a2bea1b56055e709d53fca6a904b4d575801965801
R
19,232
524
source("./source/OverallAnalysisFunction/Annotation/MSIdenti_DESI.R") Dirdatabase <- "./source/Database" #' @title Extract Spatial Matrix #' @description Extracts the feature expression matrix and coordinates from a Seurat object. #' @param data A Seurat object containing 'Spatial' assay and 'x'/'y' coordinates. #...
276cfa5c6f77a5388af664a1a536018e7609241535dc6a576dfb197cb681c600
R
19,250
420
rm(list = ls()) # Packages ---- library(dplyr) library(Boruta) library(ranger) # library(randomForest) library(caret) library(ggplot2) theme_set(theme_light()) COL = c(black = "black" ,red = rgb(100, 38, 33, maxColorValue = 100) ,green = rgb(38, 77, 19, maxColorValue = 100) ,bl...
a8066dce8d43e3a78fe05a1c5eb02b7201bad9a4e37bace7d9d7948bc37b8c58
R
19,275
503
rm(list = ls()) # estimating shap values # Packages ---- library(dplyr) # library(Boruta) # library(ranger) # library(randomForest) # tensorflow::install_tensorflow(version = "2.7") # Load the tensorflow package # Install the Python TensorFlow backend # Note: This requires Python to be installed on your s...
31d72b91f58ffea695b4dcfaf86f203c3fad3e49f8800618dea0577b149f1ec2
R
19,313
617
#' @importFrom R6 R6Class CVBooster <- R6::R6Class( classname = "lgb.CVBooster", cloneable = FALSE, public = list( best_iter = -1L, best_score = NA, record_evals = list(), boosters = list(), initialize = function(x) { self$boosters <- x return(invisible(NULL)) }, reset_para...