sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
f77f6d2c5f7ebc2630b5190f7e93c5ee2e0967c7aa56d566e20c4b70364f81bc | R | 5,273 | 131 | library(patchwork)
library(ggplot2)
library(dplyr)
library(arrow)
library(edgeR)
library(tidyr)
library(readxl)
library(ggtext)
library(ggpubr)
library(rtracklayer)
library(readr)
library(purrr)
my_theme <- theme_classic() +
theme(
axis.title.x = element_blank(),
axis.title.y = element_text(size = ... |
6788b47cfd8ecc7adad4d1b8e51c89b7e0baed2af8771a88848f546ae35f5add | R | 5,304 | 206 | ---
title: "Visualizing the beat-side expression across ORNs based on the single-cell/nucleus RNAseq data"
output: html_notebook
---
# Load the packages.
```{r}
library(tidyverse)
library(magrittr)
library(RColorBrewer)
library(ggridges) #for geom_density_ridges function
```
# Prepare the dataset.
```{r}
counts ... |
847b8823c40b19f4b25e6aff377085d7e058c9faa5f7a6f63b78fd44ab73c7b4 | R | 5,306 | 125 | # brain-maintenance-lgcm: trivariate latent growth curve model and brain
# maintenance index, companion code for Menze et al. (2026).
#
# Copyright (C) 2026 The authors of Menze et al. (2026).
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License... |
cacf83620b065e1c7d7359f64dc10b5c6e0d8be6f01b5008cf9667eae1b7b79c | R | 5,316 | 84 | #!/usr/bin/env Rscript
# =============================================================================
# run_all_methylation_combat.R — ALL methylation datasets, batch-corrected
# M-value sources:
# • 6 IDAT datasets (minfi preprocessIllumina): IDAT6_Preprocessed/Combined_..._Strict_M.csv
# • GSE106648 (beta-... |
8c5db37fcea4f40c81cd6f24ae5409cf8d4a8289cba2d197197eff08cfbe3ed7 | R | 5,323 | 205 | #!/usr/bin/env Rscript
# Author_and_contribution: Niklas Mueller-Boetticher; created script
suppressPackageStartupMessages({
library(optparse)
library(jsonlite)
})
option_list <- list(
make_option(
c("-c", "--coordinates"),
type = "character", default = NULL,
help = "Path to coordinates (as tsv)."
... |
9ebcfc41e634d207a4962206c91f6f567929f7ddf08195ea6744cd2bc7a7111b | R | 5,333 | 100 | ---
title: "SCENIC for Gene Regulatory Networks Analysis"
author: "Yichao Hua"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{SCENIC for Gene Regulatory Networks Analysis}
%\VignetteEngine{knitr::rmarkdown}
\usepackage[utf8]{inputenc}
---
## Table of Contents
1. [Import... |
4cd1f056425f725d9cab6a449e5192de132165454128192b3f7b8b919832d699 | R | 5,336 | 159 | # scripts/00_setup.R
# Shared setup for all analysis .Rmd files (packages, paths, metadata)
# Increase memory limit for parallel processing (future)
options(future.globals.maxSize = 4000 * 1024^2)
# ---------------------------
# Reproducibility + options
# ---------------------------
set.seed(42)
options(stringsAsFac... |
01477c898d0650be232565ce842624d5162a9b9e1a788c7b989824790ac5ec57 | R | 5,344 | 100 | #!/usr/bin/env Rscript
# Literature-standard pseudobulk differential-state analysis (Crowell/muscat; Squair 2021),
# following the canonical decision scheme:
# 1. cells clustered/annotated in a common space -> the study's own published annotation
# 2. SUM raw integer UMI counts per sample x cell type
# 3. separa... |
49d562da5654fe16aff8e5e2c8614d17b72ded7e5ede6f1c8e1f9dc320131e6c | R | 5,391 | 181 | library(ggtranscript)
library(rtracklayer)
library(readr)
library(tidyr)
library(stringr)
library(ggtranscript)
library(ggplot2)
library(readxl)
library(dplyr)
gene_of_interest <- "KCNQ2"
# Get variant info based on the gene of interest
variants_of_interest <- read_tsv("data/All_variants_used_in_project.tsv") %>%
... |
8de59045cd15e5256909a1e3fdea2b7497264d09a107a0af98ca54617b205332 | R | 5,454 | 149 | ############################################################
# Compare CCA Mode Scores Across Different Models
# Author: Yuan Zhang
# Date: 2026-03-24
#
# Description:
# This script loads canonical variate scores (U, V) from
# multiple CCA models (math and reading) for the CMI cohort,
# including:
# - Original models... |
f6439f6f2d2a1935a276fc797084cc3bbcdf29b0060a144cefc17f05007d0d74 | R | 5,501 | 143 | package_data <- list(
"loomR" = list(
website = "https://github.com/mojaveazure/loomR",
tutorial = "https://satijalab.org/loomR/loomR_tutorial.html",
install_info = 'install.packages("hdf5r")\nremotes::install_github(repo = "mojaveazure/loomR")',
install = function(){
remotes::install_github(rep... |
6f18d1d2e88b55252ac64b7f817b0d16c7166fa55651fe4621355ded5308ee91 | R | 5,507 | 150 | # CSF_cfDNA_size_analysis.R
# this file is meant to be used inside Rstudio
# this file takes a flat table of insert sizes for each read from a bam file, and plots nucleosome ratios and size distribution of the CSF samples
library(data.table)
library(dplyr)
library(ggplot2)
library(tidyverse)
# read in length files
... |
6b081433b995e1bd95cb8ae7d54bfd49e5d70bfb7c6bcd51a92eaa960a022c32 | R | 5,534 | 110 | setwd("/groups/stark/shenzhi.chen/projects/transferLearningMammalianEnhancerDesign202408/")
# load library
devtools::load_all("/groups/stark/vloubiere/vlite/")
# Import
for(tiss in c("heart","limb","midbrain")){
# Import evo design and genomic sets
act.acc <- readRDS(paste0("Rdata/motifs_enrichment_analysis/tw... |
a82ba7499a586e188734f2b933e808a186fac270bce09192b21334654b2ba68e | R | 5,549 | 161 | library(dplyr)
library(tidyr)
library(readr)
library(stringr)
library(purrr)
library(arrow)
library(ggvenn)
# Assuming you have a read_gtf function available in R
# Define functions
read_gtf <- function(file, attributes = c("transcript_id"), keep_attributes = TRUE) {
library(readr)
library(dplyr)
library(... |
5dbf1be69dca9606ed9feccd2e41a51caa92de639e84eee50b1c1a73b7d44ec7 | R | 5,575 | 190 | #' @include GeneSetAnalysis.R
#'
NULL
#' @rdname GeneSetAnalysis
#' @export
GeneSetAnalysisReactome <- function(
seu = NULL,
parent = "All", spe = getOption("spe"),
ratio = 0.4, n.min = 1, n.max = Inf, only.end.terms = F,
slot = "counts", assay = "RNA", nCores = 1,
aucMaxRank = NULL,
title = N... |
533d1116d167749e2a8516530ae2e169b8df96bf40173ad52b26eed1ee22cb14 | R | 5,595 | 223 | ---
title: "R Notebook"
output: html_notebook
---
Update on ROC_9models.Rmd to improve plots and get CI information.
```{r}
library(tidyverse)
library(plotly)
library(pROC)
source("rocFunctions.R")
```
Notation for the following:
M1 = genotype model
M2 = behavior model (-gt)
M3 = behavior model + gt
A = without ... |
f9adcd37ec858f4d7e3431393c9be9b3ec374192716c5265abd0c98223e466d3 | R | 5,611 | 100 | segregation_by_type_eqcont <- function(M=NULL, Ci=NULL, C_Type=NULL, diagzero=TRUE, negzero=TRUE) {
# DESCRIPTION:
# Calculate versions of system segregation based on system-type (e.g.,
# average segregation of systems of a certain 'type' to systems of any
# type, from other systems of the same 'type,' and fr... |
47c27598b70584991137223b2ac537c364adab34dd8bbf8e19de3d0538ba07c8 | R | 5,615 | 186 | library(ggplot2)
library(ggtranscript)
library(dplyr)
library(shiny)
library(bslib)
library(patchwork)
library(dplyr)
my_theme <- theme_bw() + theme(
panel.grid.minor = element_blank(),
axis.text.x = element_text(size = 14),
axis.title.y = element_blank(),
strip.text.y = element_text(size = 14),
axis.text.y ... |
8559cfb6ac53b6bbf4d05d14978c396abb916a4c02efe0bd061a92c4f879b347 | R | 5,641 | 135 | ##Ext. Data. Fig 5b
#coexpression of Lepr, Adrb2, Glut1
library(tidyverse)
library(Seurat)
library(patchwork)
##Load integrated data using relative path
data_path <- "data/ganglia_seurat_object.rds"
if (!file.exists(data_path)) {
stop("Seurat object not found. Please check data/README.md for download instructions.... |
2103d15820a393259bf4760ab19d79ae5347090bd5007fe7add3d27d2d679301 | R | 5,642 | 120 | # =============================================================================
# 02_survival_lasso_cox.R
# Survival analysis of the NPY panel in TCGA-GBMLGG (Methods 4.4)
#
# Analytic cohort: n = 311 patients with complete OS metadata and passing QC
# (RIN >= 6, IDH annotated, primary tumors only; recurrent/secondar... |
616f8fd81924927d6fc6a71970e0d4744e37a80c6478b862eb99ea49ab0fe35c | R | 5,671 | 209 | #!/usr/bin/env Rscript
# Author_and_contribution: Niklas Mueller-Boetticher; created template
# Author_and_contribution: Søren Helweg Dam; implemented method
suppressPackageStartupMessages({
library(optparse)
library(jsonlite)
library(MERINGUE)
})
# Get script path
initial_options <- commandArgs(trailingO... |
4319e6598062f197d1976e30a678cba19bc20874236462304fe76ebece7e6aa4 | R | 5,707 | 153 | library(dplyr)
library(ggplot2)
library(arrow)
library(scales)
library(patchwork)
colorVector <- c(
"FSM" = "#009E73",
"ISM" = "#0072B2",
"NIC" = "#D55E00",
"NNC" = "#E69F00",
"Other" = "#000000"
)
structural_category_labels <- c(
"full-splice_match" = "FSM",
"incomplete-splice_matc... |
4fd5a3bf1a33b380eb7ea47c7209a481049252e48eebe44d42ab9d11e974c308 | R | 5,714 | 156 | #' @title GSEA plot
#' @description Generate plot that mimic the Gene Set Enrichment computational analysis
#' published by the Broad Institute
#' @param seu Seurat object
#' @param group.by A variable name in meta.data to
#' group the violin plots by, or string with the same length of cells
#' @param geneset A list of... |
19fb9666d25a78f0e6a9789081fbf1891eae59a0098ba37c483e3d223fa06e1b | R | 5,747 | 181 | # We should be able to reproduce identical plots by setting the random seed.
#
# ggplot(...) + geom_text_repel(..., seed = 1)
#
context("seed")
library(grid)
pos_df <- function(pos) {
data.frame(
x = sapply(pos, function(x) {
convertWidth(x[["x"]], "native")
}),
y = sapply(pos, function(x) {
... |
c02059f1c982daaf927030405d4674b984c90e27bf827ba363f8283c809b6688 | R | 5,758 | 97 | #!/usr/bin/env Rscript
# Donor-level pseudobulk for the brain (Jaekel) and CSF/blood (Beltran) cohorts, processed the same
# way as the Kaufmann cohort so all three are comparable.
# Jaekel : SUM of raw integer UMI counts per patient x cell type -> edgeR-QL and limma-voom
# (4 MS / 5 HC patients; region bl... |
5e2b0b1121e1949535a4d862d4e753e0a5f8c6a9787eb08e088c0df88cc0a7fa | R | 5,761 | 105 | segregation_by_type_prcont <- function(M=NULL, Ci=NULL, C_Type=NULL, diagzero=TRUE, negzero=TRUE) {
# DESCRIPTION:
# Calculate versions of system segregation based on system-type (e.g.,
# average segregation of systems of a certain 'type' to systems of any
# type, from other systems of the same 'type,' and fr... |
fa8ef7c3f9e86f6035953da20eab4190900ecde64fadeffd06c7554e1ec3f97f | R | 5,785 | 153 | ---
title: "Related work"
author: "Kamil Slowikowski"
date: "`r Sys.Date()`"
---
## R
### [ggforce]
> Annotation is important for storytelling, and ggforce provides a family of
> geoms that makes it easy to draw attention to, and describe, features of the
> plot. They all work in the same way, but differ in the way ... |
49347a9723c7afaa8667f4ee26d4d6052ef572ec175db8d30927d63e55bec292 | R | 5,792 | 208 | #!/usr/bin/env Rscript
# Author_and_contribution: Niklas Mueller-Boetticher; created template
# Author_and_contribution: Søren Helweg Dam; implemented method
suppressPackageStartupMessages({
library(optparse)
library(jsonlite)
library(SingleCellExperiment)
library(scuttle)
library(scran)
libra... |
953a0112d1fd475b820e025cd41a9826aecbf27eaa30062aa9655c17a771827a | R | 5,803 | 160 | ############################################################
# Canonical Correlation Analysis (CCA) - CMI Cohort
# Author: Yuan Zhang
# Date: 2026-04-02
#
# Description:
# This script runs a combined CCA analysis for the CMI cohort,
# including both math- and reading-related behavioral measures,
# while controlling for... |
625233534ac16bfc884d90b8310f2c5615cc581c3960bd797beef30ab5953a2d | R | 5,809 | 183 | library(ggplot2)
library(dplyr)
library(paletteer)
library(tidyr)
library(ggpubr)
epsilons <- c(5, 10, 25, 50, 100, 200, NA) #c(0.1, 0.5, 1, 2, 3, 5, 7, 10, 15, 25, 50, 100, NA)
samples <- c(rep(100, length(epsilons)-1), 18)
file_paths <- paste0("~/Python/WASP-DDLS/ML-results/deg2_eps_", ifelse(is.na(epsilons), "zero"... |
ca455b3890db6e135815817fd8dc1ca351838f04ae2ba90cca00a1a8348d3f9c | R | 5,821 | 163 |
# Usage:
# dendogram: function name
# dis_mat: path to dissimilarity matrix
# k: number of clusters (default=3)
################ original dendrogram ################
dendrogram <- function(dis_mat,k = 3,map) {
#################### perform hierarchical clustering ####################
# perform hierarchical ... |
0421b364ae52a8777acdced1bd32ae37c8cd1a896e59fff101d413245f6ab0a9 | R | 5,830 | 160 | ############################################################
# Canonical Correlation Analysis (CCA) - Stanford Cohort
# Author: Yuan Zhang
# Date: 2026-04-02
#
# Description:
# This script runs a combined CCA analysis for the Stanford
# cohort, including both math- and reading-related behavioral
# measures, while contr... |
ac54a012b1a8a94a4e1dba9f3a706beabe95a16bd853f998ceb6cf00082c74db | R | 5,854 | 116 | ---
title: "Batch correction"
author: "Christoph Hafemeister"
date: "`r Sys.Date()`"
output:
html_document:
highlight: pygments
---
```{r setup, include = FALSE}
library('Matrix')
library('ggplot2')
library('reshape2')
library('sctransform')
library('knitr')
knit_hooks$set(optipng = hook_optipng)
knitr::opts_ch... |
570e85bc9f3d581dc680fcdd7fcd9498a0db7fde8bfc2633599658b3cd3ae61a | R | 5,860 | 205 | ---
title: "R Notebook"
output: html_notebook
---
<!--
# Kymograph-derived actin retrograde-flow velocity at neurite tips
## What this file does
Reads pre-thresholded kymograph TIFFs and per-line-track CSVs derived from
Lifeact movies of growth cones, extracts the slopes of retrograde-flow traces
(actin moving inwar... |
0edb282316467d5da7266e75d1d11c89e72005d3e4456f541801fa8a409917f2 | R | 5,868 | 86 | #!/usr/bin/env Rscript
options( warn = -1 )
suppressPackageStartupMessages( if(!require("pacman")) install.packages ("pacman") )
suppressPackageStartupMessages(p_load("optparse"))
# # parse the directory this file is located (THIS DOESN'T WORK. using opt$libdir in option_list)
# script.dir <- commandArgs()[4]
# scrip... |
cb5d161a0ed14b7f2d97528e16369d074768bba95375d4646a539008ce1d89d4 | R | 5,883 | 192 | ###
# module load conda_R/3.6.x
library(jaffelab)
library(Seurat)
library(scater)
library(DropletUtils)
library(limma)
library(lattice)
library(RColorBrewer)
## read in data
pheno = read.delim("velmeshev/meta.tsv", row.names = 1)
dat = read10xCounts("velmeshev/")
pheno = pheno[dat$Barcode, ]
colData(dat) = DataFrame(... |
7c904e1a7221ececf5923fdf1d606531a387b638cfa8dc3779dfca568cccf585 | R | 5,910 | 211 | ##
library(SummarizedExperiment)
library(recount)
library(jaffelab)
library(edgeR)
library(SingleCellExperiment)
library(spatialLIBD)
## load counts
load("rse_exon_layerLevel_n76.Rdata")
load("rse_jx_layerLevel_n76.Rdata")
load("rse_gene_layerLevel_n76.Rdata")
## other phenotype data
load("Layer_Guesses/rda/sce_layer... |
7e8fe67b9218f823b928549be5f8c3487da934a3fc0112b52ae846ca9b9f37df | R | 5,912 | 188 | ---
title: "Linear regressopm of ortholog expression breadth in ORNs between species"
output: html_notebook
---
```{r}
library(tidyverse)
library(magrittr)
library(ggrepel) # for non-overlapping text labels
library(ggpubr) # for stat_cor() and stat_regline_equation()
library(ggtext)
```
```{r}
df <- read_csv("... |
568b4fa42eb98ed38c6471f1877ec56ef9bc33197d5edf48657a974544b9ca28 | R | 5,971 | 203 | ########################################
##### Multivariate GWAS models CVD #####
########################################
### Set arguments from pbs script ###
args = commandArgs(trailingOnly=TRUE)
n_start <- args[1] #Nstart
n_stop <- args[2] #Nend
output1 <- args[3] #Output 1
output2 <- args[4] #Output 2
## Run mu... |
9dc74f7924c6309bedb6602b6d31bf3a10bd08fd0f1184dbfbaa358f9b0c880f | R | 5,979 | 183 | ### AS CORRELATION EVENTS ####
library(arrow)
library(dplyr)
library(tidyr)
library(purrr)
library(tibble)
###Load in data:
classification <- read_parquet("./data/final_classification.parquet")
#
# Read in exon splicing events
ES_events <- read.table("./code/AS_APA/output/output_APA_AS_corr/ORFanage_events_SE_stric... |
60ca5a2f5b2d3b53b65718af2bbd4d19af14915cde9682136e9a348dc3af62ce | R | 5,989 | 151 | #Fig. 2b and Fig.2c
# Co-expression of Lepr and Glut1 in different cell clusters of murine SCG and stellate ganglia
library(tidyverse)
library(Seurat)
library(ggplot2)
##Load integrated data using relative path
data_path <- "data/ganglia_seurat_object.rds"
if (!file.exists(data_path)) {
stop("Seurat object not fou... |
fccb56944fbd6683ba7fb930066e1228587d2733a5e8be41ce67a3e416d8a99a | R | 5,998 | 118 | # =============================================================================
# 05_scrnaseq.R
# Single-cell RNA-seq analysis of GSE131928 (Neftel et al.) (Methods 4.7)
#
# Pipeline: adaptive QC (MAD-based) -> SCTransform v2 -> Harmony batch
# correction -> PCA(50) -> SNN + Louvain -> UMAP -> 13-signature module-score... |
e1d28424403812c2ecf125ca9a262b9a14fdae4463d79e4d92618f0c3ba4000b | R | 6,011 | 159 | # Load DESeq2
if (!requireNamespace("DESeq2", quietly = TRUE)) {
BiocManager::install("DESeq2")
}
library(DESeq2)
# Function to run pseudobulk DESeq2 for a cell type
run_pseudobulk_deseq2 <- function(seurat_obj, cell_type_name) {
# Subset to cell type
cells <- subset(seurat_obj, cell_type == cell_type_name)
... |
ece0e421aaab1ef627647e8cc57cd0d0b33d38e9ea6ad06c33f52942ed52f449 | R | 6,055 | 175 | ############################################################
# Canonical Correlation Analysis (CCA) - CMI Cohort
# Author: Yuan Zhang
# Date: 2025-07-25
#
# Description:
# This script runs CCA analyses for both math and reading
# tasks on the CMI cohort, controlling for age. PCA is used
# on GMV data for dimensionali... |
fa202dc325c8147a8a57eac84b7875b06687b574cab8bf281321a39d7916ce4e | R | 6,057 | 194 | #!/usr/bin/env Rscript
# Author_and_contribution: Jieran Sun & Mark Robinson; Create the script
suppressPackageStartupMessages(library(optparse))
option_list <- list(
make_option(
c("-i", "--input_file"),
type = "character", default = NULL,
help = "Input containing the aggregated labels."
),
make_o... |
b97a8abb42c25221bb92e88077ca13fe7e306b67ecdc3bb70f6379b81513d074 | R | 6,070 | 142 | sumstats <- function(files,ref,trait.names=NULL,se.logit,OLS=NULL,linprob=NULL,N=NULL,betas=NULL,
info.filter = .6,maf.filter=0.01,keep.indel=FALSE,parallel=FALSE,cores=NULL,ambig=FALSE,direct.filter=FALSE){
if (is.list(files)) {
wrn <- paste0("DeprecationWarning: In future versions a list of... |
befabf34ee71d414c0892f1b8e48070f019192ea3e06c8ec29e699681f0d12fb | R | 6,085 | 173 | ### AS CORRELATION EVENTS ####
library(arrow)
library(dplyr)
library(tidyr)
library(purrr)
library(tibble)
### Run suppa2
system("python ./suppa.py generateEvents -i ./code/IsoformSwitchAnalyzeR/input/ORF_gene_id_replaced_tr_exon.gtf -o ./code/AS_APA/output/output/APA_AS_corr/ORFanage_events -e SE SS MX RI FL ... |
75e8649749eda6ae001858d4f5d45c38bf754e712dcd34630e7bec6e908ff042 | R | 6,090 | 141 | #!/usr/bin/env Rscript
## 07_brainwm_rna_meth_rerun.R — generated from notebook spec
## Run: Rscript 07_brainwm_rna_meth_rerun.R
## ============================================================
## # 07 — Brain WM RNA + methylation rerun (R/limma)
##
## Re-run the brain white-matter stratum used in the bulk MS_GEO a... |
70df7cc4856b5fc2fd620642a5b7a1d3eb2de34764eac1307b00d63948cd545b | R | 6,092 | 175 | ############################################################
# Canonical Correlation Analysis (CCA) - Stanford Cohort
# Author: Yuan Zhang
# Date: 2025-07-25
#
# Description:
# This script runs CCA analyses for both math and reading
# tasks on the Stanford cohort, controlling for age. PCA is used
# on GMV data for di... |
e7a0ae0f4da27108ad858683fe710a1ca0cfdff02f10b17059dd529fda73e8ef | R | 6,130 | 239 | ### Conduct ACAT on TSEM Genes ###
library(devtools)
library(dplyr)
library(data.table)
devtools::install_github("yaowuliu/ACAT")
setwd("./ACAT")
##################################################
CVD <- fread("CVD_pvalue_matrix.tsv")
## Change rownames to gene names
CVD <- as.data.frame(CVD)
rownames(CVD) <- CVD... |
a865f4863e860209c4ff199077fadf6bfea1273bb017fbd0f3a1f86e63d7b3fc | R | 6,157 | 168 | #Fig. 3e
# Co-expression of Lepr and Adrb2 in ARC_ME cells from the published HypoMap dataset
# Data source:
# This analysis uses the ARC_ME subset of the published HypoMap Seurat object.
# The subset was defined using annotations from the original published dataset.
# Full dataset provenance is provided in the corres... |
745d80e4f5c52f5a012144b693ca9de0844d5b47d3c14db4af458292b6b53f87 | R | 6,169 | 147 | # Shared synthetic-dataset fixture used across tests. Not part of the
# installed package; sourced automatically by testthat.
local_temp_dir <- function() {
d <- tempfile("dseqtlsusie-test-")
dir.create(d, recursive = TRUE)
d
}
make_synthetic_dataset <- function(dir, dataset = "TESTCT__TESTREGION", n_donors = 2... |
37360267820ec434be0e34d4f0cb5133eb588d40a6f9d14b2b2d9e724064d6b7 | R | 6,191 | 137 | # =============================================================================
# 06_tme_cellchat.R
# Tumor microenvironment + cell-cell communication (Methods 4.8)
#
# Produces:
# Table S13 - Macrophage M1/M2 polarization module scores (per cell)
# Table S14 - CellChat significant L-R interactions (all pathways)
#... |
597d032480d272b48e0cb06701e3fd888ef6db5c12fcd602323eeb187794669f | R | 6,193 | 195 | ##
library(SummarizedExperiment)
library(limma)
library(recount)
library(jaffelab)
library(SingleCellExperiment)
library(here)
library(spatialLIBD)
library(RColorBrewer)
library(lattice)
library(pheatmap)
## load data
load("rse_gene_He_Layers_n102_annotated.Rdata")
## split by dataset
rse_gene_ds1 = rse_gene[,rse_gene... |
e628eb1affc0abb86a961d6b1b3221fb899e9b00558104359dc75b7f913401e7 | R | 6,218 | 144 | setwd('~/DEGs.Multiresolution/')
##
library(scran)
library(scater)
library(ACTIONet)
library(limma)
library(plyr)
library(dplyr)
library(readr)
library(biomaRt)
##########3
brain=readRDS('brain.human.HD.vascular.rds')
meta=read.table('brain.human.HD.vascular.metadata.celltype.txt',header = T,sep = '\t')
brain@meta.dat... |
9ef6a6b4ec2381ce9c8dade756143a4345456f50ca3a705dd7d94384e40126bc | R | 6,268 | 202 | #' @include generics.R
#'
NULL
#' @param seu A Seurat object. Only applicable when using the Seurat method.
#' @param features Features for computation, including gene expression, metrics, PC scores, or any other data retrievable via `FetchData()`. Defaults to NULL, implying all features in the matrix. Only applicable... |
0edb25631a292f4bd9bec5f7c85af6a7368a910cfd5b21346cb03fcf2452bbd2 | R | 6,275 | 177 | #!/usr/bin/env Rscript
setwd('~/analysis')
###########################
id='ROSMAP_BBB_mouse.integration.CCA'
##########################
library(scales)
library(plyr)
library(Seurat)
library(dplyr)
library(harmony)
library(pheatmap)
library(RColorBrewer)
wr <- colorRampPalette(colors = c( "white", "red"))(100)
rwb <- co... |
38abc516d7afe20ed091368b40d98577e622e64c91d6f7f850274874bb66b40b | R | 6,308 | 205 | ############################################################
# Compare GMV weight maps across models within each cohort
#
# For each cohort, compare the Mode 2 GMV weight maps from:
# 1) math-alone model # mode2 = math mode
# 2) reading-alone model # mode2 = reading mode
# 3) math+reading combined model # mode2 =... |
a28d22de42931116f9fb673822a98389b29635a7aa4b5eef51098978793e2e78 | R | 6,331 | 173 | setwd("/groups/stark/vloubiere/projects/DeepATAC_shenzhi/")
require(vlfunctions)
# Import metadata ----
meta <- readxl::read_xlsx("Rdata/metadata_ATACSeq.xlsx")
meta <- as.data.table(meta)[dataset=="bulkENCODE"]
"/groups/stark/shenzhi.chen/projects/transferLearningMammalianEnhancerDesign202408/db/narrowpeak/bulkATAC/f... |
f5fed2115f96d6b93d1ff87e239bf6d85633d276b5a13be4db05fab294486954 | R | 6,331 | 213 | ---
title: "Preprocessing script for Hayashi 2018"
author: "Aditya Pratapa"
date: "`r Sys.Date()`"
output:
BiocStyle::html_document:
toc: true
vignette: >
---
Load necesdsary libraries
```{r warning=FALSE,message=FALSE}
library(destiny)
library(slingshot)
library(plotly)
library(gam)
library(RColorBrewer)
librar... |
f8bfe7a4c766781845f955c4991c8cea0438e005718085cfa1fcb96a7f0bf45a | R | 6,350 | 188 | ---
title: "R Notebook"
output: html_notebook
---
<!--
## What this file does
Loads two pre-computed time-series vectors from `data.RData`:
- `GC_int` — per-frame Lifeact-mScarlet actin intensity at the
**growth cone / lamellipodium** ROI of Cell_6.
- `soma_int` — per-frame Lifeact-mScarlet intensity at the **soma... |
ae8591dbd6385d221bd597ca5e39de9010b43174bb156774564d708c6d76d35d | R | 6,362 | 266 | # screen -S sce
# qrsh -l mem_free=60G,h_vmem=60G,h_fsize=100G -pe local 4
# module load conda_R/3.6.x
library('SingleCellExperiment')
library('zinbwave')
library('clusterExperiment')
library('BiocParallel')
library('scran')
library('RColorBrewer')
library('sessioninfo')
dir.create('pdf_zinbwave', showWarnings = FALS... |
c1d04ba038563e5e5560ffc0e599d03f923a2b104c85995c9a527c40a1783183 | R | 6,388 | 181 | #!/usr/bin/env Rscript
################################################################################
# Script: convert_bnrep_models.R
# Purpose: Convert a single Bayesian network model from the bnRep repository to
# BIF format (discrete) or JSON format (continuous/Gaussian)
# Author: pgmpy development team... |
154950aa3f12b48c6057f1509f7b9ea961e47bf1b13b8a271897854d73be5cf7 | R | 6,396 | 208 | # convert Seurat object to standard expression matrix
Seu2Matr <-
function(
seu,
features,
group.by = NULL,
split.by = NULL,
cells = NULL,
slot = "data",
assay = NULL,
priority = c("expr","none"),
verbose = TRUE
) {
if(!require(SeuratObject)) library(Seurat)
if(!is.null... |
d977fcedcfcd15394148d7d54f247512ad86314e48ee710c7da71362a16df79b | R | 6,407 | 228 | ---
title: "R Notebook"
output: html_notebook
---
<!--
# Morphology quantification (longest-neurite length + neurite count) under DMSO / Taxol / Nocodazole, WT + Arp3 KO
## What this file does
Reads per-neuron morphology CSVs from `folder_path` (`list.files` at line 53,
loaded line 56) for the Taxol / Nocodazole tre... |
9adf3ede8ecf57aeeaa46aef83d21ec938de208db3145c0445df23b312b10a3a | R | 6,414 | 212 | #!/usr/bin/env Rscript
# Author_and_contribution: Niklas Mueller-Boetticher; created template
# Author_and_contribution: Søren Helweg Dam; implemented method
suppressPackageStartupMessages({
library(optparse)
library(jsonlite)
library(SummarizedExperiment)
library(SpatialExperiment)
library(spatia... |
984fe36c03bda5884666541c02b683f6d4ecf54f019296013c153eed2900405f | R | 6,434 | 132 | ---
title: "Theta regularization"
author: "Christoph Hafemeister"
date: "`r Sys.Date()`"
output:
html_document:
highlight: pygments
---
```{r setup, include = FALSE}
library('Matrix')
library('ggplot2')
library('reshape2')
library('sctransform')
library('knitr')
library('dplyr')
knit_hooks$set(optipng = hook_op... |
9455304161501cd8483b984de4f7e3a88fa6c5517ce0821e4e31cee53fd41766 | R | 6,439 | 223 | ---
title: "R Notebook"
output: html_notebook
---
<!--
# Axon retraction frequency across DIV stages (microtubule-kink occurrence)
## What this file does
Reads in-line count tables (DIV-1 to DIV-4, retracted vs non-retracted axon
counts and microtubule-kink occurrence) and constructs the contingency
tables for the c... |
72ee0309a2fe328f92a870cb680bd2b60903ee9f6d75357ec097be81fbde48c3 | R | 6,445 | 159 | ##########################################################################
# Age Analysis of CCA GMV Weights for CMI-HBN and Stanford Cohorts
# Author: Yuan Zhang
# Date: 2025-07-25
#
# Description:
# This script performs the following:
# 1. Loads math and reading CCA results for both CMI-HBN and Stanford.
# 2. Ext... |
4e437c418763db821f8006978ff49780959243829f1c81e8288e4f5b42518459 | R | 6,486 | 183 | #' Subset the ligand-receptor interactions for given specific signals in CellChatDB
#'
#' @param signaling a character vector
#' @param pairLR.use a dataframe containing ligand-receptor interactions
#' @param key the keyword to match
#' @param matching.exact whether perform exact matching
#' @param pair.only whether on... |
6746d38f2d0e32c7a389f8e13082dc8d7f198fcc29cf73ffe5a65344f7468cb9 | R | 6,526 | 137 | # Load libraries
library(Seurat)
library(ggplot2)
library(dplyr)
library(patchwork)
library(tidyr)
# Set working directory
setwd("/home/doyang/turbo/CLRN1 WT VS KO 10M SnRNAseq/")
# Load Seurat object
retina <- readRDS("CLRN1_Retina_with_DonorIDs.rds")
# Define HSP90 and chaperone genes
hsp90_genes <- c("HSP90AB1", ... |
5b6482ae0f1937c0f0922d7fd379ec95932b952fc1c5eee569198b558a4d48b1 | R | 6,534 | 154 | #####################################
# Estimate metacognitive efficiency (Mratio) at the group level
#
# Adaptation in R of matlab function 'fit_meta_d_mcmc_groupCorr.m'
# by Steve Fleming
# for more details see Fleming (2017). HMeta-d: hierarchical Bayesian
# estimation of metacognitive efficiency ... |
97061c85cd9add4a355e5552e186512f7d11549872fbb9816c4ebe97ca0f45bb | R | 6,567 | 137 | #Script that prepares the input for the permutation tests in Palm
#########################################################
### (A) Installing and loading required packages
#########################################################
if (!require("dplyr")) {
install.packages("dplyr", dependencies = TRUE)
library(dplyr... |
983bcf7632af081c48989d4a3bcc2eea33514aea7ab47faa105c3c307981c0d5 | R | 6,586 | 187 | #!/usr/bin/env Rscript
# Written by Phil Ewels and released under the MIT license.
# Ported to nf-core/modules with template by Jonathan Manning
#' Parse out options from a string without recourse to optparse
#'
#' @param x Long-form argument list like --opt1 val1 --opt2 val2
#'
#' @return named list of options and v... |
72289151a5a4dd2b66af948f306f62d149c23b9d9416e2c46f7470f7716429e9 | R | 6,589 | 142 | ---
title: "Method comparison"
author: "Christoph Hafemeister"
date: "`r Sys.Date()`"
output:
html_document:
highlight: pygments
---
```{r setup, include = FALSE}
library('Matrix')
library('ggplot2')
library('reshape2')
library('sctransform')
library('knitr')
library('dplyr')
library('GGally')
knit_hooks$set(op... |
da8461952fd1d45649f8d0134be780b63898664d422b1ecef8697c718ccff5bd | R | 6,611 | 186 | #Extended data_Fig
#coexpression analysis_Lepr Cav1, Lepr Vegfr2, Lepr Cdh5
library(tidyverse)
library(Seurat)
#### expression datasets
##Load integrated data using relative path
data_path <- "data/ganglia_seurat_object.rds"
if (!file.exists(data_path)) {
stop("Seurat object not found. Please check data/README.md... |
747df52bfa75bc8a57f0007ee6b308e72cb3799c37d6ba7c057c6846b9548827 | R | 6,628 | 240 | #!/usr/bin/env Rscript
# Author_and_contribution: Niklas Mueller-Boetticher; created template
# Author_and_contribution: Søren Helweg Dam; implemented method
suppressPackageStartupMessages({
library(optparse)
library(jsonlite)
library(SpatialExperiment)
library(BASS)
})
option_list <- list(
make_op... |
db2aaea17684c7ebdeb00772c91b1a6d4fd27d8a682d4f3d5bd084e29e12f7f0 | R | 6,628 | 219 | ###
# module load conda_R/3.6.x
library(jaffelab)
library(Seurat)
library(scater)
library(DropletUtils)
library(limma)
library(lattice)
library(RColorBrewer)
library(pheatmap)
## read in sce.dlpfca
load("/dcl01/lieber/ajaffe/Matt/MNT_thesis/snRNAseq/10x_pilot_FINAL/rdas/regionSpecific_DLPFC-n2_cleaned-combined_SCE_MN... |
9d065cad9a068cfbc8631d4c4f3ca5ef61779a0307ac3320d1f0ea617002371b | R | 6,639 | 236 | ---
title: "K group fold ML winsorized w/grid tuning"
output: html_notebook
---
This script predicts Savg from the neural network metrics.
```{r, warning=FALSE, message=FALSE}
library(tidyverse)
library(caret)
library(randomForest)
library(beepr)
library(tictoc)
prl <- read.csv("socialBehaviorPrLdataPIindices.csv", ... |
6f34871383f560105f8aeaffa00adde4765abdd17ebf6d448f75424dd3fb3841 | R | 6,656 | 199 | library(dplyr)
library(ggplot2)
library(patchwork)
library(Rsamtools)
library(rtracklayer)
library(GenomicFeatures)
library(arrow)
library(GenomicRanges)
LR_SJ <- read_parquet("data/riboseq/riboseq_SJ.parquet")
#-------------------------------------Get annotated long-read exons----------------------------
ribo <- Ba... |
67452dc221a85f65c1659235582df2ffaebf6c2e3eafbf660f3d6768fd5aef23 | R | 6,692 | 236 | #!/usr/bin/env Rscript
# Author_and_contribution: Niklas Mueller-Boetticher; created template
# Author_and_contribution: Søren Helweg Dam, implemented method.
suppressPackageStartupMessages({
library(optparse)
library(jsonlite)
library(SpatialExperiment)
library(Seurat)
})
# Get script path
initial_o... |
88d1cef82974a2726dd7b7407725aad2f6c894534330b9383b569e17f965a971 | R | 6,737 | 227 | ---
title: "R Notebook"
output: html_notebook
---
<!--
# Consolidator: Rab11a + Arp3 + actin patch colocalization
## What this file does
Reads pre-computed per-neuron correlation tables (`csv_list` from `Path_1`,
lines 43, 53) for the Arp3-actin and Rab11a-actin colocalization datasets,
combines them into a single l... |
da18cdc5babebd0da0d07de4df5b69cdeafd7cfa3da6baa6a34b539e813af593 | R | 6,799 | 176 | <!--
================================================================================
fig04fh_arp3_genotype_neurite_quantreg.R — Fig 4f/h
================================================================================
What this file does: Quantile regression with rq() + bootstrap p-values across WT/het/KO.
Manuscrip... |
20c46072c81e8f5771cc08fde65aaaa57474cb8672895abf766e0a53f71b2d9b | R | 6,827 | 161 | library(peer)
library(qtl)
source("helpers.R")
simple_unsupervised_demo <- function(){
print("Simple PEER application. All default prior values are set explicitly as demonstration.")
y = read.csv("data/expression.csv",header=FALSE)
K = 20
Nmax_iterations = 100
model = PEER()
# set data an... |
554fde898c2a1c2dca836815c6b0f60524840b2da59053c6d7d54fc39d9c7939 | R | 6,839 | 195 | ############################################################
# Canonical Correlation Analysis (CCA) - CMI Cohort
# Author: Yuan Zhang
# Date: 2026-03-24
#
# Description:
# This script runs CCA analyses for both math and reading
# tasks on the CMI cohort, controlling for site on the
# brain side only. Specifically, SITE... |
b094ebdffc0a56fd481fc45492eaae383583176788cb277ff42d9263f8e55f13 | R | 6,851 | 229 | ---
title: "brain_visual"
author: "Lexi Luo"
date: "`r Sys.Date()`"
output: pdf_document
---
```{r}
# Enable this universe
#options(repos = c(
# ggseg = 'https://ggseg.r-universe.dev',
# CRAN = 'https://cloud.r-project.org'))
# Install some packages
#install.packages('ggsegExtra')
# Enable this universe
#options(r... |
3a5343bddd5cdccf0fc68a3bfc5293dde05acefbc41cf6d9cd377a61925c110c | R | 6,857 | 157 | #!/usr/bin/env Rscript
## 10_inverse_proteomics_validation — generated from notebook spec
## ============================================================
## # 10 — Inverse-concordance validation in proteomics (R)
##
## Take the **inverse-concordant gene list** discovered in notebook 09 and
## look each gene up in ... |
8ee25aaaf983b9087e28331df746251d3e19d9aa4933003d63ceef35d806f95b | R | 6,858 | 138 | # MIT License
#
# Copyright 2025 Broad Institute
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, ... |
5ff90ed39a2ea82fe402b1c440913fe84af5b2b6411872e28cc2e9045d382326 | R | 6,865 | 123 |
---
title: "Comparison analysis of multiple datasets with different cell type compositions"
author: "Suoqin Jin"
date: "`r format(Sys.time(), '%d %B, %Y')`"
output:
html_document:
toc: true
theme: united
mainfont: Arial
vignette: >
%\VignetteIndexEntry{Comparison analysis of multiple datasets using CellCha... |
fd0f21e92ec06dad16be0aa7d2a62cf6bb1a64e868ca188bb42374c5299c56e6 | R | 6,870 | 177 | test_that("a gene-level susieR::susie() error is caught, warned, and does not stop other genes", {
dir <- local_temp_dir()
fx <- make_synthetic_dataset(dir)
outs <- out_paths(local_temp_dir())
original_susie <- susieR::susie
local_mocked_bindings(
susie = function(X, y, ...) {
if (identical(colname... |
c8bc5e82b3ee68baf58bbf86712ce75f97e956e637ee368df097456ed6900d3b | R | 6,893 | 198 | ############################################################
# Canonical Correlation Analysis (CCA) - Stanford Cohort
# Author: Yuan Zhang
# Date: 2025-07-25
#
# Description:
# This script runs CCA analyses for both math and reading
# tasks on the Stanford cohort, controlling for age and
# regressing out IQ (fsiq) fr... |
b27a3b6f0d10900ba43a0a6ad4312f4d845134a1451a30f0b90ae8c047520cfa | R | 6,912 | 205 | # Preparation
```{r}
#| label: import-r
library(GenomicAlignments)
library(GenomicFeatures)
library(rtracklayer)
library(dplyr)
library(arrow)
library(ggplot2)
library(readr)
library(VennDiagram)
```
```{r}
#| label: import-data
lr_bulk_var <- read_parquet("nextflow_results/pbid_orf.parquet")
genome_gff3_gtf <- read... |
cc1595d2e5602260be1f9aeec7fdf7509c5c6b1dd586ff9441a0b0cdaf7c9f65 | R | 6,929 | 221 | #!/usr/bin/env Rscript
# Author_and_contribution: Niklas Mueller-Boetticher; created template
# Author_and_contribution: Søren Helweg Dam; implemented method
suppressPackageStartupMessages({
library(optparse)
library(SingleCellExperiment)
library(jsonlite)
library(Seurat)
library(DR.SC)
})
option... |
43c80eda4b2ccd30949db2f9c52da013a137b7f825aece3042860191b1186c54 | R | 6,943 | 230 | #!/usr/bin/env Rscript
# Author_and_contribution: Niklas Mueller-Boetticher; created template
# Author_and_contribution: Giorgia Moranzoni, implemented method.
suppressPackageStartupMessages({
library(optparse)
library(jsonlite)
library(SpatialExperiment)
library(Seurat)
library(spruce)
})
optio... |
8663c274c663ae408a779321d0fa5833763bd050ad75471568eed8dbdf2803f4 | R | 6,947 | 305 | ##
library(limma)
library(jaffelab)
## load outputs
load("rda/eb_contrasts.Rdata")
load("rda/eb0_list.Rdata")
## Extract the p-values
pvals0_contrasts <- sapply(eb0_list, function(x) {
x$p.value[, 2, drop = FALSE]
})
rownames(pvals0_contrasts) = rownames(eb_contrasts)
fdrs0_contrasts = apply(pvals0_contrasts, 2, ... |
d686dfef8ae21e0596dd960153c6d936a6fbf2aa9ba3e0ae4a7d3bae1a20936c | R | 6,961 | 209 | ---
title: "K group fold ML winsorized w/grid tuning"
output: html_notebook
---
This script is for Model 1, predicting genotype. Hyperparameter tuning will be employed for the mtry parameter.
```{r, warning=FALSE, message=FALSE}
library(tidyverse)
library(caret)
library(randomForest)
library(beepr)
library(tictoc)
p... |
11c6db6d768738cdd9f28c9d19fdab0f78b69298732e2387c73a7aef4eff5292 | R | 7,023 | 167 | library('SingleCellExperiment')
library('here')
library('readxl')
library('Polychrome')
library('rafalib')
library('sessioninfo')
## Functions derived from this script, to make it easier to resume the work
sce_layer_file <-
here('Analysis', 'Layer_Guesses', 'rda', 'sce_layer.Rdata')
if (file.exists(sce_layer_file)... |
3b4bc5bd58dd5e5de5f5184c18d096873acd97160b36eb9c60052c70ece984cb | R | 7,023 | 232 | ---
title: "visualization"
author: "Bernard Asanbe"
date: "2025"
---
```{r}
# Load required libraries
library(ggplot2)
library(dplyr)
library(readr)
library(scales)
# Read the CSV file
data <- read_csv("insert_file_path_here/Phyloglm_modelling_results.csv")
# Filter out intercept rows
data <- data... |
582451cb97cc6396b39d5645cc13bc887990b7f1b3ef7f1b878dd460ccebe6dc | R | 7,035 | 201 | ############################################################
# Canonical Correlation Analysis (CCA) - CMI Cohort
# Author: Yuan Zhang
# Date: 2025-07-25
#
# Description:
# This script runs CCA analyses for both math and reading
# tasks on the CMI cohort, controlling for age, and
# regressing out IQ (WISC_FSIQ) from m... |
e0776669c8bed282a756044e56455307fb92fe1a2905e567b053d3c7f8c416c7 | R | 7,042 | 238 | ---
title: "visualization"
author: "Bernard Asanbe"
date: "2025"
---
```{r}
# Load required libraries
library(ggplot2)
library(dplyr)
library(readr)
library(scales)
# Read the CSV file
data <- read_csv("insert_file_path_here/Phyloglm_modelling_results.csv")
# Filter out intercept rows
data <- data... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.