sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
e1bff85f6c94825036205313115d82912c8ef9cfbade97bac530284d86d5b337
R
3,315
106
##################################### ## R script for reading in salmon quant.sf ## and analysis via DESeq2 ## annotation via ensembl meta-data ##################################### ##################################### ## Load Libraries ##################################### library(DESeq2) library(gplots) library(t...
1a7246603ce53f535b09d4004e2f43494bc794bc60e98d139e8ac87fae7018ce
R
3,317
108
#' Create a factor with natural (human-friendly) ordering #' #' Converts a character or numeric vector into a factor where the levels are #' ordered naturally (e.g., `a1`, `a2`, ..., `a10` instead of #' lexicographically as `a1`, `a10`, `a2`, ...). #' This is useful for plotting or labeling grouped data where numeric #...
c928e099d9f891f0252492c689f1bf57fa5a17690a9a455d99c688ff9ce2ce59
R
3,317
156
--- title: "Prepare significance results for input into Comb-p" author: - David lukacsovich^[University of Miami] - Lily Wang^[University of Miami] date: "`r Sys.Date()`" output: rmarkdown::html_document: highlight: pygments theme: lumen toc: true number_sections: true df_print: paged cod...
807e89816a68595b5e88f19bb2fb5d15da344996ac24ac0ff4777f4a63aceb51
R
3,319
101
library(Seurat) library(Matrix) setwd("/home/joonho345/1_Epilepsy_RNA/scRNA_Human/") ######################################################### #### Load Seurat Object (Deconv) #### integration_name <- "GSE160189_186538_Integration" seurat_rds <- "/data/project/1_Epilepsy_RNA/scRNA_Human/Deconv_objects/GSE160189_1865...
084f8313af006abc8a9ce11d5f777f60dde6bb7604349fa500b693d1cb584225
R
3,320
106
rm(list = ls()) gc(reset = T, verbose = F) source('script/Functions/Functions.R') pkgs[which(load.packages == F)] rpid = Sys.getpid() options(future.globals.maxSize = 1000 * 1024^3) ids.file = 'results/04.RCTD/' dir.exists(ids.file) || dir.create(ids.file) script_start_time <- Sys.time() cat("Start:", format(script...
23e0819efe4f898b1af972d1ed11f211e983ac45ca987b978b30d728a61fec29
R
3,321
156
--- title: "Prepare significance results for input into Comb-p" author: - David lukacsovich^[University of Miami] - Lily Wang^[University of Miami] date: "`r Sys.Date()`" output: rmarkdown::html_document: highlight: pygments theme: lumen toc: true number_sections: true df_print: paged cod...
7493317421ccad88dfe82680a8a126a5a8532dc55f791b4a57c98061bbc96dc6
R
3,321
139
--- title: "Get statistics for probes and DMRs correcting for smoking" author: - David lukacsovich^[University of Miami] - Lily Wang^[University of Miami] date: "`r Sys.Date()`" output: rmarkdown::html_document: highlight: pygments theme: lumen toc: true number_sections: true df_print: paged ...
6958ed4b378d5d76dbf372201f84032487fe067e3ac9a7ce5beba9db5ec8e399
R
3,323
98
## script to generate histogram of insert sizes from metrics file ## expecting 3 arguments: ## first is the metrics file with the histogram info ## second is the output file ## third is a name for the plot args <- commandArgs(trailing=TRUE) metricsFile <- args[1] pdfFile <- args[2] bamName <- args[3] histoWidth <- ife...
ebf969b1e82dc773e7086645d7cfc80b7719717b2fdaa64a25d00cc3f09e1e28
R
3,333
99
--- title: "Using New Shapes in Venn Diagram" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Using New Shapes in Venn Diagram} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) ``` ```{r setup...
2aa38ca5a2f75866f38a2ada585234ec318e4801bbd70ffc8e4b9fd0b395f328
R
3,336
93
#' Install Python ConnectomeInfluenceCalculator Library #' #' This function installs the Python ConnectomeInfluenceCalculator library #' and its dependencies (PETSc and SLEPc) into the r-reticulate environment #' using an optimized installation script. #' #' @param force_reinstall Logical. Whether to reinstall even if ...
aa6c93c89929858a8e9e00774bad221d728265f1ba94d682e9fd41026c4949cf
R
3,336
51
rm(list=setdiff(ls(),c('params'))) basedir <- params$basedir # make this whatever you like, end with / setwd(basedir) source('code/aba/aba_fxns.R') source('code/misc/miscfxns.R') abadir <- paste0(basedir,'data/aba/') dir.create(paste0(abadir,'ontologies'),recursive = T) # now we need to get a list of relevant structur...
309ac45212097f6edb04b9e55d1a113fd11de88609192f647f4fc35d10afdd99
R
3,338
107
--- title: "Fig_S4F_Tcell_proportion_by_sample" output: html_document date: "2026-02-17" --- ```{r} library(Seurat) library(tidyr) library(ggplot2) library(ggpubr) library(dplyr) library(harmony) library(purrr) library(cowplot) library(rstatix) library(ggbeeswarm) library(ggbreak) ``` # Set up and adjust metadata ```...
a76b746e5767572ef105fbd9c20eb83450689401f48a1ffcbb447c78874ba9f4
R
3,338
92
#!/usr/bin/env Rscript #------------------------------------------------- # Title: Write individual Hisat2 scripts # Author: Amanda Zacharias # Date: 2023-06-30 # Email: 16amz1@queensu.ca #------------------------------------------------- # Notes ------------------------------------------- # module load nixpkgs/16.09 g...
4721b95c69e044bf3bcdd807caa417a68dc30c3575674ea5085fda50bfcb07e9
R
3,340
95
#' Plot cells located within spatial boundaries or ring regions #' #' Visualizes cells that fall within defined spatial regions #' (boundaries or rings), typically obtained using #' the `getCellsInside()` function. The cells are colored by cluster, #' and the function offers two plotting modes: using `geom_sf()` #' (wi...
df42f6fe68f1d3bfd2c8902e05912f568067da2f02fb7291a43bb0da25255420
R
3,347
96
######################################################################################## ### Metabolomics Volcano Plot Generation ######################################################################################## # Clean workspace rm(list=ls()) # Define required packages required_packages <- c("ggplot2", "RCol...
f474b33fca5ac1b2e74add819cff4d89dc9c4ace3cf5209223d514d354395907
R
3,347
133
library(ggplot2) library(dplyr) #input df and group prder # Define custom order group_order # Convert group to factor with specified order df$group <- factor(df$group, levels = group_order) # Recalculate summary with ordered factor df_summary <- df %>% group_by(group) %>% summarise( mean_value = mean(Nkx2.1,...
9c5301a3b34fcecd0e1ac4784f57f1a516b573305ebdfde59e70b7c101b8d41e
R
3,350
160
--- title: "Compare significant probes to Miami-AD results" author: - David lukacsovich^[University of Miami] - Lily Wang^[University of Miami] date: "`r Sys.Date()`" output: rmarkdown::html_document: highlight: pygments theme: lumen toc: true number_sections: true df_print: paged code_do...
91766c239ffe30eb4814ef54f9647f76699ce02a637dba020e51aa9fed620490
R
3,353
96
######################################################################################## ### Metabolomics Volcano Plot Generation ######################################################################################## # Clean workspace rm(list=ls()) # Define required packages required_packages <- c("ggplot2", "RCol...
0b647b8b0a8a28c546de97aa3781e3b1292df9a6aa8401f749c901186005df03
R
3,354
156
--- title: "Prepare significance results for input into Comb-p" author: - David lukacsovich^[University of Miami] - Lily Wang^[University of Miami] date: "`r Sys.Date()`" output: rmarkdown::html_document: highlight: pygments theme: lumen toc: true number_sections: true df_print: paged cod...
fedbdadb3132357a7fe857eb521280d61f4445091ff8cbc3d24d76d03dd5ac7a
R
3,358
69
context("test PANDA result") test_that("panda function works", { # Skip if Python or required modules are not available skip_if_not(reticulate::py_module_available("pandas"), "Python pandas module not available") skip_if_not(reticulate::py_module_available("numpy"), "Python numpy module not available") # tes...
b3e5e2d2ef40f639b08c21d4ec3c04cd4bf4d3f88121a25a7a45691174587af0
R
3,367
111
#' Extract significant genes for all modeling results #' #' This function combines the output of [sig_genes_extract()] from all the #' layer-level (group-level) modeling results and builds the data required for #' functions such as [layer_boxplot()]. #' #' @inheritParams sig_genes_extract #' #' @return A [DataFrame-cla...
1cb5dfa49e3a4f7ef48095a1e410d693a8c68668a68d5a07f3d6fb837d3c98ef
R
3,370
84
library("methods") library("glmnet") library("stringr") library("data.table") library("dplyr") get_gene_annotation <- function(gene_annot_file_name, chrom) { gene_df <- read.table(gene_annot_file,header=F,stringsAsFactors =F,sep="\t",fill=T) gene_df1 <- filter(gene_df,V3 %in% "gene") geneid <- str_extract...
e4310953be3ce2a293793fe79fdd041f2f5d2de0329ec602140506609d069d3f
R
3,373
134
context("Identification of Marker Genes by COSG") library(COSG) library(SeuratObject) # Load test data from SeuratObject package (compatible with v5) data("pbmc_small", package = "SeuratObject") test_that("COSG works with default parameters", { expect_error(cosg(object = pbmc_small), NA) }) test_that("COSG works ...
f8ed2dae89a06dbb30a5ae0f515417fc548ee2915c1427058fae568e6076a09b
R
3,377
101
#!/usr/bin/env Rscript # -*-coding: utf-8 -*- #----------------------------------------------- # Title: scRNA of the naive human DRG from Renthal lab # Author: Amanda Zacharias # Date: 2025-07-22 # Email: 16amz1@queensu.ca # Notes ----------------------------------------------- # module load StdEnv/2023 r/4.5.0 # Opti...
7ac46d7b6878c7f885317369632c036cce381b9b1490febdf739c44972c7438c
R
3,382
83
### Concentration calculation # GPMV data setwd(rstudioapi::getActiveProject()) rm(list=ls()) library(tidyverse) library(stringi) GPMVdf <- read.csv("./Input_Data/GPMV_validated_120525_Full_integration_peak_graded.csv", stringsAsFactors = F) load("./Output_Data/GPMV.IS.w.conc.Rdata") GPMV.lpd.check <- GPMVdf %>% ...
ca786167f59f291451f4161ee77a53ff9b437626d59cfc23bcd8a3524e989c52
R
3,384
86
setwd(rstudioapi::getActiveProject()) library(tidyverse) library(ggrepel) rm(list = ls()) source("./Scripts/Function_scripts/Pre-processing_functions.R") source("./Scripts/Function_scripts/Effect_size_functions.R") load("./Output_Data/M2OE_SC.es.by.OE.in.Old.Rdata") ### ==== Side chains that show opposing effects ...
1ac0d124c9465628c5bc4c181e2d68805c85b91a14ca11fbe3506c96d37dffad
R
3,388
100
#Set QC cutoffs for individual samples library(ArchR) library(parallel) addArchRThreads(threads = 10) addArchRGenome("hg38") outp <- "path_to_outdir" setwd(outp) # create new arrow files for samples mysample <- read.csv("/home/xhan/atac/archrproject0318/list.qcsample", sep = "\t") filename <- paste(mysample$sample, ...
ec8c10b3d71040f1546a73b4fbd71cd066099d6d258581488be92717a298e4a7
R
3,394
72
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### # Parameter settings ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### setwd(file.path(getwd(), "R")) source("00_directorySettings.R") # load baseDir <- "/WORKING_DIR" outDir <- file.path(baseDir, "results") section <- "RSC" ##### ##### ##### ####...
e4093e703ce03a4f883d5e9379ec519594034ca96dcfec171b50d2dd6ee4efa9
R
3,402
105
read_ng_raw_header <- function(con) { if (is.character(con)) { con = file(con, open = 'rb') on.exit(close(con)) } h=list() h$header=readBin(con, what=raw(), n = 8) # h$something=readBin(con, what=integer(), n = 1, size=4) h$filenamelen=readBin(con, what=integer(), n = 1, size=4) if(h$filenamelen>2...
6bb0fe1d47b11b2d742aa63861f36326a68a0a45b1ff00d536a00b6b4b4f6364
R
3,406
104
#!/usr/bin/env Rscript #------------------------------------------------- # Title: Write individual fastqc scripts # Author: Amanda Zacharias # Date: 2022-12-17 # Email: 16amz1@queensu.ca #------------------------------------------------- # Notes ------------------------------------------- # module load nixpkgs/16.09 g...
7c61063bd64bd8f9193540e160a914271fcf88f31b5507ca61a3a332b167e906
R
3,410
65
AnalysisSpatialNetworks<- function(object, cluster_column = NULL, selected_clusters = NULL, selected_pairs = NULL, networks = 'spatial_network_2median') { cell_metadata = object@meta.data nr_...
4839a3bd715a9010c4d38bd4c086be3c48f91c2d26e24422c1ebea40be0d8a2e
R
3,412
88
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### # Parameter settings ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### setwd(file.path(getwd(), "R")) source("00_directorySettings.R") # load baseDir, xeniumDir source("00_settings.R") dataDir <- file.path(baseDir, "data") outDir <- file.path(baseDi...
eba4fc1565f3f3d6594ad378f2eef9d08fa30a22ffd191938c390e0c0d84ca7c
R
3,415
102
# Call DARs for individual cell types based on the downsampled dataset. library(ArchR) library(parallel) addArchRThreads(threads = 5) addArchRGenome("hg38") library(ComplexHeatmap) library(ggsignif) library("RColorBrewer") proj <- loadArchRProject(projdir) outp <- "mydir" dropSubCs <- c("undefined","ast.C6","mg.C8"...
f3568bf288b226ac2231827c1bbb167c382d81ff7ec85db50b7f19c929243958
R
3,419
88
#' Compute a spatial neighborhood interaction matrix using #' K-nearest neighbors (KNN) #' #' Computes a spatial interaction matrix where each entry quantifies #' the number of neighboring cells from a given cluster (columns) that are #' among the `k`-nearest neighbors of cells in another cluster (rows). #' This provid...
3904ed5da275af44d244558770a7f8d1a405fdecd6c598abffff8a12d31f917f
R
3,421
133
library(data.table) #library(readr) #library(readxl) library(dplyr) ###### NCA ######### table3_NCA_AUC_CPTPSP <- readRDS("datasets/table3_NCA_AUC_CPTPSP.RDS") table3_NCA_AUC_CPTPSP %>% summarize(median_value = median(AucRatio, na.rm = TRUE)) table3_NCA_CLAST_CPTPSP <- readRDS("datasets/table3_NCA_CLAST_CPT...
9048f0699803a12f154b483493583ad73ab0990a485c2d633deae02ac51a2377
R
3,421
103
#' Import alignments from a .BAM file. #' Optional filtering can be applied for the alignments, based on bam flags, mapping quality, and reference sequences. #' LoRTIA ouptuts can be imported, along with LoRTIA tags for further filtering. #' Gaps (Ns) in the alignments can be removed into distinct alignments for the sa...
f853117c89d1247fc0911940b792b1426c7ca1efc46cb154a39ef0f5e09a560e
R
3,423
85
setwd(rstudioapi::getActiveProject()) library(tidyverse) library(ggrepel) rm(list = ls()) source("./Scripts/Function_scripts/Pre-processing_functions.R") source("./Scripts/Function_scripts/Effect_size_functions.R") load("./Output_Data/Exp2_lpd.es.by.KO.in.old.compare.to.CTRL.Rdata") ### ==== old ==== # In KO dataset...
b41d3c22404e2c21a8b13c7e1b3a400f8116a534459156b6abecea37d929b4b0
R
3,424
75
## Correlations with peak frequency and oscillatory power in alpha, and other bands library(ggplot2) library(ggpubr) library(readr) library(tidyverse) library(psych) library(reshape2) library(flextable) library(boot) library(rempsyc) library(ppcor) settheme = theme(strip.text.x = element_text(size = 9.5, face = "bol...
93c41f1fc5f1fa9602eda3a816c89d609eda694d7de3d835dc2933638667ae9d
R
3,426
79
# 1. 加载必备包 #install.packages(c("dplyr", "readr")) # 首次运行需安装 library(dplyr) library(readr) # 2. 读取输入文件(适配上传的CSV) # 若读取后字段名与预期不同,需修改后续代码中的字段名(如background_size、degs_num等) df <- read_csv("overlap_data_up_regulated.csv", show_col_types = FALSE) # 查看数据结构(确认字段名和数据完整性) cat("数据字段名:", colnames(df), "\n") print(head...
0843700033b106f184f939d41bbd96bb9b380b4c1efdf0166f3d8e84dd6d7c22
R
3,427
116
# ====================================================================== # GLMM ANALYSIS NOTE # ====================================================================== # This script implements a logistic generalized linear mixed-effects model # (GLMM) to quantify how M1 social gaze primitives predict M2 social gaze # be...
5719f46cbfe927c384adffb1bbf428531088f61d09e0eacf3fa8d8e34d87c2c4
R
3,427
97
library(tidyverse) library(extrafont) intros <- c("wel_and_sel_to_lpa", "lpa_to_wel", "lpa_to_sel") intros_long <- c("Iberian lynx", "Western Eurasian lynx", "Southern Eurasian lynx") get_obs_stat <- function(intro, stat){ return(read.table(paste0("data/introgression_scans/bed_files/", intro, "_intro.merged.", stat...
5cdce96e704a9d61f73601799b7bb4f151b5f6196b4a1fb4c09e86360f2d23d3
R
3,429
48
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### # Parameter settings ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### setwd(file.path(getwd(), "R")) source("00_directorySettings.R") # load baseDir <- "/WORKING_DIR" source("00_settings.R") dataDir <- file.path(baseDir, "data") nmfDir <- file.path...
15c0bbec2997c982f090926530d37bf8202f71287ae88f89b2023c2432b09b18
R
3,430
79
# 1. 加载必备包 #install.packages(c("dplyr", "readr")) # 首次运行需安装 library(dplyr) library(readr) # 2. 读取输入文件(适配上传的CSV) # 若读取后字段名与预期不同,需修改后续代码中的字段名(如background_size、degs_num等) df <- read_csv("overlap_data_down_regulated.csv", show_col_types = FALSE) # 查看数据结构(确认字段名和数据完整性) cat("数据字段名:", colnames(df), "\n") print(he...
0d599674c333dd3d9b445fef44ce6024a7b3dae64062515d1a6a4585b4db2aba
R
3,432
99
library(MatrixEQTL) ## Settings # Linear model to use, modelANOVA, modelLINEAR, or modelLINEAR_CROSS useModel = modelLINEAR; # modelANOVA, modelLINEAR, or modelLINEAR_CROSS args <- commandArgs(trailingOnly=TRUE) n_args <- 7 if (length(args) < n_args) { stop(paste0("Error: Too few arguments supplied (", length(arg...
6ef3d5d3902d4c288b889337a3e490d8aa886a65128fea6b794c1aaf22e1a927
R
3,432
60
#' Initializes marker sets for SAHA analysis #' #' Filters markers from query and database datasets based on specified thresholds. #' #' @param ann An object containing `query$Markers` and `db$Markers` data frames. #' @param p_thresh Adjusted p-value threshold for marker selection. #' @param FC_thresh Fold change thres...
d31329a2370ef7e6eda137f3f172fcb2d8f7a6298cd0d56871b810828e4e5a43
R
3,441
90
library(mgc) library(foreach) library(doParallel) library(stringr) ## Calculate the mean of real, bootstrap and jackknife Discr setwd('/home/huyang/Projects/HuYang/HY_20251111') ## Set parallel cluster to speed up n.cores <- 20 my.cluster <- parallel::makeCluster(n.cores, type = "FORK") doParallel::registerDoParallel(c...
0cd566b98cb6a10e14fa1ebf4f1f0be55c4f5abe4b4eb68d28f16a3a16f217c9
R
3,442
115
library(IsoformSwitchAnalyzeR) dir <- "C:/Users/Jiawan/Dropbox/Jiawan/Analysis/isoform/abundance_mn" patterns <- c("111", "131", "185", "CR001WT", "CR007WT") # List and concatenate files matching any pattern samples_all <- unlist(lapply(patterns, function(p) list.files(path = dir, pattern = p, full.names = FALSE))) ...
fa0b80ce6cb2aa5ebb0d58ba064836e587e93b411805576850ee6d9d01d26d08
R
3,442
80
# Load required libraries library(dplyr) # Data manipulation library(readr) # CSV reading and writing library(tidyr) # Data reshaping # Ensure the results directory exists; create it if missing if (!dir.exists("results")) { dir.create("results") } # Function to export single-variable raincloud data export_sin...
67011792c06f27b4442eeccfebd8204fd02a1dd6862c516b2db131a5c7f8b8f4
R
3,443
101
here::i_am("scripts/3.brain_dataset/3.1.data_preparation/3.1.3.subsampling.R") library(tidyverse) library(Matrix) library(SingleCellExperiment) library(scran) library(foreach) library(doParallel) library(transformGamPoi) library(SummarizedExperiment) library(here) input_dir <- here("data/brain_dataset/processed_data/...
815df29ee1718d2f1d4f3954a47f0c2f3b07217a3a8d4214612e12491cb5f329
R
3,445
103
--- title: "Code of geneFiltering()" subtitle: Workflow run by geneFiltering() output: BiocStyle::html_document: number_sections: no toc: yes toc_float: false css: corrected.css html_notebook: toc: yes pdf_document: toc: yes package: '`r pkg_ver("SCENIC")`' vignette: > %\VignetteIndexEn...
90c65199e219c981814281fc0f21edcf53cbc1b05e9fb8c90db48cf4d35c3aef
R
3,445
85
### `utils.R` – 公共函数 ```r # utils.R # Common functions used across the analysis pipeline #' Parse GeneRatio string (e.g., "10/100") to numeric parse_ratio <- function(ratio_str) { as.numeric(sapply(strsplit(ratio_str, "/"), function(x) as.numeric(x[1]) / as.numeric(x[2]))) } #' Cluster enrichment analys...
a3ce2b3938110acaa840dc02ff18fdac28b4ed8fb27afccdf1f27c2f7fb35af0
R
3,447
110
################################################################################ ###############------ PREPROCESS FUNCTION FOR MODEL FITTING -----############### ################################################################################ ## Proprocessing task data for cmd stan modelling --------------------------...
81f3a8f6c9412c1b6264607fe6d68bd92731aadaeb99dab1b765f468ddba0e36
R
3,448
119
#!/usr/bin/env Rscript suppressPackageStartupMessages(library("argparse")) # create parser object parser <- ArgumentParser() # specify our desired options # by default ArgumentParser will add an help option parser$add_argument("-i", "--input", required=TRUE, help="input snap format file") parser$add_argument("--frag...
70cc1eaee25f32efa5d5961501ed8bed506e554b5dcd25b1522167c49eebfdd4
R
3,450
98
# ============================================================================== # Logistic Regression Analysis with Elastic Net and Bootstrapping # ============================================================================== # Load required libraries library(glmnet) library(reshape) library(ggplot2) library(GGally)...
7e9493365c95425ec8a275be2280ea1663014ef9252159e7b0f2ba17b4b64e89
R
3,451
78
#' Find all merged segment ids for a given starting google segment id #' #' @param x a segment id or any other input that can be interpreted by #' \code{\link{ngl_segments}} #' @param return.groups Whether to return the merge groups as well as the #' segment ids #' @param return.segmentids.for.groups Whether to ret...
353c233357c03479575a32456d40ebe3840a816b37471676d1730c745116f804
R
3,452
80
#install.packages library(Seurat) library(ggplot2) library(DoubletFinder) library(dplyr) library(cowplot) library(reshape2) library(MAST) setwd("/athena/ganlab/scratch/lif4001/LG815C/integration_mt5") LG815C_integrated <- readRDS("LG815C_integrated_PCA_0.1.rds") Idents(LG815C_integrated) <- "seurat_clusters" #Remove 5...
9baa6ebc2bcc7c4ae1402ace45af6565c8e1793aa91c3d053f930547156f4c84
R
3,452
104
#### set up #### setwd("/scratch/hhu/MethylCnT/04-analysis/ANA08-organoid_development_enrichment_overlayBS/") library(methylKit) library(dplyr) library(rtracklayer) library(ggplot2) library(reshape2) library(ChIPseeker) library(org.Hs.eg.db) library(GenomicFeatures) library(biomaRt) library(tidyverse) library(ggalluvia...
4fa278d734cdfcb33f64e53d7b47db76e7514196b2e475faec49bedad7e69f3a
R
3,453
118
# Clonal Diversity--Time-Scaled Phylogenetic Tree rm(list=ls()) library(ggtree) library(treeio) library(phytools) library(phangorn) library(ggplot2) library(ggpubr) load('~/.../data/Phylotime/Phylotime_WholeMidgut.RData') # Take the time-scaled phylogenetic tree of first sample obtained on day 3 (S1_3d...
f3e01a5273d9e9b6213f6ea0439a5370512147f41b5a6911694802942f1efdaa
R
3,454
90
#' Obtain the colors for a set of cluster names #' #' This function returns a vector of colors based on a vector of cluster #' names. It can be used to automatically assign colors. #' #' @param colors A vector of colors. If `NULL` then a set of default colors will #' be used when `clusters` has less than 12 unique valu...
8b9d5d90dea23da17a29260cea2fb9dbaab5695f308dde8b043b295c24098a82
R
3,456
97
#' Compute Spatial Enrichment Index (SEI) for Each Gene #' #' Calculates the spatial enrichment index (SEI) for each gene based on #' a user-supplied set of spatial weights. The SEI reflects the extent to #' which gene expression is enriched in spatially weighted regions of #' the tissue (e.g., near boundaries or centr...
820555eedb1839d8b71c953ad693bb153a1c6a17d71ce8742a5d077da7b846e1
R
3,465
108
library(dplyr) library(stringr) library(openxlsx) library(forestploter) library(grid) library(ggplot2) labName <- c("ner", "ren", "eye", "car", "per", "met", "mic", "mac", "int") compAbb <- c( "DN","DKD","DR","DCVD","DPVD", "Metabolic Disorder","Microvascular", "Macrovascular","Total complication" ) ...
a94f4ecc5f46e9af5c4ec7364f5502d029fa217afc442990339371993facc7a4
R
3,466
81
### Concentration calculation # In vivo sorted data setwd(rstudioapi::getActiveProject()) rm(list=ls()) library(tidyverse) library(stringi) library(openxlsx) load("./Output_Data/Invivo_IS_w_conc.Rdata") Invivo.df <- read.csv("./Input_Data/Invivo_sorted_NSCs_integration_graded_120325.csv", stringsAsFactors = F) Invivo...
6e08ce4127e68494c70857c2e694a5eec8f02b136217e0a77ac11e2ee897689d
R
3,467
91
# R script for identifying CN and MCI converters based on longitudinal data # Author: Maryam Hadji, University of Eastern Finland, Kuopio, Finland (maryamh@uef.fi) # Last updated: 21-Feb-2025 # # Description: # This function identifies stable and converting individuals in the CN and MCI groups # based on their longitud...
4f234664372b826f2be99a4a6042e3a5fce648453abdf04822389f2198e030a2
R
3,469
69
#' @keywords internal #' @section Package Options: \itemize{ #' #' \item{\code{fafbseg.sampleurl}} optionally set to a sample Neuroglancer URL #' that will modified to point to arbitrary locations by #' \code{\link{open_fafb_ngl}}. #' #' \item{\code{fafbseg.cave.datastack_name}} optionally set to the #' \code...
04defd1e37ec128dce940a55d747c837232967bc30bff88878e23a1c3bec67fb
R
3,476
85
setwd(rstudioapi::getActiveProject()) rm(list = ls()) library(tidyverse) library(ggpubr) library(ggtext) source("./Scripts/Function_scripts/Effect_size_functions.R") source("./Scripts/Function_scripts/Pre-processing_functions.R") load("./Output_Data/Lpd.MsD.Invivo_Age_ES.w.RT.Rdata") load("./Output_Data/Lpd.MsD.Invit...
e37a4f71a534a571713fafbd9bb4ae072e1a7e27ca6ab60aa334277093db523c
R
3,477
98
##################################################################### # Brain Tissue Module Mapping Pipeline ##################################################################### # This script performs gene module mapping for downsream coeQTL analysis for brain tissue data. # It processes each brain region and gene...
70751df44d345ad2a9c5b93ba20cf8af0dbeac404cafbd49441843864d7584e8
R
3,480
130
--- title: "BANC" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{BANC} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) have_fafbsegpy=!inherits(try(fafbseg:::check_fafbsegpy(), silent = TRUE),...
e9070c009c3cdbfb5bf763f088034a4c2c637fba63bf71757ba4df8ac87a92f5
R
3,483
96
#' Summarise the connectivity of FANC neurons #' #' @details note that the rootids you pass in must be up to date. See example. #' #' @param rootids Character vector specifying one or more flywire rootids. As a #' convenience this argument is passed to \code{\link{fanc_ids}} allowing you #' to pass in data.frames, ...
c4ce5eb0812df77c21fd9f323a8a5c71417ffb1c5b4a2b63507236611bb61fe0
R
3,486
121
### ----------------------------------------------------------------- ### Legacy exploratory analysis by a member of the Wilson Lab. ### Historical record only — not part of the bancpipeline release. ### ----------------------------------------------------------------- # Load banctable and save DN metadata, DN skeleto...
680a891b8844eb0b85765c5857fab7a214bdac4466e313395ee10accacfd921b
R
3,489
93
#!/bin/env Rscript library(tools) args <- commandArgs(TRUE) verbose = TRUE tranchesFile = args[1] targetTITV = as.numeric(args[2]) targetSensitivity = as.numeric(args[3]) suppressLegend = ! is.na(args[4]) # ----------------------------------------------------------------------------------------------- # Useful gene...
c348f54ce74569848457f83892af4a2e7f904cff56be88d365fb896c830b4c2a
R
3,489
157
--- title: "Process nested CV results for ECG" author: "Joonatan Palmu" date: "`r format(Sys.time(), '%d.%m.%Y')`" editor_options: chunk_output_type: console --- # Init ```{r options, include = FALSE} knitr::opts_chunk$set(include = TRUE, echo = TRUE, message = FALSE, results='asis', cache=FALSE, warning=FALSE, co...
c92ace6ff383cd7b17591b12d33cd65370f08050253390d967782c92f5268590
R
3,489
70
library("here") library("sessioninfo") outdir <- "spatialLIBD_files" pkgname <- "spatialLIBD" meta <- data.frame( Title = c( "Visium_SPG_AD_Visium_wholegenome_spe", "Visium_SPG_AD_Visium_targeted_spe", "Visium_SPG_AD_Visium_wholegenome_pseudobulk_spe", "Visium_SPG_AD_Visium_whole...
da49f61299751998147893f3feb61947a5c5ea3ca58cc7a4591a590709128b58
R
3,489
87
library(ggplot2) #### Define TPM matrices to process #### tpm_matrices <- c( "merged_matrix_TPM", "adjusted_merged_matrix_1_TPM" ) #### Read coldata (once, before loop) #### coldata_df <- read.table("/home/joonho345/1_Epilepsy_RNA/RNA_Human/02.Quantification/filtered_coldata.txt", sep = "...
8979b647d90b2818f638a80c72b82535981aba954d9ca64ed661fa830b7ccb3d
R
3,491
115
############################################################## # Script: 04_enrichment_analysis.R # Purpose: Perform GO (enrichGO) and pathway (Enrichr) enrichment # analyses for differentially expressed proteins ############################################################## # ======================== ...
1283fd9f6e8540ee4d6b499ec4110ed10168325804f84e128a8d7153b54610cc
R
3,494
91
library(epicalc) ####################### #Read PB final results# ####################### #PB_complete<-read.table('sorted_complete_primeend.txt',sep="@") #colnames(PB_complete)<-c("Queryid", "complete_start", "complete_end", "gi_complete", "complete_Strain") #PB_complete<-PB_complete[,1:5] #PB_complete<-PB_complete[,...
14a6d38666af540025dba99dc277b2f6559983e5413de03d7ef383695a30ac13
R
3,497
106
suppressPackageStartupMessages({ library(ggplot2) library(ggrepel) library(ggpubr) library(UpSetR) library(RColorBrewer) library(tidyverse) library(VennDiagram) library(ggVennDiagram) library(clusterProfiler) }) # Gene Onto d2 <- read.table("dge/TETA_Dge_MouseID.txt",header=T) d2 <- d2 %>% filter(Direction == "TETA_...
13c8e333f97d2e1f86081e64f26406dba8a2d7edcf73a0f79c24d21ca8fcfdea
R
3,501
92
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### # Parameter settings ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### setwd(file.path(getwd(), "R")) source("00_directorySettings.R") # load baseDir <- "/WORKING_DIR" source("00_settings.R") dataDir <- file.path(baseDir, "data") nmfDir <- file.path...
1d706021adf99c8cfca9151f53e2a577dc5a0dd8d0730b5d6d7942b9d4a94530
R
3,502
128
library(ggdmc) library(tidyverse) # options for summarise options(dplyr.summarise.inform = FALSE) # set cores options(mc.cores = parallel::detectCores()) # set options for brms options(brms.backend = "cmdstanr") setwd("/Users/vilya/Downloads/ddm-scripts") # Setup caching of results ddm_dir = "./_ddm_models-exp" if...
447dbcd6cb9afb92c398eb1b755145805bce7094400b820062a9ff6034e26cf4
R
3,502
108
context("Model xgboost") idx <- withr::with_seed(3809, sample(nrow(mtcars))) predictors <- c( "mpg", "cyl", "disp", "hp", "drat", "wt", "qsec", "vs", "gear", "carb" ) rownames(mtcars) <- NULL train <- mtcars[idx[1:25], ] train <- list(data = train[, predictors], label = train$am) test <- mtcars[idx[26:32], ] test ...
f23126bc2e079f2fafbaaf507a15ab99dffe0db01ec6d388c813a6cbab86843f
R
3,502
73
#' Run an MLflow Project #' #' Wrapper for the `mlflow run` CLI command. See #' https://www.mlflow.org/docs/latest/cli.html#mlflow-run for more info. #' #' @examples #' \dontrun{ #' # This parametrized script trains a GBM model on the Iris dataset and can be run as an MLflow #' # project. You can run this script (assum...
4240052c0d1049e89c420bf930e208c29c76d83012d4fa5676d12f3f205e4f65
R
3,511
89
#' Run COBRA in R #' #' Description: #' COBRA decomposes a (partial) gene co-expression matrix as a #' linear combination of covariate-specific components. #' It can be applied for batch correction, differential co-expression #' analysis controlling for variab...
7c0530edec9250bbaebdefb59adb7597526453939e61b217e4360395c1510d98
R
3,512
105
--- title: "Fig_3H_CD8_CART_CSF_Cytox_Exh" output: html_document date: "2026-02-17" --- ```{r} library(Seurat) library(tidyr) library(ggplot2) library(ggpubr) library(dplyr) library(harmony) library(purrr) library(cowplot) library(rstatix) library(ggbeeswarm) library(ggbreak) ``` # 8) Import CSF data and compute Cyt...
1338120d6235fabf5b0c7bab81e29171d3c29f4fd5ffa897b2440b764db77a4a
R
3,519
124
# ============================================================================= # CHCHD10 Interactome # Enrichment Ranking Plot (Strong candidates only) # # PURPOSE # plot the CHCHD10 IP enrichment ranking using the ranking table generated # in Step 1b, while excluding Report-style candidates from the figure....
c207ba6b6d9b55967098fcfeb1eaaa92df3441940eb1ca3a8fb4105695cbc867
R
3,520
166
--- title: "Ambra Villani's microglia RNA-seq, custom plots" author: "Izaskun Mallona, Mark D. Robinson's lab, UZH" date: "`r format(Sys.time(), '%d %B, %Y')`" output: html_document: toc: true toc_float: true code_folding: hide code_download: true number_sections: true df_print: kable them...
5e9bdb6ca5855202d7f3a03c5af2257e1394fdd9f577bb12bc019bed7e4148a6
R
3,524
87
### PCA library(tidyverse) rm(list=ls()) ########Import color LUT for all future plots with KO ####################################################################### load("./Output_Data/KO_LUT_paper.order2024-02-08.Rdata") ######PCA on individual lipids################################################################...
f45b4ab322828c947a3bda2219bcb7c0432ebf86315e773d5169a4790ba7c423
R
3,524
80
# R script for generating ROC curves and AUC values for CN and MCI groups based on hippocampal/Ventricle/TGM volume and other models # Author: Maryam Hadji, University of Eastern Finland, Kuopio, Finland (maryamh@uef.fi) # Last updated: 21-Feb-2025 # # Description: # This function loads ROC values for CN and MCI groups...
a5ea6b294f251f9052a8f401ce6957120b0c2f79ce39c03995a09dd2fb045397
R
3,526
99
#' Plot a heatmap of a row-scaled spatial interaction matrix #' #' Visualizes a spatial interaction matrix using a heatmap, #' where rows represent focal clusters and columns represent neighbor clusters. #' Each row is scaled using z-scores to highlight #' relative enrichment patterns across neighbor types. #' This is ...
8bc2159aac98930d8bab13a6a885ea0e9471b3dd06f0a56e70c03f76144d2008
R
3,531
124
# ============================================================ # Pre-image reconstruction–based dimension selection # # This function selects the truncation level of KPCA # components using cross-validated pre-image reconstruction # errors. # # IMPORTANT: # - This procedure is NOT intended for reconstructing #...
969c9e02914d1b963f64aa4646d0d41cf9fbe3e4c1deb1f9d7a3cbae799d46b7
R
3,533
150
# Script from Avishay Spitzer # mdata - the metadata table that contains for each cell the CellID, Patient, Timepoint, Sample, State etc # umi_data_all - a named list per sample of UMI count matrices euclidean_dist <- function(x, y) { sqrt(sum((x - y)^2)) } # Helper function that normalizes UMI counts to per-millio...
4a7276685584b3a2cb852d9f6d4fd5da361f36ce873a220b8b57d8109873c361
R
3,534
88
library(ggplot2) #### Define count matrices to process #### count_matrices <- c( "merged_matrix", "adjusted_merged_matrix_1" ) #### Read coldata (once, before loop) #### coldata_df <- read.table("/home/joonho345/1_Epilepsy_RNA/RNA_Human/02.Quantification/filtered_coldata.txt", sep = "\t",...
0ef93be85548d23a40ec4f9aa28046cc1b26cf4b1c318f88b71f918e26d5cea1
R
3,547
189
--- title: "Tutorial: Using ggVennDiagram" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Tutorial: Using ggVennDiagram} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.width = 7, fig.a...
4ed3b49f44f34caa626ed615774bdd54e10dbbdc6a36a562d365a42c1188ee41
R
3,547
116
############ Class Venn ##################### # # The Venn class is defined originally in RVenn package by *Turgut Yigit Akyol*. # It set a good model in calculating the subsets between different sets. # However, RVenn has not been updated since 2019. I communicate with # its author and he agreed to transfer some of th...
4fe5e020cd5a03643a3bd458f68eb5dad2167386cc2671051bd078489013d367
R
3,559
179
--- title: "PBMC10K tutorial for COSG" author: "Min Dai" date: "2021/6/18" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{PBMC10K tutorial for COSG} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ### L...
5676aca904763d27f75f8c4fb7d6fa823064d7b96abd8c1ab5f63646e56d87b1
R
3,560
125
--- title: "Global_CSF_Analysis" output: html_document date: "2025-03-20" --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ## R Markdown for global CSF (white and grey matter) analysis for PEACE study (Colwell et al., N.D.). ```{r cars} library(dplyr) library(tidyverse) library(gtools) library(...
7b46fe5f52347d951ad9f9f78cb29d160e2aacbaf738f495085b7de37925f86c
R
3,560
71
library(epicalc) HPV<-read.csv("HPV.csv"); #start if (length(readLines("seqment_start_id.txt"))>0 && length(readLines("seqment_end_id.txt"))>0 && length(readLines("end_ALL_TAXONOMY.txt"))>0 && length(readLines("start_ALL_TAXONOMY.txt"))>0) { start_id<-read.table("seqment_start_id.txt") c...
c50f97567a588dcf0d9d3c56c2197696018d8e28b5fcdf933c8bc6655ec1822c
R
3,561
79
#' Identify differential edges in two PANDA networks #' #'To determine the probability that an edge is "different" between the networks, #'we first subtracted the z-score weight values estimated by PANDA for the two networks and then determined the value of the inverse cumulative distribution for this difference. #'T...
fc71d14452be419303bcc0b9b4bdcbcd4eae610e55b98b3723699a61f247f60b
R
3,564
102
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### # Parameter settings ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### setwd(file.path(getwd(), "R")) source("00_directorySettings.R") # load baseDir <- "/WORKING_DIR" source("00_settings.R") dataDir <- file.path(baseDir, "data") outDir <- file.path...
82d97797c656f26810fef54d9f6148a399a0ca169a865ee464dcbb2f6c2dc2f8
R
3,565
89
# Hai Wang # Explore the relationship between p-values and importance scores library(data.table) args <- commandArgs(trailingOnly=T) tissue <- args[1] ############################################################################################ # load eQTL data ##############################################...
2e04451226fbfe77b6fbbdb56ab17bf4369223cf3fcac1022e588055dfbbd6c3
R
3,568
99
## Figure S3 #### tell_user('done.\nCreating Figure S3...') resx=300 png('display_items/figure-s3.png',width=13*resx,height=16*resx,res=resx) layout_matrix = matrix(1:40, nrow=10, byrow=F) layout(layout_matrix, heights=rep(c(0.3,1),5)) loq = read_tsv('data/loq.tsv', col_types=cols()) reference_dilution = 12 loq %...
840cb5789625189a44384afada685a7bfd980b8d057c3df80ba1e05f346f21e4
R
3,569
86
##### Plots for the Publication ##### tany_integrated1 <- subset(x=tany_integrated, subset = Diet == "Chow" & Age == "6+ weeks") #Figures were plotted using Chow diet fed 6+ weeks old adult mice. #Plot for the Fig 1c. desired_order <- c("beta 2","beta 1","alpha 2","alpha 1") tany_integrated1$label <- factor(...