sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
db232b5f9009773e2d87530c45e761633d219dd452409470cf0a50636f73645f
R
8,879
291
#' Search for Differentially Methylated Regions (DMRs) using DMRcate #' #' This function searches for Differentially Methylated Regions (DMRs) #' in DNA methylation data using the DMRcate package. #' It takes a set of CpG sites with associated statistical information #' and annotates them for DMR analysis. #' #' ...
e46092b4203c03dcc9188db8fdbb8170d90a119bea3e2a9d7e9a114e5904f03e
R
8,893
203
library(tidyverse) library(rstatix) library(ggpubr) library(cowplot) library(patchwork) scale_factor <- 2 # ==== Prepare data ===== data_path <- "Figure_1/data" csv_files <- list.files(data_path, full.names = F) all_d <- data.frame() for (i in 1:length(csv_files)) { cfile <- paste0(data_path, "/", csv_files[i]) ...
a6cd9c118e729d95d6bab2e766227e7f745c6a5d154403fe8b25f169f7b04af8
R
8,896
208
--- title: "Update clinically reviewed subtype for PNOC003 samples" output: html_notebook: toc: TRUE toc_float: TRUE author: Krutika Gaonkar for D3b --- As part of molecular-subtype-HGG analysis we assign a HGG or DMG subtype from looking for K28M histone variants, in this notebook we are identifying sample...
f118713887d8ec9abb5deee4d76d05aea31d32228a0d15ec1dbce59050da5b62
R
8,901
214
#' Add PAF self-alignments to a SVbyEye miropeat style plot. #' #' This function takes a \code{ggplot2} object generated using \code{\link{plotMiro}} function and adds PAF self-alignments #' stored in the `paf.table` to the plot. #' #' @inheritParams addAnnotation #' @inheritParams breakPaf #' @inheritParams plotMiro #...
97db6788a58697132aea01740546fa30f2b781c81b554ff7b0acdbd94f78d181
R
8,904
260
# ============================================================================== # S11_co_visualization.R # Server logic for Step 7: Multi-feature Visualization # Handles RGB/Pseudocolor mapping for visualizing up to 3 features simultaneously. # ======================================================================...
a18b2648f4e920c963feb52dc6a4bf93b1643eec6591c1ac586e23af10e1f336
R
8,912
250
--- title: "Molecularly Subtype Craniopharyngiomas into Adamantinomatous or Papillary" author: "Daniel Miller <millerd15@email.chop.edu> and Jo Lynne Rokita <rokita@chop.edu> for D3B" date: 2020, 2022 output: html_notebook: toc: TRUE toc_float: TRUE --- # Background This notebook looks at the defining lesio...
55aaaee6fbe93c6f2956c52eb56cf14a2883eb807fdfcdfcedb4dccd2616e648
R
8,913
285
--- title: "script01_quality_control" 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. F...
fdef0fa1b27b68d5d94c725a16d3df172927e6756bbf1741132adcfb6f8a025e
R
8,919
236
--- output: github_document --- <!-- README.md is generated from README.Rmd. Please edit that file --> ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%", dpi = 70 ) ``` ## Overview ```{r, eval=T, include=F} start...
b67d58e3dfcecc63aff2f505d08c5838a70641292b6e6ac50e970a3001cd90f2
R
8,939
198
# pROC: Tools Receiver operating characteristic (ROC curves) with # (partial) area under the curve, confidence intervals and comparison. # Copyright (C) 2010-2019 Xavier Robin, Matthias Doering, # Alexandre Hainard, Natacha Turck, Natalia Tiberti, # Frédérique Lisacek, Jean-Charles Sanchez and Markus Müller # # This pr...
e37ca996d2906f31ae95abf3233fe3056666386de59b1bb6a8d1becc6be8ce8e
R
8,951
213
# Function to show a notification in a Shiny app # Parameters: # - msg: The message to display in the notification # - id: Optional ID for the notification (default is NULL) # - duration: Duration (in seconds) for which the notification will be displayed (default is 2 seconds) # - closeButton: Set to FALSE to hide the ...
8f61f10a4e12d1b9bb9ff362793d892f8dc1453b4d8f0a49fb6799e8b50d2588
R
8,953
186
# Function to generate a permutation map from a set of cortical regions of interest to itself, # while (approximately) preserving contiguity and hemispheric symmetry. # The function is based on a rotation of the FreeSurfer projection of coordinates # of a set of regions of interest on the sphere. # # Inputs: # coord.l...
579731194f712b352059aa34cf1e540b86d873fbe5cf26019d3f60bed85348b0
R
8,966
171
setwd("D:/valentin/main/") sources = dir("./scripts/",full.names=TRUE) for(s in sources){ source(s) } load("FANS_UKBBN/current.Rdata") pheno_UKBBN_FANS$subtype = pheno_UKBBN[match(pheno_UKBBN_FANS$Individual, pheno_UKBBN$BBNId),]$subtype list_EWAS = list() for(i in list(c("red","Control"), c("blue", "Cont...
8a0b4a6bf49b46ad0932e113d65e10049ca6dbdf423a2f6ba40ca3e8c5e2ec92
R
8,978
290
######################################################### ## RareComb pipeline: multi-cohort pathogenic variant pairs ## - Per-cohort pathogenic filtering (no rare/MAF filtering) ## - Cohort merging ## - RareComb boolean input matrix ## - Running pyRareComb (example commands) ## - Downstream analysis of RareComb p...
30c2e0dc221a725eae6df4d4f6cff63fb1f09965d0b802553e3d852c2c274939
R
8,992
236
#!/usr/bin/env Rscript #Run like this: #Rscript --vanilla tests/IVIMmodels/unit_tests/compare.r test_output.csv test_reference.csv reference_output.csv test_results.csv # If this script fails: # 1. Save the "Comparison" file from the run on Github, OR run this file directly # 2. Find the file producted "test_referenc...
14ce22922528f6d6ee9e55d298e22ff0b6e5b96bf1c3012bf529e0fee52cfe22
R
8,993
121
############################################################ ## Main Figure 4 ############################################################ ## Load helper functions source("path/to/function_definition.R") ## Packages library(tidyverse) library(ggpubr) library(egg) #####################################################...
02d217ca71d59ffc426657e40664ad07d50b07e1edb8f0a79e479160d913ee4f
R
9,004
266
library(scSeqComm) library(scrattch.hicat) library(scrattch.vis) library(scrattch.io) library(Matrix) library(Seurat) library(dplyr) library(rhdf5) library(pbmcapply) library(OmnipathR) library(graphite) library(data.table) library(corrplot) library(ComplexHeatmap) library(stringr) library(ggplot2) setwd("/mnt/DD/Sc...
ccd322ba2d09be03878df7390013e38ac21bcf9226a8e90ea57126f0122b6d4b
R
9,020
293
# Test olink_lmer_plot ---- test_that( "olink_lmer_plot - works - 6 assays, 1 page", { skip_on_cran() skip_if_not_installed("vdiffr") skip_if_not_installed(pkg = "lme4") |> suppressPackageStartupMessages() skip_if_not_installed(pkg = "lmerTest") skip_if_not_installed(pkg = "broom") skip_if_...
37fb0d84939cf7a42c195e87ad5f9c2d2a6a3445083a7130d2bec92befe3b9a1
R
9,022
212
#### libraries # required for linear mixed effects models library(lme4); # required for significance testing in LMMs library(lmerTest); # required for pretty plotting library(ggplot2); # required for colour-blind friendly palettes library(viridis); # required for estimating marginal means library(emmeans); # requi...
a6fddc44dfa812b24e5d990f0654316d9963b87112664f069d6ffde4458fa1ff
R
9,041
231
# JN Taroni and SJ Spielman for ALSF CCDL 2021-2022 # # Create panels for representing sample distribution: # - Cancer group # - Experimental strategy # - Tumor distribution # # Each broad histology display group has an individual panel #### Libraries -------------------------------------------------------------...
674978a0fe8eeb8d859c5c6cd47fbd34d7923ffe11259bfc97c154d38323ed68
R
9,054
369
# constants that control naming in lists .EVAL_KEY <- function() { return("eval") } .EVAL_ERR_KEY <- function() { return("eval_err") } #' @importFrom R6 R6Class CB_ENV <- R6::R6Class( "lgb.cb_env", cloneable = FALSE, public = list( model = NULL, iteration = NULL, begin_iteration = NULL, end_i...
5bb929a5170ada2d0d39542a0af8b00cfecf8739b5f15ee51a17f8b26881b674
R
9,066
203
library( ggplot2 ) library( ANTsR ) library( brainGraph ) library( ggradar2 ) # dataSets <- c( "SRPB1600", "IXI", "Kirby", "NKI", "Oasis" ) # demoFiles <- c( "srpb1600.csv", "ixi.csv", "kirby.csv", "nki.csv", "oasis.csv" ) dataSets <- c( "SRPB1600" ) demoFiles <- c( "srpb1600.csv" ) pipelineNames <- c( "ANTs", "ANT...
b94930055d6d58a6ac34973c1b555f8a8360a383fdbba55c33913f9551aa6949
R
9,073
186
#' Prepare PAF alignments for plotting. #' #' This function takes loaded PAF alignments using \code{\link{readPaf}} function. Such alignment could be post-processed #' using \code{\link{filterPaf}}, \code{\link{breakPaf}} and \code{\link{flipPaf}} functions. Subsequently such alignments are #' expanded in a set of x an...
441c18d10a3230c06f7c8e1d5d5351f3481164ce02a970017f05eb4c20016a70
R
9,075
177
#' @title Create configuration (cfg) structure for analysis #' @description This function compiles the relevant settings and file paths to be fed into analysis functions. #' @param pat_ids a vector of strings specifying patients' IDs (used as directories for output files) #' @param lesion_paths a vector of strings spec...
cd011b7e6bce345ec8b5faa728d9845d36cafa97d80104fbabb6c2266fb0d4cf
R
9,092
283
--- title: "MOFA+: downstream analysis (in R)" author: name: "Ricard Argelaguet" affiliation: "European Bioinformatics Institute, Cambridge, UK" email: "ricard@ebi.ac.uk" date: "`r Sys.Date()`" output: BiocStyle::html_document: toc_float: true vignette: > %\VignetteIndexEntry{Downstream analysis: Overview...
7c405c4255ffb0e358138367f03e2540897ab758a535148a54439ad3fedd44b2
R
9,095
225
# using devtools to create package # nice elementary tutorial # https://uoftcoders.github.io/studyGroup/lessons/r/packages/lesson/ # adds documentation to package as a whole # use_package_doc() # in case of problems delete namespace file # then do devtools::load_all() # and then devtools::document() # storing data i...
0ba7d4e3427d7b7e7ff1a439d89225b7aeb6c97b52e04485cc6d87d1b95cc768
R
9,100
179
make_targets_fmri_by.run <- function (n_runs, task = "controlled", additional_targets = NULL) { # defining these separately instead of in a tar_eval together # because we need them to be accessible as components of the list tar_map for naturalistic # and because we need to only use boxcar for controlled sub...
1057e8756aa80142989de9678c0e7f98224b1440dd218052212bcbb3d0ab3d79
R
9,109
327
# Test check_is_numeric ---- test_that( "check is numeric works - TRUE", { expect_true( object = check_is_numeric(x = 3.14, error = FALSE) ) expect_true( object = check_is_numeric(x = 3.14, error = TRUE) ) expect_true...
78eb8d0f497edce420a5726a53f933dd4dfec98adc76ed4f519658da7e4f1eaa
R
9,110
253
# SMIntegration: Spatial Multi-omics Integration Platform # ============================================================================== # # Purpose: # Bridges the Python-based SpatialData format and R-based Seurat analysis. # It converts the Zarr output from the interpolation step into Seurat RDS # obj...
d23ab08d4d8cc6c2959980a1deb9ea0deee0fb1df9e4bbc93c302fbfb69520b7
R
9,123
204
# look further into mouse phenotypes # load libraries ---- library(igraph) library(tidyverse) library(pROC) library(foreach) library(doParallel) library(ComplexHeatmap) library(clusterProfiler) library(RColorBrewer) library(dendextend) source('Code/networkPropagation.R') '%notin%' = Negate('%in%') # load files ---...
de9ccde2c4ff72c257caf96472f70c57c30791bfcf00a1294777987b5c5f0cd8
R
9,130
315
#' run a model on every row of your data. Made with microbiome data in mind. #' @export #' @examples #' #' metadata = data.frame(a = sample(letters[1:3], ncol(mtcars), replace=T), #' b = sample(letters[4:6], ncol(mtcars), replace=T), #' c = rnorm(ncol(mtcars))) #' #' fw_fit(...
aaa878478f1d31cd70fb108d6b58df86295140868ee05390b92fbe9ecc766a5d
R
9,137
257
# Analysis of ENS Progenitors (Morarach et al. 2021) # # Author: Anoohya Muppirala # Date: 11-09-2025 # # Description: # This script processes and analyzes 10x Genomics single-cell RNA-seq data # of enteric nervous system (ENS) progenitors from the developing mouse # small intestine at embryonic day 15.5 (E15.5) and...
afa654c6e963426100807944ab45bf7c78f98b9169fe1ad05b2e17eaeb8eff71
R
9,151
277
#!/usr/bin/env Rscript # # Ballgown Differential Gene Expression Analysis # # This script performs differential expression analysis using the Ballgown R package. # It requires: # - StringTie output directories for each sample (containing *.ctab files) # - A metadata CSV file with sample information and condition la...
624e9b8cc4c724b858c2dbfee09cdca88ffac98c069c09946d10c8605c673a0d
R
9,164
304
#' @export #' #' lnc_RNARNA_scanner <-function(ENST_input, analyze_onlyDEtargets, ENST_targets ,nr_top_genes ) { if(missing(nr_top_genes)){ nr_top_genes<-500 } gc() #input explanation print(paste("Input explanation:")) print(paste("1. ENST_input = ENST transcript numbers. RNARNAdb will automat...
2a4682282a7b0cc663b6832f711e3a4d34b33a7d425b0eb1d591bdaef15c14bc
R
9,178
268
# Calculting module scores for senescence flavors across cell types flavors <- read.csv("flavors_of_sen_0911_SYMBOL.csv") %>% dplyr::select(-San.Diego.TMC) modules <- colnames(flavors) flavors <- lapply(1:ncol(flavors), function(col) { vals <- str_to_upper(flavors[flavors[,col]!="",col]) genes1 <- v...
82f3c8d7389802579d4a2f9bcc009df9ce072ed60634c6e70fbd7d22afda9346
R
9,186
308
--- title: "Project specific filtering" author: "K S Gaonkar (D3B); Jaclyn Taroni (CCDL); Kelsey Keith (DBHI), Jo Lynne Rokita (D3b)" output: html_notebook params: histology: label: "Clinical file" value: data/histologies.tsv input: file group: label: "Grouping variable" value: cancer_group ...
7f39fd813e5e23afb4ba24dec499643599dbb91e51db466eae1bacb4346ccca6
R
9,192
303
--- title: "Multi-sample analysis (10x Visium Human DLPFC)" output: BiocStyle::html_document # output: pdf_document vignette: > %\VignetteIndexEntry{Multi-sample analysis (10x Visium Human DLPFC)} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r, include = FALSE} knitr::opts_chunk$set( ...
d23c464d0fcb4bfeb8ec9dfff290b19c058543b7b3c4d007e2215f2f904871fb
R
9,193
282
library(tensorflow) library(keras) library(survival) library(survcomp) #BiocManager::install("survcomp") # neg_log_likelihd <- function(y_true, y_pred) { # event <- y_true[, 1] # time <- y_true[, 2] # # time <- y_true[, 1] # # event <- y_true[, 2] # # mask <- k_cast(time <= k_reshape(time, s...
8fd13e1955b38aed756ed57fe70e0f956554cc46eca5460972120eb0181694f9
R
9,197
207
```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) library(WVPlots) library(tidyverse) library(dplyr) library(tidyr) library(ggplot2) library(corrplot) library(visreg) library(ggseg) library(ggsegSchaefer) library(mgcv) library(fastDummies) library(lme4) library(lmerTest) library(car) library(purrr) k=3 loa...
eda617179de1347b2deedda9d897af34d35202346df1404d49d1c4be28bc28d5
R
9,225
316
--- title: "MOFA+: downstream analysis in R" author: - name: "Ricard Argelaguet" affiliation: "European Bioinformatics Institute, Cambridge, UK" email: "ricard@ebi.ac.uk" - name: "Britta Velten" affiliation: "German Cancer Research Center, Heidelberg, Germany" email: "b.velten@dkfz-heidelberg.de" date: "`r Sys....
f558d2570a4bfe41ef49004df5135ce9d2486fd496ce4fe1a53a18b5a7dba54e
R
9,225
204
## Creating Fibroblast species object (Fig7) with our Fibroblast scRNA-Seq data (7/22/82 wo ChP 4V&LV) and human snRNA-seq data (Yang et al.) ## Script attempted integration of the datasets via Seurat (CCA) and subsetted to common homologs ## CCA integration was finally not used, but this object was used as starting p...
c2e2865af254ae81248899af30158b2ad4d46b8389bdcf7871f4571e8f9ea2d9
R
9,249
270
# This script subsets the focal copy number, RNA expression, fusion and # histologies` and GISTIC's broad values files to include only High-grade glioma # samples. # # Chante Bethell for CCDL 2020 # # #### USAGE # This script is intended to be run via the command line from the top directory # of the repository as follo...
6486201d4a185ba10b4a741afe41f2f730778193c894c671a983e402aea3b0c5
R
9,253
246
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #################### NEBULOSA #################### #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #' Nebulosa Density Plot #' #' Allow for customization of Nebulosa plot_density. Requires Nebulosa packag...
f879790004bde9ce8a27153ee623ab0632dcab286f79299bacf5902033317d45
R
9,267
179
library(data.table) library(dplyr) library(mgcv) library(parallel) library(rjson) library(stringr) library(tidyr) source("/cbica/projects/luo_wm_dev/two_axes/code/fit_GAMs/gam_functions/GAM_functions_tractprofiles.R") # This script fits developmental nodewise GAMs on tract profiles data using functions from GAM_functi...
00ef23bc5d927dee73798a660ed085fe047eefc8d8de84b637a6084ab4ee15d2
R
9,271
181
library(data.table) library(dplyr) library(mgcv) library(parallel) library(rjson) library(stringr) library(tidyr) source("/cbica/projects/luo_wm_dev/two_axes/code/fit_GAMs/gam_functions/GAM_functions_tractprofiles.R") # This script fits developmental nodewise GAMs on tract profiles data using functions from GAM_functi...
4656805f102ff4f6358d39913850b8017caf5aa9a2274be1a36e127d94949b29
R
9,295
184
--- title: "`r params$project`" subtitle: "Single Cell RNA-seq - QC" date: "`r Sys.Date()`" output: html_document: lightbox: true toc: false toc_float: collapsed: false toc_depth: 3 fig_width: 8 fig_height: 5 number_sections: false params: project: Project seuratdir: directory ...
af621d9f3d488c4cc6f31c24bdc399acfe16be0f91e610add324139b1814bb69
R
9,310
262
# S. Spielman for ALSF CCDL 2023 # # Makes pdf panels for TP53 and telomerase scores across cancer groups, focusing only # on high tumor purity samples library(tidyverse) # Establish base dir root_dir <- rprojroot::find_root(rprojroot::has_dir(".git")) # Declare output directory output_dir <- file.path(root_dir, "f...
a879f1cdab5f0d196417ef89fb13fe53900011cbb2d6683683cf4c4493ab6ad9
R
9,314
268
# Load related function dir.base <- "." script <- list.files( path = file.path(dir.base,"function"), pattern = "[.]R$", full.names = T, recursive = T ) for (f in script) source(f) n <- c(100, 200, 200) p <- c(200, 500, 1000) parameter <- list( s1 = list(p.group = 2, q.group = 5, p.b = 0), s2 = list(p.g...
375fd7a2ee6546966e4e77f2010df371c29249dba355dceaada6f577fb8bf5ce
R
9,329
284
# Load related function dir.base <- "." script <- list.files( path = file.path(dir.base,"function"), pattern = "[.]R$", full.names = T, recursive = T ) for (f in script) source(f) n <- c(100, 200, 200) p <- c(200, 500, 1000) psel = c(20, 30, 50) n_reps <- 50 parameter <- list( s1 = list(rho = 0) ) mod =...
de5f7c8b03070379817904ffde1edaca1aa658897c3908cba327cce1698ba10b
R
9,362
306
########################################################################## ### 6. mapping of competitive strength ----------------------------------- ########################################################################## ### libraries --- library(tidyverse) library(dplyr) library(ggplot2) library(tidyterra) libra...
a88da0a13f4b456f3bfaea200699d68548e297021e80fe7739e273c558e8e6ab
R
9,370
251
library(tidyverse) library(gtools) library(Seurat) ###################### Mode <- function(x) { ux <- unique(x) ux[which.max(tabulate(match(x, ux)))] } mapping_res <- read.csv("/mnt/vast/hpc/MenonLab/SenNet/Jason_work/p400_to_sennet_mapping_5sets.csv") mapping_res$mode_cluster <- sapply(1:nrow(mappin...
ef7daa12dcd76b04f290ffc45a982750dc7b98ea4a86ef74563e49bf31f432db
R
9,403
222
# SMIntegration: Spatial Multi-omics Integration Platform # ============================================================================== # # Purpose: # This is the main entry point for the SMIntegration Shiny application. # It initializes the environment, loads necessary R libraries, defines the # User...
fbf21e6a5cd962b5e00ad343be930d2e1b9e3f861ed8954003a6cc1412180b10
R
9,423
255
# This script defines custom functions to be sourced in the # `rna-expression-validation.R` script of this module. # # Chante Bethell for CCDL 2019 # # # #### USAGE # This script is intended to be sourced in the # 'analyses/focal-cn-file-preparation/rna-expression-validation.R' script as # follows: # # source(file.path...
9800fd0a0cd6663755949de24fc62a78aa43e0564b0e78ba872273d9d32b1c0a
R
9,427
275
# Genomic Prediction for Winter Wheat - Across Environments Analysis # Prediction Type: ACR (Across environments) # Models: Additive+Dominance and Additive+Dominance+Epistatic # Cross-validation: 80/20 random split # Load required packages library(BGLR) library(qs) library(dplyr) library(AGHmatrix) library(feather) #...
2dee825e71c72e94f3ea94751fd84ed28d6b97004fe8c4042a171fdeb0c61e29
R
9,441
145
--- title: "Tables output for manuscript" author: "Aditya Lahiri, Jo Lynne Rokita" date: "2021-2024" output: html_notebook: toc: TRUE toc_float: TRUE params: release: v15 --- Code adapted from: https://github.com/AlexsLemonade/OpenPBTA-analysis/blob/master/tables/output_tables.Rmd ```{r setup, include=FA...
dd97802a721d73d0632a93a3b7e888839c4109b637d58675c6d0fb66124a7c5e
R
9,444
313
--- title: "Manuscript stats for naturalistic loom object fMRI" format: html: toc: true toc_float: true --- ```{r setup, include=FALSE} require(targets) require(tidyverse) require(rlang) require(knitr) target_store <- here::here("ignore", "_targets", "naturalistic") target_store_controlled <- here::here("i...
779e1960200ffaef81ac202ff3be79136284b6f3bd018725f755b2d6978fad88
R
9,448
235
################################################################################ # Script to apply COMBATLS on MIND networks ################################################################################ # Copyright (C) 2026 University of Seville # # Written by Natalia García San Martín (ngarcia1@us.es) #...
56d7219b0db6e79c087e25f27d25eb565079785a705c6047bad3a39a3fa29211
R
9,494
223
###Single Cell Object Creation and Integration### #This script creates a Seurat object from cellranger filtered h5 files, marks doublets, and integrates the data using Seurat's RPCA method. #It also performs quality control, normalization, variable feature selection, scaling, PCA, clustering, and UMAP visualization. #...
64218bea66a35f0a4475b989eba8d29778b6990239efe8c7c6b73e2252f15522
R
9,499
386
#' Olink color panel for plotting #' #' @param alpha transparency (optional) #' @param coloroption string, one or more of the following: #' c("red", "orange", "yellow", "green", "teal", "turquoise", "lightblue", #' "darkblue", "purple", "pink") #' #' @return A character vector of palette hex codes for colors. #' #' @ke...
1f8ecd0d19124706e9c677b045c154275ab05114215f0543bc04b802a613caa6
R
9,501
347
# Process mutations for interaction plot from MAF file. # # JA Shapiro for ALSF - CCDL # # 2019 # # Generates a table of gene by gene co-occurence data with p values from Fisher's exact test. # By default, performs analysis of the top 50 most mutated genes. # # Option descriptions # # --maf : File path to MAF file to...
b896f888963f72c5745d68e5ad0c47ed4160b89a22cadaf24ee5f7b293ae6e62
R
9,518
226
#' @title Standardize Column Names #' @description Renames columns of input data frame to standard format (geneID, x, y, MIDCount) and ensures correct data types. #' @param data Input data frame. #' @return Data frame with standardized column names and types. colname_change<-function(data){ colnames(data)[1]<-"g...
8f1a301392940e758dd43cfc0ce8d0b846826649dafd2a68a4f7e9037c3b9907
R
9,528
240
#!/usr/bin/env Rscript suppressPackageStartupMessages({ library(edgeR) library(dplyr) library(readr) library(tibble) library(matrixStats) library(ComplexHeatmap) library(circlize) library(ggplot2) library(grid) }) # ── [1] Settings ──────────────────────────────────────────────────────── WD <- ...
18543212dbd155a58cc4138454b2695df7a6f2910ccd81dfb79df62fbade88d0
R
9,536
237
--- title: "MOFA+: tutorial on Gene Set Enrichment Analysis" author: name: "Ricard Argelaguet" affiliation: "European Bioinformatics Institute, Cambridge, UK" email: "ricard@ebi.ac.uk" date: "`r Sys.Date()`" output: BiocStyle::html_document: toc: true vignette: > %\VignetteIndexEntry{MOFA2: Gene Set Enric...
f1963639ceb0fb7eb9d89a47293f19e1831f2f418fc8e65d75f898b36274caa1
R
9,536
225
library(dplyr) library(tidyr) library(ggplot2) library(ggprism) # Tissue_spec : # input : a vector of gene names and the gene tissue expression dataset from HPA # output : a dataframe with SPM and CTM values from Pan et al (2013) and Tau value from # Yanai et al (2004) and a classification of gene tissue specificity ...
b242c36f7ff87d42e82d85b8b4f412e066b1ef66475c1aee6ab4e83b7d781b25
R
9,554
202
#' @title Preview Spatial Plot #' @description Wrapper for iPlot to generate a spatial plot of a specific feature. #' @param object Seurat object. #' @param feature Character. Name of the feature or metadata column to plot. #' @param pointSize Numeric. Size of the points. #' @param breakseq Numeric. Break sequ...
4e587fbebe1df7096cc13415d3f1a4c7d183b0501f05b18f439dd206901b2daf
R
9,591
229
suppressPackageStartupMessages(library(tidyverse)) # Format numbers to percentage characters # Adapted from @Richie Cotton's answer at # https://stackoverflow.com/a/7146270/4638182 num_to_pct_chr <- function(x, digits = 2, format = "f", ...) { stopifnot(!is.null(x)) if(length(x) == 0) { stopifnot(is.numeric(x...
651a3cb8af9653b05481a989b99ceb4f0c082e152955c5bed372afc0a762da67
R
9,598
244
--- title: "Marker Identification & Cluster Annotation Helpers" date: 'Compiled: `r format(Sys.Date(), "%B %d, %Y")`' output: rmarkdown::html_vignette theme: united df_print: kable vignette: > %\VignetteIndexEntry{Marker Identification & Cluster Annotation Helpers} %\VignetteEngine{knitr::rmarkdown} %\VignetteEnc...
94eb4ee8552d4f4c25f3cf7cb5c52622a0ac6d099c83e5e3288547033d93668f
R
9,607
198
# Yang Yang 2019 # This script is for generating sv file in shatterseek-read/signature-read input format # # input files are: # 1.independent-specimens.wgs.primary-plus.tsv # this file is used to choose independent specimens # 2. pbta-sv-manta.tsv # this file is the original sv file generated by manta call # # output...
d5be3433eb09debba8c67193083475e5f13019605cb670d1ed2d365fa66c6316
R
9,615
186
library(data.table) library(dplyr) library(mgcv) library(parallel) library(rjson) library(stringr) library(tidyr) source("/cbica/projects/luo_wm_dev/two_axes/code/fit_GAMs/gam_functions/GAM_functions_tractprofiles.R") # This script fits developmental nodewise GAMs on tract profiles data using functions from GAM_functi...
f9f9c463c27f8b8473aea714d7a2d4e4c20f0769ee0daec26ff95d63f48c0bb0
R
9,652
263
--- title: "Find CNV losses that overlap with TP53 domains" 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 script we will find if there are a Structural Variant breakpoints within TP53 or cover...
876db200d929d8699a7b1f815db91747dca0684e58bd3dde564522489737eae0
R
9,672
311
getwd() options(scipen = 999) library(ggplot2) library(ggpubr) library(ggExtra) library(tidyverse) setwd("/data/nas1/liuyiding_OD/project/01_project_147/11_Cor_GSEA") exp=fread("log2TPM.txt",header=T,data.table=F) exp=column_to_rownames(exp,"V1") exp=exp[,-c(1:40)] data=exp x=as.numeric(data["PATZ1",]) gene="PATZ1" ...
01c0a6b253822ca2bf4b53e12dae1183348ed8e3159d76e5899e2c5fd9a5f8ab
R
9,675
255
##' build annotation database ##' @name buildAnnot ##' @rdname buildAnnot-methods ##' @title make annotation database ##' @param species species for the annotation ##' @param keytype key type export ##' @param anntype annotation type ##' @param builtin use default database (TRUE or FALSE) ##' @param OP BP,CC,MF default...
ac12a389c40e457cd81e71d311d169c1d3325d6232b1915953010de87c4a8583
R
9,698
251
#' Create the matrix for the PNG image #' #' This function create the pixel matrix that can be saved #' as a PNG for further use. It will also perform some preprocessing, e.g. #' reduce the LRR interval to [-1.4 , 1.2], #' #' @param cnv see load_snps_tbx() documentation #' @param samp see load_snps_tbx() documentation ...
7d1043f950933a8bfcbde81f0ffa030bd52495bb21604e1d741440fbfa026ab4
R
9,723
309
# -------------------- # title: Figure1 Code # author: Hu Zheng # date: 2026-01-01 # -------------------- library(Seurat) library(scCustomize) library(ggplot2) library(ggpointdensity) library(viridis) library(cowplot) library(sciRcolor) source('bin/Palettes.R') source('bin/includes.R') all.Adult <- readRDS('../data/r...
98127fab9e86612fab27a16c0d603a927a37213815735e63ab16f894ae4f5d52
R
9,724
312
--- title: "Ca Imaging data analysis" author: "Slesinger Lab" date: "5/15/2023" output: html_document: default pdf_document: default --- ```{r load packages} #Run chunk at the start of every new session to load the R packages used in the analysis library(readxl) library(readr) library(ggplot2) li...
8a942dac7d94d46e792d9b9197f8dc8b24644882c243da8544564d2f09b4e8f6
R
9,747
271
--- title: Visual Search, all pairs, behavior analysis author: - Mathias Sablé-Meyer - [...] - Stanislas Dehaene lang: en output: rmdformats::readthedown --- ```{r settings, echo = FALSE, message=FALSE} knitr::opts_chunk$set(echo = FALSE) if (!require("pacman")) install.packages("pacman") pacman::p_load(ggpl...
f332be9aa5ccfb98ae819e92268ad992ad9c3bd136f67024f519875f65dc0644
R
9,752
199
# ============================================================================== # U2_upload.R # UI definition for the "Overall Distribution Analysis" and "File Upload" tab. # # Purpose: # Provides the interface for: # - Uploading spatial multi-omics data (Transcriptomics + Metabolomics). # - Supporting bo...
7e62f3edd53fe2fad9f5df9f461aae13471738a10ed70fff30c60f063aaa997b
R
9,767
253
# 6. Neurotransmission --------------------------------------------------------- ## 6.1 Load packages and functions --------------------------------------------- source("./codes/my_packages.R") source("./codes/my_functions.R") # install packages from github: #devtools::install_github("jinworks/CellChat") #d...
d72ec277bec985863e05458dcfd1709e33123f524030b3217982c0584e8820c4
R
9,787
209
suppressPackageStartupMessages({ library(GenomicRanges) library(dplyr) library(tidyverse) }) resolve_duplicate_annotations <- function(overlap_annotation = overlap_annotation) { # This function takes a standardized data.frame output from the `process_annotate_overlaps.R` # script and attempts to resolve dup...
962008f156c826927baf7df7d7ccc3f9c4c5fd28b9df4e76d8a5b02f5bd50e78
R
9,792
188
filter_datasets_section_1<-function(datasets, N_sites, N_ROIs, N_min, N_min_sites){ dataList<-list() dataList_to_remove<-list() for (d in 1:length(datasets)){ cat("Filtering dataset:", names(datasets[d]), "\n") dataList[[d]]<-datasets[[d]] tbl<-data.frame(matrix(ncol=0,nrow=N_sites)) tbl<-table(da...
35855278e0059b98f9b7c1020080623d489a665ba428f0d4b636ef51d8299586
R
9,809
275
###################################################### ## Set the current working directory ###################################################### library(rstudioapi) # make sure you have it installed current_path <- getActiveDocumentContext()$path setwd(dirname(current_path )) print(current_path) base_dir = dirname(...
ed4478ea6de62292d948077f739ca69437ed43fd480b88996807f41966d541c4
R
9,812
256
--- title: "MotiMus Headset Data Processinf" Me: Ségolène M. R. Guérin output: html_notebook: code_folding: hide toc: yes pdf_document: toc: yes html_document: toc: yes word_document: toc: yes editor_options: markdown: wrap: sentence --- # Preamble ```{r message=FALSE, warning=FALSE}...
2e58483358da2fe440c68232d613c2430fdff0c9c0121000ad3252d404939b08
R
9,817
208
source('src/figures/figure_style.R') .libPaths(c(normalizePath('.Rlib'), .libPaths())) suppressPackageStartupMessages({ library(ggplot2) library(jsonlite) library(patchwork) }) update_geom_defaults('text',list(family=figure_style$font)) update_geom_defaults('label',list(family=figure_style$font)) dir.create('fi...
fd150cccb6bca9cf78fd027e17468f67c84ac5d65d92b9dc5c6cf625f6eb805d
R
9,828
292
### analysis nuclear intensities single channel with different thresholds # go to main directory (parent directory of scripts) if (basename(getwd())== "00_scripts"){setwd("../.")} #load packages library("tidyverse") library(colorRamps) library(lmerTest) #define working directories in_dir = "./04b_int...
a4ae3801d9e2d130163b4793152f4eed092f6b2f8fa7bda6396504d0e6760d88
R
9,843
298
################################################################################ # Functions to load and process data ################################################################################ ################### Background mortality ################### #' Read lifetable text file from Human Mortality Database ...
ea05ad577548ceb20fb8ee6c6e1d44c2c68bf649eed802c7b86088c32eb366dd
R
9,854
307
--- title: "Find most focal recurrent copy number units" output: html_notebook: toc: TRUE toc_float: TRUE author: Chante Bethell and Candace Savonen for ALSF CCDL date: 2020 --- This notebook defines the most focal recurrent copy number units by removing focal changes that are within entire chromosome arm l...
ad82464b5f758bf201408eca2d324da7d91150a0d87b8be1b62490821daed31f
R
9,863
305
# Load required libraries library(tidyr) library(ggplot2) library(ggtree) library(dplyr) library(aplot) library(stringr) set.seed(2019-11-07) # plotting parameters label_font_size = 4 title_size = 6 dendrogram_thickness = 0.2 border_line_width = 0.5 tick_linewidth = 0.3 bar_width = 0.6 main <- funct...
7d629863e1928411c721dd3ba9a7e54e6b772f381023e9fe0e237562a5b3960d
R
9,864
299
# # Figueroa-Vargas, Navarrete et al., 2025 # # # Cargar las librerías necesarias #library(tidyverse) # Para la manipulación de datos rm(list = ls()) library(stats) # Para el PCA library(ggplot2) # Para la visualización library(dplyr) setwd("~/Documents/GitHub/Figueroa-Vargas_Navarrete_2025_Scientific...
3f73c49130a4461398bf1ea825517bfb1f4992da084cd1f6d34acd4693cbf5c2
R
9,871
218
#...................................................... # Documentation #' Measurement invariance table #' #' @param group1_nam name of the first group. Used if per_group_models is TRUE. #' @param group2_nam name of the second group. Used if per_group_models is TRUE. #' @param ordered logical, if set to TRUE items will...
6345ffe2263b354b3b98c5f1829cdc41b38c760ea79e7dd7dead09ec8f7327e8
R
9,882
191
# independent-methyl-samples.R #' Generate a vector of unique methylation samples #' #' The samples from this function will be unique with respect to participants #' i.e. only no two samples will come from the same participant. The input list #' should be pre-filtered by `composition` and `sample_type`. #' #' #'...
a8ac5becd288d1e60b4acce3a744a932946aab8d17ced36f9cbc7b827ce243f8
R
9,886
276
--- title: "flashpcaR" author: "Gad Abraham" date: "`r Sys.Date()`" output: rmarkdown::html_document: highlight: tango keep_md: true toc: true vignette: > %\VignetteIndexEntry{flashpcaR} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r, echo=FALSE, cache=FALSE} optio...
d45615e84f4d9dd960ebf8fb2207d0ed8ba1e1a7a78e3ab3675a459d9760a7dd
R
9,911
132
#' Function to process raw input data needed to run bayesReact #' @description #' The function processes raw expression, motif, and sequence data in order to produce sequence ranks and motif probabilities needed for numerical sequence representation. #' The processed data is used by bayesReact to evaluate motif distrib...
5e0c363e5ab732896df26cb1a90800829bc0e138d37333c4da673e6ca92596d9
R
9,928
244
#' Report gaps between PAF alignments. #' #' This function takes loaded PAF alignments using \code{\link{readPaf}} function and then reports all gaps #' in subsequent target and query alignments and classify them as either deletions ('D') or insertions ('I'). #' #' @param min.gap.diff A user defined minimum gap size di...
ef15e5d89a58c62b9c8ad58db6344e2df286ef29edcbaf93ebc6c2e9f81c7ab5
R
9,959
155
################################################################################ # Permutation Test Analysis for Disrupted Gene Pairs # Step 1: Run 10,000 permutations per gene pair # - Randomly shuffle case/control labels 10,000 times # - Recalculate co-occurrence for each permutation # Step 2: Calculate...
f241faa40e84a9d476ea8b0b30e9b17054b871b13fd32fd725bd35e20e15fe1d
R
9,963
277
# Functions for conducting survival analyses # # C. Savonen and SJ Spielman for ALSF - CCDL # # 2019, 2022 # # Attach this package library(survminer) # Magrittr pipe `%>%` <- dplyr::`%>%` survival_analysis <- function(metadata, ind_var, test = "kap.meier", ...
c47814a9e03b1f8ea6b468072b725a7e51301a65c0cb03652c4b7df0a95e0213
R
9,970
243
################################################################## ## Functions to do dimensionality reduction on the MOFA factors ## ################################################################## #' @title Run t-SNE on the MOFA factors #' @name run_tsne #' @param object a trained \code{\link{MOFA}} object. #' @p...
795f90ae511fc4e45ecfb0154f09cfa8fc59083eb60ecaa9f747ec03ec17bd92
R
9,987
250
################################################################################ # SUBSET OF PROFILES DATA + IMPUTATION ################################################################################ library(missRanger) library(tidyverse) # Define the path to where the output should be stored out_path <- "" # read f...
6eb777f510a8097931886cf1a341b2b9426246a6b299df192a6daca642671ee4
R
9,998
256
# 3. Genes Extraction # Script to extract genes of interest # Project: Clinical features, genetics, and pathology in a large series of movement disorder cases: a retrospective multi-ancestry brain bank cohort study # Last updated in August 2025 # PART 1 --- # STEP 1: use plink2 to convert raw genotypes from each ance...
b0898e1bc1ecade547fb5cfc0b7a6e3491770d17068934b1e249e9eed1bbde3d
R
10,012
190
require(Seurat) # ————————————————— MOUSE (Male) GLIA DATA ————————————————— # Load 10X data (matrix of gene expression counts) male_glia_10x <- Read10X("/Users/anumuppirala/Downloads/AnuData/Male_1") #combine all three male runs # Create a Seurat object, requiring genes to be expressed in at least 3 cells # and cel...
0d83b2015b95899a6f5c26056565f7f4cba2993ee8c0c39520ab72911dbc1027
R
10,017
261
# install.packages("devtools") #devtools::install_github("davidsjoberg/ggsankey") library(tidyverse) library(dplyr) library(ggsankey) library(cols4all) library(ggplot2) library(ggforce) library(randomcoloR) # Create a list of selected metabolites (PATHWAY_SORTORDER) with its sub-pathway and super pathway based on PA...
f471ae62613707f5fb7186090c8420deb19c3c546ce11d379ef05ce37b57828a
R
10,018
262
# install.packages("devtools") #devtools::install_github("davidsjoberg/ggsankey") library(tidyverse) library(dplyr) library(ggsankey) library(cols4all) library(ggplot2) library(ggforce) library(randomcoloR) # Create a list of selected metabolites (PATHWAY_SORTORDER) with its sub-pathway and super pathway based on PA...