sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
07137c5916661d136daccf1aca9fdf755397321409a159253a5d8f5a4f919be0 | R | 12,418 | 350 | suppressPackageStartupMessages({
library(optparse)
library(msigdbr)
library(gplots)
library(dplyr)
library(clusterProfiler)
library(ggplot2)
library(ggnewscale)
})
# --- 定义参数列表 ---
option_list <- list(
make_option(c("-i", "--input"), type = "character", default = NULL,
help = "【必填】输入主目录路... |
239b531af59cbc925d71f6e45d8c7ab7d4838ea33a7a970d307496fdad1b153d | R | 12,430 | 606 | # Reproducible workflow for vegetation trend prediction
#ANN, ANN-PSO, and ANN-GWO models
# --------------------------------------------------
# 1. Required Packages
# --------------------------------------------------
packages <- c(
"sf",
"dplyr",
"caret",
"nnet",
"pso",
"doParallel",
"pa... |
0d61d5671699608bce00ac61985f9da1c92c8c58650febdcdfb2cc27c3fa4cf9 | R | 12,432 | 189 | ##################################
# Visualize the metaprograms across different batch features (tumor type and lab)
# Author: Kevin Johnson
# Date: 2026.04.13
##################################
library(tidyverse)
library(scales)
proj_dir <- "/vast/palmer/pi/verhaak/kcj28/care_idh_mut"
fig_dir <- file.path(pro... |
9ab33ceeb98062b8b1e1539e4ec0af10a3927a3fbaa1431130d67892b654bcfb | R | 12,443 | 304 | Sys.setenv(LANGUAGE = "en")
options(stringsAsFactors = FALSE)
#####Differential analysis
BiocManager::install(c("DEGseq","qvalue"))
library(qvalue)
library(DEGseq)
library(data.table)
geneExpFile <-data.frame(fread("gene_count_matrix.csv",header=T))
geneExpFile$name<-make.unique(geneExpFile$name)
row.names(geneExpFile... |
d54ae117422ef91da073fd8f87bd5d9e095b50901208be59871b1af0c2f00770 | R | 12,461 | 334 | # ============================================================================
# Figure 4B: Factor1/GDF15 vs Place of Death - DATA PROCESSING AND FIGURE
# ============================================================================
# This script creates plots showing:
# - Factor1 (ISR) score vs place of death for bra... |
49a7b3b295ec967f8ca69709b46504d8d1622f35cda06fb33d5240de6966e10c | R | 12,476 | 349 |
suppressPackageStartupMessages({
library(dplyr)
library(readr)
library(rlang)
library(stringr)
library(tibble)
})
`%||%` <- function(a, b) if (!is.null(a)) a else b
# -------- Paths --------
base_path <- "~/Dropbox/Jiawan/JS_paper_summary/iPSC_paper/iPSC data summary/11_SUBMISSION/Nature communications sub... |
205eb8681ac99154dea8f15de39aba990bbc6e8e3bcfa46e8bf7cecb469f43e9 | R | 12,482 | 358 | # Pipeline Overview: Single-cell MR Discovery, Replication, and Colocalization
# ----------------------------
# Step 1: Discovery Mendelian Randomization (MR)
# ----------------------------
## 1.1 Load necessary libraries and data
library(readxl)
library(dplyr)
library(TwoSampleMR)
library(MRInstruments)
library(writ... |
19d67c042be2134ef2f7a8c56d555fe544cfef10c2c832efa43200e8525ed116 | R | 12,490 | 225 | #' Run python implementation of LIONESS
#'
#' \strong{LIONESS}(Linear Interpolation to Obtain Network Estimates for Single Samples) is a method to estimate sample-specific regulatory networks.
#' \href{https://pubmed.ncbi.nlm.nih.gov/30981959/}{[(LIONESS publication)])}.
#'
#' @param expr_file Character string indicat... |
dcad045fe2dd204a534bb897c33b0b6386e4e4442137ee023e290396f690748b | R | 12,512 | 267 | library(ggvenn)
library(ggVennDiagram)
library(treemapify)
##### Generate condition protein lists #####
conditions <- c("P1.DG", "P1.HP",
"P3.DG", "P3.HP",
"P5.DG", "P5.HP")
selected_data <- list()
# Extract number of proteins per condition that fulfill 60% presence
for (... |
b98039a96220ccebfecaf08e697ec37164697f3ff5ad1c52d7e402eb6d1c7381 | R | 12,522 | 418 |
# Galton–Watson model reveals mechanisms underlying age‑dependent clonal extinction
rm(list=ls())
library(data.table)
library(dplyr)
library(tibble)
library(purrr)
library(ggplot2)
library(randomForest)
library(tidyverse)
library(ggtext)
library(patchwork)
library(scales)
set.seed(52637)
# Ne
lo... |
9b4bf112fb0ada4df19ee038130c7e18a4303deb4a1e9c7624298c34c46b5677 | R | 12,536 | 318 | ### -----------------------------------------------------------------
### Legacy exploratory analysis by a member of the Wilson Lab.
### Historical record only — not part of the bancpipeline release.
### -----------------------------------------------------------------
library(bancr)
library(Matrix)
library(uwot)
libr... |
050450f6fdb79a5e65bf0243f20045b4c17b2bfd252700619f31d468e30d35d7 | R | 12,546 | 309 | # This script runs Wald test from DEseq2 library, the output are .csv files for each pairwise comparison between pesticide and control for each species.
# The files contail adjusted p-values and log2fold change values
# Upload data
bter_dds <- read_rds("~/2023-species_comparisons/DGE_pipelines/bter_dds_filtered_0520... |
774640a1d9218ba63658483344347a86a0edc4065fd82194b4e426ddeb52773c | R | 12,578 | 396 | # ===============================================================
# 🧪 Table Analyzer — Upload Module (Stable wide-format version)
# ===============================================================
upload_ui <- function(id) {
ns <- NS(id)
sidebarLayout(
sidebarPanel(
class = "ta-sidebar",
width = 4,... |
82815b81391dd4dc85b0754fb9c030ca9cd8ff05626c61052a587e6efb1eef10 | R | 12,579 | 192 | context("test-ids")
test_that("simple ids", {
# temporarily use test zip folder
op <- options(fafbseg.skelziproot = 'testdata/skeletonzip/')
on.exit(options(op))
expect_equal(segmentid2zip(10001654273), "10001.zip")
baseline = structure(
c(10001654273, 10001654273, 10001654273, 0, 1, 2),
.Dim = 3:2... |
bd339bc20110114bc14337825b98d10467917dd375fc33c96b3b00844c2ec14a | R | 12,594 | 249 | # Load necessary libraries
library(dplyr)
library(pheatmap)
library(Cairo)
library(ComplexHeatmap)
library(circlize)
library(ggplot2)
library(grid)
# Choose Species
Species <- 'Mouse'
orthologs_path <- "/home/joonho345/resources/GeneSet/Orthologs/One2one_hs_mm_17128.txt"
l2fc_df <- DESeq_l2fc_df_M # import data from ... |
7b32ca0f81efa120aa27b665a7a03cecb98d3052e714c3da7a96a788497df808 | R | 12,631 | 145 | ########################################################################################################
#### Trial dataset for this R script can be downloaded from ####
#### https://data.mendeley.com/datasets/454s2vw255/1/files/aeff59d8-1fdf-46fe-b960-be5bbc36d53e ####
##... |
f206594663ca8d0e664fca952799292b8522050649175e29fc6b72964055e1f1 | R | 12,650 | 303 | #Rscript /media/StorageOne/HTS/VirusMeta/SAM_BAM/virus_positivity_OR.R '/media/StorageOne/HTS/VirusMeta' '/media/StorageOne/HTS/Projects/2011_G5_96ALL-HiSeq' '/media/StorageOne/HTS/Projects/2011_G5_96ALL-HiSeq/PB/virus_final_index.csv' 'Family' '/media/StorageOne/HTS/Projects/2011_G5_96ALL-HiSeq/PB/virus_taxa_OR.csv' 5... |
8ad7ff83b6a0976251436f5985d060aeb6785564d5cc44aa2f1a8ebd56f79622 | R | 12,651 | 439 | ######################################################################################
###### File Name: NACC_NP_Harmonization_Script_01092026.R #####
###### DATE: 2026-01-09 #####
###### Authors: Lingyi Lu (Gary Beecham, PI) ... |
81d18ff0ec72c175db3a53086856e95437e1732439a5b0352b1c3c98d87ec1cf | R | 12,681 | 328 | #' banc-test — Push 10 neurons through the full pipeline as a smoke test.
#'
#' Selects 10 test neurons (preferring proofread rows with super_class that
#' have not yet been processed) and runs them through phases 1-5: metrics,
#' morphology, cross-dataset NBLAST, NBLAST images, SeaTable push. Does
#' NOT run `banc-ids... |
3f11a432b796ce617a6fb8f571d7b616fa3e7d9deb7f50318365c0472ff67452 | R | 12,690 | 320 | #' banc-nblast-wrong-matches — Process `*_PNG_MATCH_WRONG` SeaTable flags into all artefacts.
#'
#' Invalidates bad matches in compiled feathers + reviewed CSVs + meta CSV,
#' removes PNGs, clears SeaTable flag. Must run BEFORE `banc-nblast-compile.R`.
#'
#' @section Reads:
#' - SeaTable `banc_meta`, compiled NBLAST ... |
12c30a6167d3d76c51fc0362fe37f9473577f583511587275418551965ea7bb2 | R | 12,704 | 144 | rm(list = ls()); tmp <- lapply(c('ggplot2','reshape2','gridExtra'),library,character.only=T)
setwd('/Users/wangz21/Library/CloudStorage/OneDrive-TheMountSinaiHospital/Huang_lab/manuscripts/ADASE/analysis/ASE_individual_analysis/ASE_Var_RegionVsChrBand')
# chromosome band information
ChrBand <- read.table('../../../dat... |
a6905bf21771443d17b2a16796ea3413768f1be5b0da21dc4fdfaebe5602abed | R | 12,711 | 224 | # function to visualize the differential spatial signaling scores (differential S3) using dotplot
# input: differential S3 from "FindDifferentialSpatialSignalingScore.R" function
# output: dotplot of normalized differential S3
VisualizeS3Dotplot<-function(metric_score,
size="p.adjust", # representa... |
9ef7063020672ecc92fb19daa9c505e43dd9743bc501d23f7ea0099fc7c15a94 | R | 12,718 | 280 | # ==============================================================================
# Single-Cell RNA-seq Analysis Pipeline for Aurelia
# Main Tasks:
# 1. Subset cell clusters
# 2. Cell stemness analysis (CytoTRACE2)
# 3. Lineage/trajectory inference (Slingshot, Monocle3)
# 4. Cross-species gene mapping & integration
# 5.... |
e239c6988cf25b7dbc89031a67c833c5a88aeab413a8008a8ac475a7f8e0ebbc | R | 12,738 | 266 | #' @title Sparse canonical correlations for symptom mapping
#'
#' @description
#' Multivariate SCCAN adapted for lesion to symptom mapping purposes.
#' By default an optimization routine is used to find the best
#' \code{sparseness} value. If you specify sparseness manually, it
#' will be validated to find the cross-va... |
fb51be9455648b30c5c9cecdb01e7716cb03e2cefb4c2e081bdf59d44106161a | R | 12,738 | 325 | #############################################################
###### File Name: LOAD_Harmonization_Script_20220601.R
###### DATE: 2022-06-01
###### Authors: Jeremy Pasteris (Gary Beecham, PI)
###### Purpose: This script is intended to transform data received from LOAD and delineate the exact ways
###### that its v... |
1945144c4030d30040e5d4fcad05c9e3b312c5b9ad546848e12fde2330c541df | R | 12,743 | 243 | #' banc-fanc-nblast — Pairwise BANC ↔ FANC (v1.116) NBLAST.
#'
#' VNC + ascending + descending + sensory + afferent + efferent neurons.
#' Resumable.
#'
#' @section Reads:
#' - SeaTable `banc_meta`, FANC BANC-space skeletons
#'
#' @section Writes:
#' - `<banc.nblast.fanc.save.path>/results/<ver>/<root_id>.csv`
#'
#... |
4770be3788b9a25e939b7d1689cabc6d591ab1dc434962c96423be4c7a0a5a46 | R | 12,816 | 255 | # ----------------------------------------------------------------
# The following script loads and processes data from:
#
# Franzosa, Eric A., et al. "Gut microbiome structure
# and metabolic activity in inflammatory bowel disease."
# Nature microbiology 4.2 (2019): 293-305.
#
# The output tables are:
# 1) metad... |
e2702ca449f7650dfe08a2a1b40c1e8c6e6bcedd61cc5a8bcbe8e3bd7d67198d | R | 12,819 | 377 | ## ----------------------------------------------------------------------------------------------------------------------------------
rm(list=ls())
library(ragg)
library(tidyverse)
library(data.table)
source('./Scripts/DESI_MSI/data_loader.R')
source('./Scripts/DESI_MSI/deconvolution_functions.R')
## ----------------... |
9bc9bd36d0775d9fab43d981574789db46ec3f99c193ac30a004fddcf09b9555 | R | 12,820 | 257 | library(circlize)
#library(plotROC)
library(viridis)
library(zoo)
library(dendextend)
library(tidyr)
library(ggpointdensity)
library(dplyr)
library(ggplot2)
library(RColorBrewer)
library(readr)
library(readxl)
library(here)
library(magrittr)
library(MetaNeighbor)
library(reshape2)
library(conflicted)
conflicts_prefer(d... |
04423707ec54ae6eb4d18703351f4d249b11a447acc8dfb5119d3cfe9fbf7e76 | R | 12,837 | 324 | add_info_infnt_factor <- function(sampler, prior = NULL, ...){
# Checking and default priors
args <- list(...)
max_factors <- args$n_factors
if(is.null(max_factors)) max_factors <- 10
attr(sampler, "max_factors") <- max_factors
sampler$prior <- get_prior_infnt_factor(prior, sum(!sampler$nuisance), sample =... |
6d41f00afe4c3c2f1938a72fb65c405ccae7091ffa21c5666e526bd1edb6e8f3 | R | 12,838 | 314 | # Load packages
library(tidyverse)
# Clear global environment
rm(list=ls())
setwd("/home/emba/Documents/EMBA/CentraXX")
# load raw data
# columns of Interest: internalStudyMemberID, name2, code, value, section, (valueIndex), numericValue
df = read_csv("EMOPRED_20250127.csv", show_col_types = F) %>%
select(internal... |
65b8a613f01c85f34865b2540da08941379bfd1cf855b452e752aea1981e3e83 | R | 12,839 | 311 | Sys.setenv(LANGUAGE = "en")
options(stringsAsFactors = FALSE)
###Package installation
install.packages("BiocManager")
install.packages("remotes")
library(remotes)
library(BiocManager)
install.packages("org.Mm.eg.db")
install.packages("ggplot2")
install.packages("vctrs")
install.packages("UpSetR")
install.packages("re... |
72f4d7586b6cf8c02649d0ba4a2369b26d4208178ddee42a63dee19c4dcdcf71 | R | 12,853 | 327 | #' Loading a barcode key
#'
#' @param fname The path of the file containing the barcode key. Please refer to the online documentation
#' for a description of the format
#'
#' @return Returns a data frame containing the barcode key
#'
#' @export
read_barcode_key <- function(fname) {
return(read.csv(fname, check.nam... |
00c6073aa8c1920a7d75f2ed30f728bd1ed80938d58a35af04fca7b6c1fe45a4 | R | 12,865 | 276 | ####差异分析以及功能富集--------------
####*每个细胞类型在海马体前后差异分析--------
scRNA <- readRDS(file = "./scRNA_anno_cluster.rds")
metadata <- scRNA@meta.data
##meta.data添加信息
group.id <- as.data.frame(metadata[,1])
rownames(group.id) <- rownames(metadata)
group.id$group <- t(as.data.frame(stringr::str_extract_all(group.id$`metadata[, 1]`,... |
c227b2fbe7dda97a74d9f1444c983f484ae8d198980be154f43627f3f9528d55 | R | 12,881 | 243 | ########################################################################################################
#### Trial dataset for this R script can be downloaded from ####
#### https://data.mendeley.com/datasets/454s2vw255/1/files/84daa43d-5ebc-463d-b006-f2ed347374d4 ####
##... |
353668f4847e72c19478a12eed2f5170ec1af7ae0966a2d760bd9bec3b18390b | R | 12,889 | 265 | library(ggplot2)
rm(list=ls())
options(digits = 4) # by default, print results to four decimal digits
set.seed(1823) #for replication - the year Trinity College was founded!
#replace the empty quotes with the file path to the location where you downloaded the files from Zenodo below
path = ""
chance = rep((1/6), time... |
3cad3e2ee31572e6b8c3b5e435a5edbe4cce88aac7fe1e26c6bf9136978cb4aa | R | 12,899 | 364 | ###############################################################################
## Complex V (ATP Synthase) Analysis: Direct Energy Crisis ##
###############################################################################
library(here)
library(ggplot2)
library(dplyr)
library(tidyr)
library(patchwork)
... |
f14d2c73887ff628b4eac7fb3dbe9c75b98a27381f02b85485b542508664f235 | R | 12,908 | 503 | #
# 15th April 2019
# risk factor selection for multivariable MR based on Bayes Factors
# computation is based on summary data which speeds up computation
#
# functions
# summarymvMR_SSS: main function
# summary_stochastic_search: shotgun stochastic search
# create_environment: create new environment to search
# ... |
dc7454f9ac534cdde709004303a74d4c901e01a674540682919e6b9dcf154301 | R | 12,955 | 365 | #################################################
## Cross-Validation Helper Functions
#################################################
#' Generate stratified fold IDs based on diagnosis
#' @param n_folds Number of folds
#' @param covariates Covariate data with Dx column
#' @return Vector of stratified fold as... |
bb75d97c5d79bd262fe1800fd26e97447b74f1424405bf62feb6b5e4726109ac | R | 12,961 | 356 |
#' Prepare and merge predicted and observed expression datasets
#' @param expr.predicted_df Dataframe containing predicted expression values
#' @param expr.observed_df Dataframe containing observed expression values
#' @return Merged dataframe with both predicted and observed values
prepare_datasets = function(ex... |
bd0a5009fd26dc4c56a498daae7c4040a1b7cb68643fd5b2a50972ffe28e1e80 | R | 12,990 | 384 | #' Plot spatial cell coordinates with cluster boundaries
#'
#' Plots spatial cell locations and overlays cluster or population boundaries
#' if available.
#' If `boundary` is not provided and `one_cluster` is specified, the boundary
#' will be automatically generated using the `GetBoundary()` function.
#' This function... |
5e5da2067e2f9035b2ea1dc42e8989939028c2bc0b7dbc88d610c73b37e9bfa2 | R | 13,008 | 391 | rm(list = ls())
library(dplyr)
library(plyr)
library(Seurat)
library(ggpubr)
library(reshape2)
library(tidyr)
library(tidyverse)
library(DropletQC)
source('~/SCRIPTS/utility_functions.R')
#####
## LOAD COUNT MATRIX
#####
# Only the putamen samples
allsamps = rio::import('~/workdir/TABLES/Primate_Tables_From_EmilyOh/C... |
1144bbdb6b49577b6a901b79c3a09da19612c9892b56d8cc5e59917575d04db4 | R | 13,017 | 261 | # ==============================================================================
# Script 18: Fig 3D & SupFig 9 - Circos Plots (OGM SV, CNV, Chromothripsis)
# ==============================================================================
# Description: Prepares data and generates interactive Circos plots per sample
# ... |
55c56fa900a3d5e03a2849a158def30d0c2f2ede73ce05d8da7164ba6459ec34 | R | 13,046 | 358 | # ============================================================
# Clinical Characteristics Table — Reviewer-Compliant Statistics
# Format: statistic(df) = value, p = value, d = value, 95% CI [low, high]
# Datasets: BOLD_clinicaldata.csv (RS-fMRI) and Diffusion_clinicaldata.csv (dMRI)
# ==================================... |
0c543ad8a321022cd2bbc3dad8ec10ea6ca343dd88eec6982e7d7523c1b9b640 | R | 13,049 | 315 | # # Step.00 ----------------------------------------------------------------------
rm(list = ls())
gc(reset = T)
source('script/Functions/Functions.R')
# unload packages
pkgs[which(load.packages == F)]
rpid = Sys.getpid()
options(future.globals.maxSize = 1000 * 1024^3)
##################################################... |
fb13af84ff812aac305b3bcc65011401aac92b1977df227f91d27e2f8b6ece7f | R | 13,059 | 546 | ---
title: "Check pseudo-bulk data and conduct DE analysis"
author: "Wei Sun"
date: "`r Sys.Date()`"
output:
html_document:
theme: journal
highlight: tango
toc: true
toc_depth: 3
toc_float:
collapsed: true
smooth_scroll: false
number_sections: false
df_print: paged
---
```{r set... |
e7a52cfbf2094f07339632f6533371594e031724a77d78064cdd8c2a403ff1eb | R | 13,064 | 349 | # Install necessary packages if they are not already installed
# install.packages(c("data.table", "ggplot2", "dplyr", "ggrepel"))
# Load libraries
library(data.table)
library(ggplot2)
library(dplyr)
library(ggrepel)
# --- single-variant level data ---
file_path <- "/Users/menezeslf/Library/CloudStorage/OneDrive-Natio... |
40676ba7c77e3aaae97dad6c9c3ce88287cf1684533f962237387defedad7047 | R | 13,069 | 301 | #first try is mouse ontology gene sets (GO)
#m5.all.v2024.1.Mm.symbols.gmt
#Clean environment
rm(list = ls(all.names = TRUE)) # will clear all objects including hidden objects
gc() # free up memory and report the memory usage
options(max.print = .Machine$integer.max, scipen = 999, stringsAsFactors = F, dplyr.s... |
93f572fc7949683c2f019f72343eb287767323f6d2418e21f6b64c3c0c48e454 | R | 13,086 | 229 | BHR <- function(mode = NULL,
trait1_sumstats = NULL,
trait2_sumstats = NULL,
annotations,
num_blocks = 100,
genomewide_correction = FALSE,
gwc_exclusion = NULL,
fixed_genes = NULL,
output_jack... |
bfc5245912b6b9272f5dc1e6c4ceb048846a2eca1e8941ef59d31725e2ceaa97 | R | 13,128 | 408 | library(Seurat)
library(Matrix)
library(ggplot2)
library(plyr)
library(tidyverse)
library(tidyr)
library(dplyr)
library(ggpubr)
library(reshape2)
library(rio)
library(data.table)
library(harmony)
library(GeneOverlap)
library(readr)
library(DropletQC)
library(xlsx)
library(biomaRt)
source('~/SCRIPTS/utility_functions.R'... |
2bb61d4428022f70fe672f3ee2be8ab86a7a3f672d4271e35f1c1cb99eb68d40 | R | 13,196 | 401 | library(scales)
library(dplyr)
library(TissueEnrich)
library(dplyr)
library(ggplot2)
library(igraph)
library(viridis)
library(RColorBrewer)
#################################################Co methylation patterns
library(tidygraph)
library(ggraph)
library(viridis)
library(RColorBrewer)
library(scales)
lib... |
70e9b51e381b762e42c75d8a6107426c2a461a8af03ec0c06134f0a5f8c424a8 | R | 13,197 | 373 | # grid_analysis.R
# Analysis script for Kransberg et al. (2025) - GLS fMRI Study
# Author: Jonas Kransberg
# Date last modified: 02.05.2025
# Author contact information: jonas.kransberg@psykologi.uio.no
# 0. Load required libraries
library(tidyverse)
library(lmerTest)
# 1. Generate dummy data
set.seed(123)
# 1.1 Crea... |
090143b52a9eb4f0d44c2eee4752deccd889986d31a68c4aff63ec92fe3346ae | R | 13,203 | 452 | ---
#title: "Post-hoc ANOVA test Peritumoral area"
#author: "Mona Zimmermann"
#date: ""
#output: html_document
#### Email: m.l.m.zimmermann@amsterdamumc.nl
#### Purpose of script: Statistical analysis for the post hoc test of clinical
#### relevance in activity changes for the peritumoral area
#### Status:... |
0e3071c381e0f8dc1a324741550f32d3d61630a2cd8faa18adbd8eb47748fef8 | R | 13,205 | 341 | # Summarized topics with SNPs info (to one table or visualization)
library(ComplexHeatmap)
library(dplyr)
library(ggplot2)
library(data.table)
library(colorRamp2)
library(ggplotify)
library(patchwork)
library(gridExtra)
outp <- "/geschwindlabshares/RexachGroup/Xia_Data/atac_cellrangerOut/project0318/cisTopic"
add <- ... |
ed0294c7a550093df8d66a3b61142bbf7ff49c57f26e14f2c34df7b22c4b7985 | R | 13,209 | 412 | # helper functions as in the netzooPy impl
# def Scale(X):
# X_temp = X
# X_std = np.std(X_temp, axis=0)
# X_mean = np.mean(X_temp, axis=0)
# return (X_temp - X_mean) / X_std
scale = function(x,bias=FALSE)
{
# sd does 1/(n-1), python does 1/n
# use the bias option for exact match with python
n = length(... |
437e87afcec0a5a88b9ef56876a2b7b5e15403bcf7da0937385a8d36448fab6f | R | 13,217 | 300 | # script to get the average of the spearman rhos of each Factor# vs AGE. Then to compare against GDF15 vs Age, CHOP, ATF4, and others.
#This code currently gets the log2 TMM expression of GDF15, then centers and scales it, and then compared the pc2 score (which also gets centerd and scaled) for each tissue
# Uncommen... |
99e2aeddd93525a21111c69ba40c82674d93783987eafed9e2f19c3f0536eb3e | R | 13,239 | 282 | # Load libraries
library(fafbseg)
library(tidyverse)
library(readr)
library(catmaid)
# Use repo-root paths so the script runs anywhere the repo is cloned.
repo_root <- tryCatch(
rprojroot::find_rstudio_root_file(),
error = function(e) here::here())
gt_path <- file.path(repo_root, "gt_np_data.csv")
extra_path <-... |
10d2343a43763c223c374ef1bfb2cb4b502437257c58e8033ad040abcffc298a | R | 13,252 | 319 | #' banc-tracing-png-tags — Add tracing-issue tags driven by PNG review outputs.
#'
#' Walks the per-neuron PNG review folders, extracts root_ids / supervoxel_ids
#' from filenames, and applies tracing-issue tags + emits Neuroglancer links
#' for problem neurons.
#'
#' @section Reads:
#' - PNG match folders under `<ba... |
49c650679ff964da9f5a2b3d3c56806fb1ccf8dcef3e4719cb24a69086db4b73 | R | 13,274 | 258 | here::i_am("scripts/4.paper_figures_and_tables/suppl.figureS3.R")
library(tidyverse)
library(here)
library(patchwork)
library(ggpubr)
library(ggraph)
library(igraph)
library(cowplot)
source(here("scripts/4.paper_figures_and_tables/helper_functions.R"))
## Module overlap network plots (initial & random) ------------... |
b2105d61c44c7ef12576699fd7b0891744bf606a89dbbae4eb685a6a01f28191 | R | 13,284 | 318 | #' banc-nblast-cave — Sync compiled NBLAST match feathers to CAVE `cell_match` tables.
#'
#' Runs after `banc-nblast-compile.R`; deletes stale annotations (neurons
#' re-segmented since NBLAST) and uploads fresh ones.
#'
#' @section Reads:
#' - per-dataset compiled NBLAST feathers, CAVE `cell_match` tables
#'
#' @sec... |
b1c6dfc693dfabdbe20c84eb1790bab253c15af18a38a3acd9de7d56bdc964a3 | R | 13,287 | 187 | context("test-urls")
# utils::URLencode has subtle differences from curl
ngurl="https://neuroglancer-demo.appspot.com/#!%7B%22layers%22:[%7B%22source%22:%22brainmaps://772153499790:fafb_v14:fafb14_4nm_split4x_fill2:ffnreseg_whitened_16nm_32nm_4nm%22,%22type%22:%22segmentation%22,%22segments%22:[%220%22,%223140809165%2... |
35376dfb9a40d3a5b3fe3627d089fda647e8edca5d96bb54bfb5147fa3050c04 | R | 13,296 | 387 | ####################################################################
# Peak and Feature Matrix Methods
####################################################################
#' Add a feature matrix to an ArchRProject or a set of ArrowFiles
#'
#' This function for each sample will independently compute counts for each f... |
ee2bd5abc2fe477b3123f4156a2d138369b7c8f1f3d1011ca96ccef5722f050a | R | 13,324 | 353 | # =========================== #
# TSprom modular pipeline #
# =========================== #
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager", repos = "https://cloud.r-project.org")
BiocManager::install(c("GenomicRanges", "IRanges", "Biostrings",
"BSgen... |
620b3d8049f5d4e0b5ac30bd25d4c8a90c70299cf44837f16a207a8441bf8ba9 | R | 13,325 | 361 | #!/usr/bin/env Rscript
##############################################
# Manoj M Wagle (USydney, MIT CSAIL)
##############################################
args <- commandArgs(trailingOnly = TRUE)
train_file <- args[1]
test_file <- if (length(args) >= 2 && args[2] != "None") args[2] else NULL
cell_type_label <- arg... |
61cd0938fe7b9f61713eeccca06516fede96a2e93474e21ff040976ee877444a | R | 13,336 | 313 | smooth_beads <- function(beads.data, window.size = 201) {
ret <- apply(beads.data, 2, runmed, k = window.size)
return(ret)
}
compute_bead_slopes <- function(beads.data, baseline, beads.col.names) {
beads.data <- beads.data[, beads.col.names]
baseline <- baseline[beads.col.names]
stopifnot(length(... |
675b8790094c5961bdd5c9c6a1bb5b58bb9f53bea0c783eaef017189587f68b3 | R | 13,345 | 396 | rm(list = ls())
library(dplyr)
library(plyr)
library(Seurat)
library(ggpubr)
library(reshape2)
library(tidyr)
library(tidyverse)
library(DropletQC)
source('~/SCRIPTS/utility_functions.R')
#####
## LOAD COUNT MATRIX
#####
# Only the caudate samples
allsamps = rio::import('~/workdir/TABLES/Primate_Tables_From_EmilyOh/C... |
8177507c38f9c5fd140a6c75d8810f2f80765331adc9aae2b4b45d223c5b7c28 | R | 13,363 | 412 | ---
title: "Sample_Import_Preprocessing after cellbender and scrublet"
output: html_document
date: "2024-12-24"
---
Import and process myelin-depleted and control mechanically dissociated single cell 5' gene expression sequenced GBM samples. Input is cellbender output with fpr 0.0. This does not automatically filter a... |
46165f80080d849c58a6fd82e21eed6cf2f2853fec08838d90c61588e8837c2d | R | 13,373 | 347 | library(fafbseg)
library(httptest)
#set the mocker to re-route..
set_requester(function (request) {
gsub_request(request, "https://globalv1.flywire-daf.com/", "api/")
})
test_that("FlyWire->FAFB works", {
# identified location in FAFB14
p.fafb.nm <- cbind(477042, 284535, 90680)
p.fafb.raw <- p.fafb.nm/c(4... |
2bb868a1499a23f7858f27ee186b802ece44598976e5f0dee524153654ffcfd8 | R | 13,375 | 278 | ##################################
# Visualize the cell type abundance frequency across tumor types and time points
# Author: Kevin Johnson
##################################
library(tidyverse)
library(RColorBrewer)
library(viridis)
library(ggpubr)
library(EnvStats)
proj_dir <- "/vast/palmer/pi/verhaak/kcj28/care_... |
55fcae2e7337daf5533770085ae3e8c9e8575ca81c16b62e2a95403f09667c31 | R | 13,393 | 296 | #####################################################################
# Network Training Pipeline
#####################################################################
# This script processes the coeQTL results to train network models
# It performs the following steps:
# 1. Loads module/network-specific coeQTL res... |
eeb1c1b2fa396bef0655c7eb6dc78e2816d30bb834f3eb76f63eefa0328d3f85 | R | 13,401 | 300 | here::i_am("scripts/4.paper_figures_and_tables/suppl.figureS12_S13.R")
library(tidyverse)
library(plyranges)
library(data.table)
library(Gviz)
library(cowplot)
library(patchwork)
library(rtracklayer)
library(scales)
wd <- here("data/validations/POU5F1_LTR7_enrichment/")
fig_dir <- here("data/paper_figures_and_tables/... |
f4f905edbf1be6241a63c7e1e49dacadc0e1822206dd7aede96462a2853c532e | R | 13,414 | 337 | #!/usr/bin/env Rscript
#' fafb-sjcabs — Assemble + publish the FAFB v783 SJCABS-style data bundle.
#'
#' Pulls FAFB v783 metadata, edgelist, NBLAST scores and synapse / skeleton
#' artefacts; aggregates into a per-version SQLite + companion feathers
#' under save.path; then rsyncs to the lab GCS bucket
#' (`compiled_d... |
b596e8a6899abbf65d2d6848e48ea080d7bb769b3a59b4b0a9c11c6f37debe84 | R | 13,417 | 405 | ########################################################################################################
# Helpers for Nice Heatmap with Bioconductors ComplexHeamtap
########################################################################################################
#' Plot Nice Lookng Heatmap Using Complex Heatmap... |
1dd9840509fec6770b6cec0f01aeafb7a9007c4538f3ac2802eefb7d3344dd20 | R | 13,429 | 253 | #' banc-hemibrain-nblast — Pairwise BANC ↔ hemibrain (v1.2.1) NBLAST (native + mirrored).
#'
#' Non-VNC BANC neurons only. Resumable.
#'
#' @section Reads:
#' - SeaTable `banc_meta`, hemibrain BANC-space skeletons
#'
#' @section Writes:
#' - `<banc.nblast.hemibrain.save.path>/results_with_mirrored/<ver>/<root_id>.c... |
0f8f33e673547af672d257c96d286624367fc65a77d389554e64f1f1e5d264e9 | R | 13,432 | 428 | ---
title: "Sepia officinalis bulk RNA-seq analysis using DESeq2"
author: "Simone Rencken"
date: "`r doc_date()`"
output:
BiocStyle::html_document:
toc: true
toc_float: true
highlight: tango
code_folding: show
BiocStyle::pdf_document:
toc: true
highlight: tango
-... |
35ab79f5a45987933a2ab7d2364c4785b9dc6744f3561cc8032117fc8ea9680a | R | 13,437 | 310 | # =============================================================================
# 05_run_sPLS.R
# Sparse Partial Least Squares (sPLS) for brain connectivity vs. biomarkers
# =============================================================================
#
# Methods (multivariate modeling):
# - Separate sPLS regressions... |
7c4f739b88d2d719df757418273ef2da69d64cbcccd073dea3a4c7799f0a9364 | R | 13,442 | 339 | ##################
### BUILD BANC ###
##################
source("banc/banc-startup.R")
# Helper functions
extract_three_letters <- function(text) {
sapply(text, function(t) {
three_letters <- stringr::str_extract(t, "^[A-Za-z]{3}")
if (!is.na(three_letters)) {
return(three_letters)
}
two_letter... |
b196d65bf30a18241c191592a4f2cb4aa8a731344f3e0c0e10ef998218491773 | R | 13,471 | 393 | minimal_design <- function(design, covariates = NULL, drop_subjects = TRUE,
n_trials = 1, add_acc = TRUE, drop_R = TRUE,
drop_R_levels = TRUE, do_functions = TRUE,
group_design = NULL, ...) {
dots <- add_defaults(list(...), verbose = TRU... |
92eec7652d8c7f5c341995d72eba7b49bc53b94f8d29be6c9029046b4aa0c90f | R | 13,490 | 285 | ##############################################################################
# Analysis Script for the TUE008 Ghrelin Depression Study
# Author: Corinna Schulz, corinna.schulz96@googlemail.com
# Created: March 2023
# This script analyses anhedonia and its association with metabolic parametes
# Plots SHAPS against ... |
f3e0fbfe53ec7a6ebbf5c98298ff3f8f10498e9015f3e4f06e0f7368fafb7448 | R | 13,514 | 372 | ---
title: "DNAm × pTau Interaction: Plots & Summaries (MCI)"
author: LW
date: "`r format(Sys.time(), '%Y-%m-%d %H:%M %Z')`"
output:
html_document:
toc: true
toc_float: true
number_sections: false
params:
base_dir: "C:/Users/lxw391/Lily Wang/AD_CR"
pheno_rel: "analysis_results/only_amyloid... |
6ff015282d517cd98fbe4793f791de530b86126d278baa0c2f097fea421dca03 | R | 13,521 | 403 | library(tidyverse)
library(psych)
library(ggplot2)
library(ggpattern)
library(patchwork)
library(viridis)
subj <- c('sub-101','sub-103','sub-104','sub-105')
lss <- read_delim("C:/Users/mmatt/Desktop/Projects/NightOwls/night-owls/derivatives/extractions/extractions_LSS_smoothed.tsv",
deli... |
d76873097f05357a05138034fa47f1403d158cc5a50f24ab89e502fd86894544 | R | 13,521 | 427 | ---
title: "DNArepair"
author: "Thomas Boutet"
date: "11/3/2025"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r boxplots of Foldchanges}
###################################################
# LOAD LIBRARIES
###################################################
library... |
3dee6708c55499168bfde20a373c3c41d698c0c3fbb13c83032bf47d185676d4 | R | 13,525 | 204 | ####################################################################
####### Ensembl data import and preprocessing ##########################
####################################################################
Ensembl_data = read.delim('Final_search_results.csv', sep=',', header = TRUE) # data import
head(Ensemb... |
395633306171a73d09e73e39e71ebb35456661830ceedaa30bcaab8212bb451b | R | 13,541 | 389 | ---
title: "Spectral Analysis"
author: "Dr Emily Stanyer"
date: "`r Sys.Date()`"
output:
html_document:
toc: true
df_print: paged
pdf_document:
toc: true
number_sections: true
params:
profile_dir: "Data/raw/EEG/PSD/" # spectral output from spisop .csv files
blinding_file: "Data/raw/EEG/blindi... |
4516545ac8317b3c791a255e84d1d3b4f6218eedbad0be734b0bf449e5b0fa2f | R | 13,560 | 358 | # prep data and pseudo-cells if needed
data_prep <- function(sobj,
subpop_name = NULL,
max_features = 10000,
pseudocell_embedding_nhvgs = 2000,
pseudocell_embedding_npcs = 50,
pseudocell_embedding_batchname = N... |
b491af6eaf0d0a5baaa744e7c0417ae32d736919e1b0537589f8c683743e584a | R | 13,570 | 348 | #' Run the spatialLIBD Shiny Application
#'
#' This function runs the shiny application that allows users to interact
#' with the Visium spatial transcriptomics data from LIBD (by default) or
#' any other data that you have shaped according to our object structure.
#'
#' If you don't have the pseudo-bulked analysis res... |
93f17ac8e1e202af926db7660f60ee183992346721361f3e366560d77738afc7 | R | 13,581 | 389 | ---
title: "ClusterProfiler_CP_circadian"
output: html_document
date: "2024-01-10"
editor_options:
chunk_output_type: console
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
setwd("/Users/deidrejansson/Library/Mobile Documents/com~apple~CloudDocs/Documents/Iliff lab /Experiments/CP circadian proj... |
2fd2d3d8b0d371dfd8f0a98b6a77d292cf78727e6ce7d9004fc0b764c5acb3f3 | R | 13,597 | 299 | ##################################
# Malignant cell state proportion associations with overall survival and post-recurrence survival
# Author: Kevin Johnson
# Date Updated: 2026.04.04
##################################
library(tidyverse) # 2.0.0
library(ggpubr) # 0.6.0
library(EnvStats) # 2.8.0
library(survival) # 3.5... |
15804e00dbec6cec54a4b557bee08784817d304c160aa2c0c76be966110235db | R | 13,614 | 339 | #' Login to MANC neuprint server
#'
#' @param server A neuprint server (a sensible default should be chosen)
#' @param dataset A neuprint dataset (a sensible default should be chosen based
#' on which dataset has been specified for Clio/DVID)
#' @param token neuprint authorisation token obtained e.g. from
#' neupri... |
c67b21864a62c5bcfa7a110b2a57e695d3bce558de1e88cf70dd74986b554346 | R | 13,665 | 572 | ---
title: "Check pseudo-bulk data and conduct DE analysis"
author: "Wei Sun"
date: "`r Sys.Date()`"
output:
html_document:
theme: journal
highlight: tango
toc: true
toc_depth: 3
toc_float:
collapsed: true
smooth_scroll: false
number_sections: false
df_print: paged
---
```{r set... |
3fd9819094c78f268bd2acddcb06199dbf864fda389275f2b5136bdb531da1aa | R | 13,669 | 366 | #' banc-calculate-synapses — Per-neuron synapse / mitochondria metrics.
#'
#' For each `root_888` neuron: if a split CSV exists (from
#' `banc-calculate-split.R`), use it (includes axon/dendrite compartment
#' labels); otherwise extract from the v888 synapse parquet. Tracks
#' `source` ("split" or "table") so re-runs a... |
b9d74ad3edc9aac2ab4a0233c423ab1db43c8400df2a352f841858f186c815c6 | R | 13,675 | 342 | ##---- Identify modules based on Pattern of chromatin accessibility of (CREs contain SNPs) across subtypes/ subC-dx
##|a. Extract Peak Accessibility per pseudobulk (two versions: subC level and subC-dx level) from MACS callpeaks output
##|b. Depth normalization and log2-transofrm for each pseudobulk, then quantile norm... |
b9d28d75615c90a3e7b700e5e41b047252bf8ae252d69f6aa81f66de0f7fabc4 | R | 13,678 | 295 | library(ggplot2)
library(data.table)
library(matrixStats)
library(magrittr)
library(dplyr)
library(tidyr)
library(here)
library(readr)
library(conflicted)
conflicts_prefer(base::setdiff)
conflicts_prefer(base::intersect)
conflicts_prefer(dplyr::filter)
conflicts_prefer(dplyr::rename)
conflicts_prefer(dplyr::count)
#wa... |
eabf653aa799707c3629e31c6221e11b308070ee9ab0154ee0e973c2529905dc | R | 13,685 | 233 |
BHR_rg <- function(trait1_sumstats,
trait2_sumstats,
annotations,
num_blocks = 100,
genomewide_correction = TRUE,
overdispersion,
num_null_conditions = 0,
use_null_conditions_rg = FA... |
b00507b36cbe6947cbd7949b25550ed404eebb3a14db116084b85e8a13440b6a | R | 13,686 | 366 | #' banc-kc-by-connectivity — Name Kenyon cells by connectivity to known DANs / MBONs.
#'
#' Picks the dominant DAN/MBON subtype group (αβ / α'β' / γ) per KC, assigns
#' ASCII-safe names (`KCab` / `KCa'b'` / `KCg` / `KC`). Existing more-specific
#' cell_types are preserved.
#'
#' @section Reads:
#' - SeaTable `banc_me... |
f66a82b7bd44f939faed575d6075a71d827f78d11186cdea440b4a43979347a0 | R | 13,711 | 327 | #IMPORTANT INFORMATION BEFORE STARTING
#.bam and .bai files should have the same name and should have identical paths as this .R file
#This script exports 4 different results in pzfx (Graphpad/Prism), xlsx (Excel) and csv files (lines 170-177, lines 314-315)
#You can choose 1 preferred file type by adding '#' before ... |
679106bcf4e8aa8d52286669fe748f4e0c2898ce56380f2324c24059daa2013c | R | 13,719 | 365 | Libraries
```{r}
library(data.table)
library(psych)
library(GPArotation)
library(corpcor)
library(EFAtools)
library(lavaan)
library(lavaanPlot)
library(esemComp)
library(ggplot2)
```
Set working directory
```{r}
setwd('/media/hcs-sci-psy-narun/IBu/UK_BB/brainbody/cognition/folds/')
```
Upload train and test sets gene... |
8e1feab4a6b1e7364f949c938e03df00c3b6a17245560204b7df79e20b9cbe4a | R | 13,863 | 311 | #' Selection Operator for Jointly analyzing multiple variants (SOJO)
#'
#' This function computes penalized Selection Operator for JOintly analyzing multiple variants (SOJO) within a mapped locus,
#' based on LASSO regression derived from GWAS summary statistics.
#'
#' @param sum.stat.discovery A data frame includi... |
ad40f3d5ff345a1b58f71f961ac7880c267c02336c6560be879586d4344ca08d | R | 13,877 | 330 | #Rscript /media/StorageOne/HTS/VirusMeta/SAM_BAM/ttv_positivity_OR.R '/media/StorageOne/HTS/VirusMeta' '/media/StorageOne/HTS/Projects/2011_G5_96ALL-HiSeq' '/media/StorageOne/HTS/Projects/2011_G5_96ALL-HiSeq/NR/nr_by_index.csv' '/media/StorageOne/HTS/Projects/2011_G5_96ALL-HiSeq/aggregated_dir/self_blast_tmp/80.CLUSTER... |
466b7c0b7cc6454009a47a3eee6051688c1fb7d03b1fccf279021110d7323d5a | R | 13,904 | 238 | #' Calculate tree statistics across all modules
#'
#' Calculates various tree statistics (total tree length, within-species diversity, diversity, monophyleticity and subtree length of each species) for all modules/jackknifed module versions based on a list of tree representations.
#'
#' As part of the CroCoNet approach... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.