sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
23f3bd7df0a2649fe82ada5eb07cfba7a2dc51dc80fd036f3f64ec0507716dee | R | 4,772 | 134 | #------------------------------------------------------SETUP-----------------------------------------------------#
# Load libraries
library(tidyverse)
library(data.table)
library(BuenColors)
library(Seurat)
library(irlba)
library(Matrix)
library(future)
library(reticulate)
library(ggrastr)
library(tidytext)
library(ma... |
702a52359167e805919af19698c3f830ed06c1e2ad9c4828894c599b8803f71f | R | 4,772 | 151 | # GLMM Beta Regression - Behavioral Time Data
# Fits beta regression models (via glmmTMB) to proportion of time spent in
# each behavior. Beta regression for bounded (0,1) proportional data.
# Link functions were selected per-behavior based on distribution shape.
# Two comparison types:
# - Paired (vehicle ... |
454419f3253350fead33b2bae43c5473bd0cca2d02046a6ec587754d350808e4 | R | 4,773 | 135 | #------------------------------------------------------SETUP-----------------------------------------------------#
# Load libraries
library(tidyverse)
library(data.table)
library(BuenColors)
library(Seurat)
library(irlba)
library(Matrix)
library(future)
library(reticulate)
library(ggrastr)
library(tidytext)
library(ma... |
ab08561624ac1b486b660a0dfb51ffe7f8da8456b365632db563cd65ad6ac291 | R | 4,773 | 138 | library(Seurat)
library(tibble)
library(dplyr)
library(patchwork)
library(celda)
SSE1_filtered <- readRDS("SSE1_4_seurat_umap_noAR_sse7.rds")
# Neftel subtypes
library(scalop)
load('Signatures_GBM.rda')
Signatures_GBM$G1S <- NULL
Signatures_GBM$G2M <- NULL
neo_score<-sigScores(m = as.matrix(SSE1_filtered[['RNA']]$co... |
12181f6a5c2590ddebdafa8808418e94fa1743184df406c9972660583a6c896f | R | 4,775 | 125 | #' Collects parameter settings for SAHA analysis
#'
#' This function gathers parameter settings for various analyses (e.g., marker-based, self-similarity) and stores them in a structured data frame within the `ann` object.
#'
#' @param ann An object containing analysis parameters within `ann@params`.
#'
#' @return The ... |
2666c03139178035ec20b4502596e8bb957ad68185d9ac74464501a27a8d2923 | R | 4,791 | 138 | #------------------------------------------------------SETUP-----------------------------------------------------#
# Load libraries
library(tidyverse)
library(data.table)
library(BuenColors)
library(Seurat)
library(irlba)
library(Matrix)
library(future)
library(reticulate)
library(ggrastr)
library(tidytext)
library(ma... |
03ca31c60918c9f9325ca9b2017d23571acdd3d8945df3697f904b387c9b4169 | R | 4,792 | 118 | ### Class sum In vitro
setwd(rstudioapi::getActiveProject())
library(tidyverse)
rm(list=ls())
load("./Output_Data/Invitro.MsD.404.log2.norm.impt.no.O8aNSC.Rdata")
InvitroAQ.class.sum <- 2^Invitro.no.O8A.MsD %>%
rownames_to_column(var = "LipidIon") %>%
pivot_longer(-LipidIon, names_to = "Sample", values_to = "C... |
7723c4e1b78c8ff38047130e492b362001ef8b155e68408a51317e1cf21b6628 | R | 4,794 | 95 | # Load necessary libraries
library(Seurat)
library(Matrix)
library(dplyr)
# Set working directory
setwd('/home/joonho345/1_Epilepsy_RNA/scRNA_Human/')
#########################################################
#### Load Seurat Object ####
seurat_combined_o <- readRDS("/data/project/1_Epilepsy_RNA/scRNA_Human/Deconv_o... |
5aaec0d2d290e63f96743d82ba29b7bb7a5bd9f5c3407ed3a65fbf26d1c17caa | R | 4,810 | 111 | #' Investigates marker overlap between query cluster and database cell types
#'
#' Generates visualizations or summaries to explore marker overlap between a specified
#' cluster in the query data and cell types within the database.
#'
#' @param ann An object containing `ann1$query` and `ann1$db` data frames.
#' @param ... |
aa6114116041ef6baa0c4e97f2e70021655ea6e867c99f76d2c202223196024a | R | 4,810 | 99 | ##################################
# Visualize MES-like abundance change in monoculture, co-culture experiments following irradiation
# Author: Kevin Johnson
##################################
library(tidyverse)
library(RColorBrewer)
library(ggpubr)
library(cowplot)
library(EnvStats)
fig_dir <- "/vast/palmer/pi/verha... |
3e71943151073605a5948438a2806a35f08c807c472037ca63f4d9e1e751a36f | R | 4,813 | 133 | add_info_single <- function(sampler, prior = NULL, ...){
# Checking and default priors
sampler$prior <- get_prior_single(prior, sampler$n_pars, sample = F)
return(sampler)
}
get_prior_single <- function(prior = NULL, n_pars = NULL, sample = TRUE, N = 1e5,
selection = "alpha", design ... |
3a771fd6bd77eed5b6af2bc3d948e52bab371f2a95a8b87569d52ea985a09958 | R | 4,816 | 87 | library(dplyr)
#### import coldata_df from 00.Matrix_H.R
coldata_df_M
#### import HiRES matrix ####
celltype <- 'ExN-M'
celltype <- 'InN-M'
celltype <- 'Astro-M'
celltype <- 'Micro-M'
celltype <- 'Oligo-M'
celltype <- 'OPC-M'
celltype <- 'Endo-M'
Dataset_M <- 'GSE185862'
file_path <- paste0("/home/joonho345/1_Epi... |
5315d547df52f448a3fc2609d16aae80265104b47388eaf425aa0e3e3d705f4b | R | 4,819 | 100 | library(dplyr)
################################
#### BEFORE Sample Selection ####
################################
#### choose groups to compare ####
## hippo: only hippo
coldata_df_hippo <- coldata_df %>%
filter(Brain_Location == "HIPPO") %>%
mutate(across(everything(), ~ replace(.x, .x == "", "N/A")))
filtered... |
715958fe0efc74b9d36f216cfc1a9b273697a80e00dec5f447fefdcc2e18b300 | R | 4,820 | 111 | #' banc-hemibrain-skel-transform — Transform hemibrain skeletons into BANC space.
#'
#' For each hemibrain bodyid, fetches the skeleton (neuprint) and applies
#' the JRCFIB2018F → JRC2018F → BANC registration chain. Saves the
#' transformed SWC.
#'
#' @section Reads:
#' - `<banc.meta.save.path>/hemibrain_meta.csv`
#'... |
49f5490501542565bb180c15750fdf2ad3f0f8f3d32429ef35935adaa1b14215 | R | 4,824 | 122 | # METAMODULE ACTIVITY SCORING
#########
# SET UP
#########
library(stringr)
library(dplyr)
library(Seurat) # this script assumes the use of Seurat v4
library(tidyr)
library(readxl)
library(tidyverse)
### RECOMMENDATIONS FOR METAATLAS ###
# Save a folder for each dataset int your metaatlas, in which all individual Se... |
1af2b15d782034773e9f0ffceb4ec44530726c26ed7357debdfa82ced5961fad | R | 4,828 | 141 | #------------------------------------------------------SETUP-----------------------------------------------------#
# Load libraries
library(tidyverse)
library(data.table)
library(BuenColors)
library(Seurat)
library(irlba)
library(Matrix)
library(future)
library(reticulate)
library(ggrastr)
library(tidytext)
library(ma... |
524e1cba521dd9d4e28f7ecc1ae05f1f9da4dc1dafeed22bee57be7a619709ce | R | 4,835 | 106 | ##################################
# Derive IDH-mutant hierarchy coordinates for IDH-mutant malignant cells
# Author: Kevin Johnson
# Date Updated: 2026.04.10
##################################
library(tidyverse)
library(RColorBrewer)
library(viridis)
library(Seurat)
library(Matrix)
library(openxlsx)
proj_dir <- "... |
b160be1b432e5445f2d3167db754f892737c69134bc94ef9e371c79ca1628045 | R | 4,835 | 105 | ##
##Load regNet package
##
#- See https://github.com/seifemi/regNet for details how to install regNet.
library( regNet )
##
##Set the following paths according to your system
##
#- Must be modified to fit to your own system
#- Central project path prefix for regNet to store outputs of regNet
centralProjectPathPrefix... |
7db87a42b2c422004f8e2cb8bf951668c28d40614523d4321abdb1336a15ada6 | R | 4,836 | 147 | #' banc-calculate-volumes — Per-neuron volume via the CAVE L2 cache.
#'
#' Sums L2-chunk `size_nm3` per neuron; incremental.
#'
#' @section Reads:
#' - SeaTable `banc_meta`, CAVE L2 cache
#'
#' @section Writes:
#' - `banc_volumes.feather`
#'
#' @section Invoked by:
#' production v888 rebuild chain.
#'
#' @section... |
da06bba87be720f9816b7e7e15b413146c3df19dc6dfe09b38e3900d348397ee | R | 4,851 | 114 | #' Automatically annotate query clusters with best matching cell types
#'
#' @param ann An annotation object.
#' @param data_type Character string specifying the mode ("Markers", "AvgExp", or "Both").
#'
#' @importFrom dplyr %>% group_by filter slice_min ungroup mutate select arrange as.data.frame full_join coalesce
... |
ea1d0f54fb916744d9d0a49f3908fede152ea41cf1e72bfc8bcd2209b2b76ba6 | R | 4,853 | 129 | library(readr)
library(dplyr)
library(ggplot2)
library(igraph)
library(here)
# load table with results of mapping cross-species clusters to
# Zeng/Macosko atlases
tab1 = read.delim(here('results/cross_species_studies/cross_species_mapping_results.tsv'), sep = '\t')
tab1 <- tab1[!is.na(tab1$ref_celltype) & !is.na(tab1$... |
9a9b400d5dcc040a4f515cb5d5ecb6e826107ec3507d01394a07e86ebe54947b | R | 4,855 | 115 | library(tidyverse)
library(edgeR)
library(WGCNA)
library(corrplot)
library(lme4)
load("GTEX_DLPFC_datExpr_counts_brain_RSEM.RData")
datExpr.counts <- gtex.rsem
rm(gtex.rsem)
datMeta <- datMeta %>%
filter(!is.na(datMeta$SMRDLGTH), # Maximum read length
INCEXC == "TRUE", # Eligible For Study
MHAL... |
cd2df7a3f9e4f3a5568e747edc481e8b59f4e9b4fe5e254865210e957761e401 | R | 4,863 | 111 | #' banc-manc-skel-transform — Transform MANC neuron skeletons into BANC space.
#'
#' For each MANC bodyid, fetches the skeleton via `malevnc::read_manc_skeletons`
#' and applies the MANC → JRCVNC2018F → BANC registration chain. Saves
#' the transformed SWC to the per-version BANC NBLAST skel tree.
#'
#' @section Reads:... |
34ed6fc90382f600bc24113b77412a1a3d2d9ba5782bea892f25078311b8f984 | R | 4,866 | 125 | 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 Dropbox below
path = ""
screenRes = c(2559,1439)... |
c2b38cd38c76056efafcb0565b9e329ffa84c9223f0b4582db910c458f820c94 | R | 4,874 | 121 | # CREs with MPRA frVar & sneQTL
library(data.table)
library(dplyr)
library(GenomicRanges)
library(ArchR)
outp <- "/geschwindlabshares/RexachGroup/Xia_Data/atac_cellrangerOut/project0318/cisTopic"
# 1.1 ATAC peak set
# load CRE annotation
source("/geschwindlabshares/RexachGroup/Xia_Data/My_R_libs/pci_snATAC_peakSet_w_E... |
04cebf77e65976840486486605513d0c47dd262a17cfa7b30e8cf165ea3a280a | R | 4,875 | 213 | ---
title: "Impute probes with detectionP > 0.01"
subtitle: "Look at autosomal probes"
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
... |
4c5fc09c05b1a7e9300a31fcc519412705136ca5cf42176800eeea6b4f7e22d7 | R | 4,883 | 142 | #' Spatial registration: wrapper function
#'
#' This function is provided for convenience. It runs all the functions
#' required for computing the `modeling_results`. This can be useful for
#' finding marker genes on a new spatially-resolved transcriptomics dataset
#' and thus using it for `run_app()`. The results from... |
a3096fa23e9576b35724386fafbdf4b7dd51aca2eedb8e338fc629a4bea7f083 | R | 4,886 | 209 | ---
title: "Recalculate ROSMAP data DNAm residuals"
author:
- David Lukacsovich^[University of Miami]
- Lily Wang^[University of Miami]
date: "`r format(Sys.time(), '%d %B %Y')`"
output:
rmarkdown::html_document:
highlight: breezedark
theme: lumen
toc: true
number_sections: true
df_print: page... |
deafdc087a891ba199fa8e97aab435e2d5153604023b967ef094049fd983151c | R | 4,887 | 141 | #------------------------------------------------------SETUP-----------------------------------------------------#
# Load libraries
library(tidyverse)
library(data.table)
library(BuenColors)
library(Seurat)
library(irlba)
library(Matrix)
library(future)
library(reticulate)
library(ggrastr)
library(tidytext)
library(ma... |
a3faa2bf8c9f869c1121999a5cd0a20054642266f9d8f0a956630876796e1a2f | R | 4,891 | 142 | library(Seurat)
library(dplyr)
library(patchwork)
library(ggplot2)
#load integrated nodose data
data <- readRDS("/home/rstudio/shared_data/nodose/latest-integration-230403/nodose-integrated.RDS")
DefaultAssay(data) = "originalexp"
#PC30, resolution = 0.8
pdf("figure_QC_Vln.pdf", width = 12, height = 6)
VlnPlot(dat... |
5fa1efb9a71c448ea82f625ed48afaeaebd19e430371462becfe00acf3d44556 | R | 4,895 | 117 | # Distribution of MPRA snps
library(ggplot2)
library(dplyr)
library(data.table)
outp <- "QTL_fsVars/out"
p1 <- "resources"
f_snp <- "MPRA_list_of_variants.tsv"
f_effect <- "HMC3_MPRA_rep1rep2.tsv"
mpra_pos <- read.csv(file.path(p1,"MPRA_w_pos_GRCh38.csv")) # from 'MPRA_cal_fishertest"
dyn_inv_peaks_w_mpra <- read.csv(f... |
513f92a8a197c2b8dfc11c93f2af2e0bb39b75623078ae55f6b6296114b5cbc5 | R | 4,898 | 98 | #' Creation of SAHA object for analysis
#'
#' The `SAHA` class is used to store and manage data throughout the SAHA analysis workflow.
#' It holds information about query and database data, matched markers for different analyses,
#' and final analysis results.
#'
#' @slot query A list containing data frames for both ma... |
5e9be844adf3243aa5ba148af1631486694ebc4b62f0e1670dc67682cd94d590 | R | 4,898 | 162 | #After run multi-PC/resolution
#Calculate average silhouette width (ASW) of each cluster under different PC&Res
#ASW indicates the within-cluster distance between the cells,
#and the between-cluster distance of the cells to the closetest clusters
#Randomly select 25000 cells at pc30-60 and res0.6-2 and calculate thei... |
786d663198ac08cc7a37e7eb480dffa944e1ca651967b9f97c5fc8e692d42c88 | R | 4,900 | 147 | #------------------------------------------------------SETUP-----------------------------------------------------#
# Load libraries
library(tidyverse)
library(data.table)
library(BuenColors)
library(Seurat)
library(irlba)
library(Matrix)
library(future)
library(reticulate)
library(ggrastr)
library(tidytext)
library(ma... |
7adc71587a5c3243f679f719fc778089991179e868de4ba117d53df9e583ca55 | R | 4,903 | 151 | #------------------------------------------------------SETUP-----------------------------------------------------#
# Load libraries
library(tidyverse)
library(data.table)
library(BuenColors)
library(Seurat)
library(irlba)
library(Matrix)
library(future)
library(reticulate)
library(ggrastr)
library(tidytext)
library(ma... |
f9aa93491ce034c90e712719586b14658d1d31725987d6f58952ace825209bfe | R | 4,903 | 96 | ### ---- Example use of DMI brain ATLAS ---- ###
# Download this R script and the accompanying rds-files and place them in the same folder.
# Set working directory to location of current file.
library(rstudioapi)
setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
# Load packages
library(data.table)
li... |
77d135e5d52bab9fded47beeebdeb0ccfb68bfd675e9da5b0dcdad191fb70c3e | R | 4,917 | 168 | # Nicely format a difftime (seconds / minutes / hours)
format_duration <- function(dt) {
secs <- as.numeric(dt, units = "secs")
if (secs < 60) {
sprintf("%.1f s", secs)
} else if (secs < 3600) {
sprintf("%.1f min", secs / 60)
} else {
sprintf("%.1f h", secs / 3600)
}
}
# Remaining time across all... |
f707117ad43f042444b4f2d30b5a916d235639e7b09096eb206ac68aa81dad4a | R | 4,920 | 133 | #' banc-pn-by-connectivity — Name projection neurons by connectivity to known glomeruli.
#'
#' @section Reads:
#' - SeaTable `banc_meta`, CAVE upstream connectivity
#'
#' @section Writes:
#' - SeaTable `banc_meta`: col `cell_type` (PN-only, conditional)
#############################################################... |
bcc062b14b06202ae843a09d5f680640daf0b703f9010253a5bb6a112a756970 | R | 4,925 | 125 | #' Layer modeling correlation of statistics
#'
#' @param stats A query `data.frame` where the row names are ENSEMBL gene IDs,
#' the column names are labels for clusters of cells or cell types, and where
#' each cell contains the given statistic for that gene and cell type. These
#' statistics should be computed simila... |
24b3f8a8313f48c89177c1bac089134e5d13ca1fa0c22210003cb702e6af7466 | R | 4,927 | 132 | here::i_am("scripts/2.validations/2.2.pathway_enrichment/2.2.1.run_Reactome.R")
library(tidyverse)
library(ReactomePA)
library(plyranges)
library(parallel)
library(here)
dd <- here("data/neural_differentiation_dataset/CroCoNet_analysis/")
wd <- here("data/validations/pathway_enrichment/")
dir.create(wd)
## Load inpu... |
bbc7c9fd92d649a360fe8a69244d0ee2dc6a53861402fbe6c058f99e8257cdbe | R | 4,928 | 153 | #data
ADvsNC <- read.csv("D:/ADvsNC.meth.csv")
ADD10 <- read.csv("D:/ADD10.meth.csv")
#libraries
library(ggplot2)
library(patchwork)
library(dplyr)
library(ggrepel)
#prepare data
prepare_volcano_data <- function(data) {
data <- data %>%
mutate(
significance = case_when(
pvalue < 0.05 & ... |
d5e855f7a68d50bab03210d34838f651d3e72a1f28f77fab693d9e3c73dd4481 | R | 4,931 | 155 |
foverlaps4 <- function(DTx, DTy,
# Define upstream and downstream distances
prime5.upstream = 10,
prime5.downstream = 10,
prime3.upstream = 10,
prime3.downstream = 10) {
require(data.table)
# C... |
2b5979053935e5f194a272a484ad63537f52cdb30641869073c9b0116d17ca76 | R | 4,936 | 164 | rm(list = ls())
############################################
# Packages
############################################
pkgs_cran <- c("readxl", "openxlsx", "ggplot2", "tidyr", "dplyr", "reshape2", "rstatix", "tibble")
for (pkg in pkgs_cran) {
if (!requireNamespace(pkg, quietly = TRUE)) {
install.packages(pkg, dep... |
48da6d27ae13c0cabf290ed5fb3b8f8ab463cef6f3b1017bbb210cc5780b1a97 | R | 4,939 | 143 | #' Read CSV files containing raw agglomeration (merge) information
#'
#' @details Peter Li provided 10 CSV files with merge information in Aug 2018
#' against which this function has been tested. This merge information has
#' been processed to identify which groups segments should be merged together
#' in the \co... |
90caf47cc7cdbd9043da2075636e3fa964e93ec7cda08173ed43fc6d08ccfd88 | R | 4,940 | 105 | #conda activate twasguo
library("sqldf")
library("stringr")
library("data.table")
library("dplyr")
args <- commandArgs(trailingOnly=T)
###### I. paramter ######
tissue="breast" #colontrans, breast, lung, prostate
batch="2023"
model="DTL"
snpsubsets=c("50K","100K","200K","500K","1000K","1500K","2000K","3500K")
snpsu... |
fe7e0c8e7b3efc96f6a6ceadce9b6b10cfeeaaaa35c13b3496bc795e27751cde | R | 4,943 | 136 |
# Description: Analyzes and compares cis-derived predicted vs observed gene expression in testing data
# Load required libraries
required_packages = c("purrr", "limma", "dplyr", "tidyr", "tidyverse","data.table")
for(pkg in required_packages) {
if(!require(pkg, character.only = TRUE)) {
install.package... |
33a2dd1f4d8db7bcb95b6bc7902a92c74be468342d7eb6a9ce6a8e5c24e0e327 | R | 4,946 | 119 | library(openxlsx)
#pre-process raw data and save to file
ml_preprocess = function(datatype){
#get data (binding, anti escape, expression), maybe do pre-processing, and set endpoint/uncert names
if(datatype == "bind"){
indf = read.csv("Datasets/SARS-CoV-2-RBD_DMS/results/binding_Kds/binding_Kds.csv")
ind... |
db35cb2e5a71b8fc8486883621c406b9fa19167e5cb06cf8be0d2c0070ccd1ce | R | 4,949 | 161 | # =========================
# Figure 1F-style plots
# Koutsoumpari Nomiki
# June 2025
# adjusted for exporting source data by Johannes Algermissen, March 2025.
# =========================
# ============================================================================ #
#### Set directories, load packages and custom fu... |
1554848df989b12b37c371e5d5c2e36ec712d86ac77651c142deb5949b1cce57 | R | 4,959 | 99 | # Load necessary libraries
library(dplyr)
library(pheatmap)
library(Cairo)
library(ComplexHeatmap)
library(circlize) # For colorRamp2
################################################
################ Cell types ###################
################################################
# Define cell types to be analyzed
cel... |
31b8eb3e436b27465f937559efd7338f8cac37b673bde6e8af9617cb92261692 | R | 4,968 | 139 | library(tidyverse)
library(rstatix)
library(xlsx)
dfData = read.delim("F:/project/Code-Data-available/git/gene.txt")
dfClass = read.delim("F:/project/Code-Data-available/git/class.txt")
df = dfData %>%
as_tibble() %>%
pivot_longer(-1,names_to = "Sample",values_to = "value") %>%
left_join(dfClass,by=c("Sample" ... |
dddc9d673aacbff8fa39cf808ea7aecaf56f5e8100a85a3eafa6b7311890aa7a | R | 4,970 | 125 | #Follow-up
#follow up dataset curation
life_join_fu <- read_xlsx("~/Life-ADULT/pv801/data/data_follow-up/PV0801_datajoin.xlsx")
colnames(life_join_fu) <- paste0("fu_", colnames(life_join_fu))
colnames(life_join_fu)[1] <- c("SIC")
neuromorph_gm_fu <- left_join(neuromorph_gm_fu, pseudonyms, by = "ID")
neuromorph_gm_fu... |
f8cce6d0c0d69b0e27d1cce4d5a013fcee91afca9584641722717f74c7a4ae37 | R | 4,977 | 163 | rm(list = ls())
############################################
# Packages
############################################
pkgs_cran <- c("readxl", "openxlsx", "ggplot2", "tidyr", "dplyr", "reshape2", "rstatix", "tibble")
for (pkg in pkgs_cran) {
if (!requireNamespace(pkg, quietly = TRUE)) {
install.packages(pkg, dep... |
30d3ff7dbc693d2bb04e15bf7a235b9d1e88621a59723b69c8cdff4d44d94334 | R | 4,984 | 136 | # ============================================================================
# Figure 2G: DmrPERK vs ATF4KO — with individual replicate data points
# Journal requirement: show individual data points behind mean ± SEM
# ============================================================================
library(here)
# Sour... |
73072abd0773ee32952d17d1375d76352f3aefdd581a2c48090a4e677eec9195 | R | 4,990 | 153 | #------------------------------------------------------SETUP-----------------------------------------------------#
# Load libraries
library(tidyverse)
library(data.table)
library(BuenColors)
library(Seurat)
library(irlba)
library(Matrix)
library(future)
library(reticulate)
library(ggrastr)
library(tidytext)
library(ma... |
8e8e00de5b7cd05e61387cb4989949fdaf615f8b19c13e69dcbc7db8ae1fce05 | R | 4,997 | 122 | ##################################
# Report quality metrics for snRNA that ended up in the final analyses
# Author: Kevin Johnson
# Date Updated: 2024.06.12
##################################
library(tidyverse)
library(RColorBrewer)
library(viridis)
library(Seurat)
library(harmony)
library(presto)
library(EnvStats)
li... |
14d13b822f88c92fb327d0a18a5e29d7e9e94f56b3ef3bfb0732f74aa3c28e3a | R | 5,005 | 152 | ---
title: "final_paper_version"
author: "Iza"
date: "2025-07-17"
output: html_document
---
This document contains **your original code** with inline comments only. I did **not** modify function calls, variables, thresholds, or paths. Any caveats are noted with `# NOTE:` within the chunks.
```{r}
# PACKAGES (kept exa... |
b4b9808af4616ccd03e63be191927b2f0e24daddbb9c5f74d967dc7d83d2d538 | R | 5,005 | 135 | # ----------------------------------------------------------------
# The following script loads and processes data from:
#
# Kang, Dae-Wook, et al. "Differences in fecal microbial
# metabolites and microbiota of children with autism spectrum
# disorders." Anaerobe 49 (2018): 121-131.
#
# The output tables are:
# ... |
572c88205b9a81170a614c4bfb4cf001207172eb4a3b8a67317e040e2875f3d9 | R | 5,006 | 229 | ---
title: "Evaluate gene sets identified by SDAN"
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
params:
graph_weight... |
677664d66a6deb08dae77d7909e04e7153a9581dea2fda73ac7bd16a924f1b2a | R | 5,012 | 88 | #' ---
#' title: "Create gene features from human_gut"
#' author: "Jacob Ulirsch"
#' date: "July 12, 2018"
#' ---
#'
#+ cache = FALSE, message = FALSE, warning = FALSE, echo = FALSE, eval = TRUE
.libPaths(c(.libPaths(), "/PHShome/cl322/R/x86_64-pc-linux-gnu-library/3.4"))
library(tidyverse)
library(data.table)
#libra... |
8750bcb5a51d1cdc08c2b7eaea72c96dd1219bfc1a9baf73a0f7036ffa8e5b44 | R | 5,012 | 154 | default_memory_columns <- function() {
c("subjects", "trials", "rt", "R", "lR", "winner", "lM", "RACE", "TIMEOUT", "Rgo")
}
resolve_memory_columns <- function(dadm, model) {
keep <- default_memory_columns()
if (!is.null(model) && !is.function(model) && !is.null(model$trend)) {
trend <- model$trend
covs <... |
844f3b73c31c471bd4b15e8efdfc46634d5b32637581bb7435645c046436621c | R | 5,018 | 140 | context("test YARN helper functions")
# Helper: create a minimal ExpressionSet for testing
make_tiny_eset <- function(ngenes = 20, nsamples = 10) {
set.seed(42)
expr_mat <- matrix(rpois(ngenes * nsamples, lambda = 100),
nrow = ngenes, ncol = nsamples,
dimnames = list(paste... |
fde73297ceb05b757ed181008671287cc9472601a7df5de87f6e75db902edf16 | R | 5,018 | 95 | #' Auto-annotates query clusters with best matching database cell types
#'
#' This function offers three auto-annotation options based on the `data_type` argument:
#' - "Markers": Uses the minimum p-value from the annotation data (`ann@ann2`)
#' to identify the best matching cell type for each query cluster.
#' ... |
5491a0264c0a5e446ecb427ba8401802cc0d04480f38dbb03926256969417d24 | R | 5,024 | 140 | #' Spatial registration: compute enrichment statistics
#'
#' This function computes the gene enrichment t-statistics (one group > the
#' rest). These t-statistics are the ones typically used for spatial
#' registration with `layer_stat_cor()` and related functions.
#'
#' @param block_cor A `numeric(1)` computed with `r... |
1db409e677185acdd5707c8004a252c55260adb116cc085f00959a4b64ba1731 | R | 5,027 | 147 | ---
title: "Unified Hypnogram Trimmer"
author: "Emily Stanyer"
date: "`r Sys.Date()`"
output:
html_document:
toc: true
df_print: paged
params:
input_dir: "Data/raw/EEG/hypnograms_txt"
trim_mode: "N2N3" # OPTIONS: "REM" or "N2N3"
file_glob: "*.txt"
has_header: FALSE
delimiter: "\t"... |
155bd71cee916d8b59c6b0d8050939ab69ae8ee5ad37c9b952b3262c3ea818c8 | R | 5,029 | 119 | ---
title: "MVPA Statistical Analyses"
output: html_document
---
```{r, echo=TRUE}
knitr::opts_chunk$set(echo = TRUE)
library(lmerTest)
library(dplyr)
library(readr)
library(emmeans)
library(multcomp)
library(tidyr)
```
```{r}
extract_stats <- function(m, coef_names) {
model.df = data.frame(coef_names, summary(m)$c... |
5e6a80555f5cebba697df60bb74061425570f4debcc305155a9509f6ff99e805 | R | 5,029 | 159 | #------------------------------------------------------SETUP-----------------------------------------------------#
# Load libraries
library(tidyverse)
library(data.table)
library(BuenColors)
library(Seurat)
library(irlba)
library(Matrix)
library(future)
library(reticulate)
library(ggrastr)
library(tidytext)
library(ma... |
cf1ea25eb51388d512384899466c59e2c8934f4cc07ab7e0efba8ba13131a5c5 | R | 5,029 | 188 | ---
title: 'WGCNA modules - make embeddings matrix'
author: "Jon Thompson, Pers lab"
date: "`r Sys.time()`"
params:
date: !r substr(gsub("-","",as.character(Sys.Date())),3,1000)
randomSeed: !r 12345
pValThreshold: !r 0.05
nrepBootstrap: !r 1e4
output:
html_notebook:
df_print: paged
number_sections: yes
t... |
af49c4e1345c0cc5ba7368052a53fd29a102ca0eee8f4cfc204f7b1739174720 | R | 5,031 | 128 | # 加载必要的包
library(dplyr)
# 创建数据框
data <- data.frame(
Feature = c("LM", "OFT", "EPM", "L/D box", "FST"),
# F1CON 14列数据
F1CON1 = c(5.2138, 21.00035, 54.99999, 60.99999, 107.333328),
F1CON2 = c(7.9386, 25.80094, 48.99999, 42, 145.333344),
F1CON3 = c(5.1037, 24.18107, 102, 72, 94.000008),
F1CON4 = c(4... |
ea99378094e99cbe62a7745428c8695fba5448e3bfe930957aab7c6097647ed7 | R | 5,033 | 153 | #------------------------------------------------------SETUP-----------------------------------------------------#
# Load libraries
library(tidyverse)
library(data.table)
library(BuenColors)
library(Seurat)
library(irlba)
library(Matrix)
library(future)
library(reticulate)
library(ggrastr)
library(tidytext)
library(ma... |
248194c64280bd24a1657ed8bfda9de086a996e6580eee19db58db3c87b2ab29 | R | 5,035 | 142 | #' @title Brunner-Munzel tests for symptom mapping (slow)
#'
#' @description
#' Lesion to symptom mapping performed on a prepared matrix.
#' Brunner-Munzel tests are performed using each column
#' of the matrix to split the behavioral scores in two
#' groups.
#'
#' @param lesmat binary matrix (0/1) of voxels (columns)
... |
88b5b410beb2e3c2ee590a77e2016150812d2370d057f294d265ba0ceca29b87 | R | 5,037 | 154 | #' Fetch data specified by a set of curl shell commands (e.g. from Chrome)
#'
#' @details You can generate an appropriate set of commands by opening the
#' Chrome Developer console (View ... Developer ... JavaScript Console),
#' (re)loading a page of interest, selecting the network tab, selecting a
#' downloaded ... |
aea146ce1a77d464e19ad9e6ac7a724e2ce7177394d3a11f74cf802d78409442 | R | 5,048 | 133 | library(ggplot2)
library(reticulate)
library("rstan")
library(rethinking)
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 fi... |
d158a7c3513d82a4946669c0b2d9187a69ba9bf5c57b424c5a66913ef1fc2aaa | R | 5,054 | 173 | ---
title: "Baseline Demographic and Clinical Variables Analysis"
author: "Dr Emily Stanyer"
date: "`r Sys.Date()`"
output:
html_document:
toc: true
toc_float: true
df_print: paged
params:
data_file: "Data/raw/demographics/baseline_data.csv"
out_dir: "Output/demographics"
---
```{r setup, include=FAL... |
bd28097297e481ca039d3e28f2972cd9f637c5381b9aa58f2313190ea864e8f5 | R | 5,058 | 149 | #' Save LK Searchlight Results to HDF5
#'
#' This module provides functions to structure and save Lattice Kriging results
#' in a hierarchical HDF5 file using reticulate and variograd_utils.core_utils.save_hdf5.
#'
#' Each section (parameters, searchlight, models) is built as a list,
#' then combined into a single nest... |
9ad1a31e7d368ed7616c9b7847b0dbe3f25870098273749c4e7735900dbf703d | R | 5,060 | 230 | ---
title: "Ambra Villani's microglia RNA-seq, custom plots on 11th Apr 2025"
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_prin... |
38aa188226d76b8a64378ce7d184a0d026a285792e06140f3210997e97b4491e | R | 5,067 | 157 | #!/usr/bin/env Rscript
#-------------------------------------------------
# Title: Outlier removal
# Author: Amanda Zacharias
# Date: 2023-08-02
# Email: 16amz1@queensu.ca
#-------------------------------------------------
# Notes -------------------------------------------
# module load nixpkgs/16.09 gcc/7.3.0 r/3.6.0... |
52161863692f4d65f628b8dcd947146257abd44cb8841c582abbf447dcb5bc59 | R | 5,067 | 136 | # ============================================================================
# Figure 1A: Venn Diagram - DATA PROCESSING SCRIPT
# ============================================================================
# This script processes the ISR gene lists from three sources:
# - GO Consortium
# - AnyGenes
# - JacksonLabs (... |
e9ff5f0f32a3c69eace67cde0c0200fd6982d2d874f3b6314915262489f11500 | R | 5,067 | 109 | # wd <- '/net//mraid20//export/tgdata/users/yonshap/proj/mmcortex/'
wd <- '.'
# setwd(wd)
library(grid)
source(file.path(wd, 'scripts/util.r'))
library(metacell)
scdb_init('scdb',f=T)
mc_rna <- scdb_mc('pl_cort')
mcmd <- readr::read_tsv(file.path(wd, 'output/metacell_model/mcmd_pl_cort.tsv'))
mcmd <- mcmd[-c(602:603... |
372cf70db80c2b4398a97a1e82867fd167a1ffbda4df4e3ca9e08e177b96f278 | R | 5,069 | 160 | ---
title: "plotMultiverse"
author: "Maurizio"
date: "3 9 2021"
output: pdf_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, fig.height=8)
```
```{r, message=FALSE}
# load packages
if(!require("pacman")){install.packages("pacman")}
p_load(here, R.matlab, stringr, plyr, ggplot2)
```
... |
ce1398713ff379264a10b8c62dfe17577dc1979b9fd5d2ec416620903f324132 | R | 5,069 | 167 | library(tidyverse)
library(qs)
library(ComplexHeatmap)
library(circlize)
library(ggrepel)
trainingPtype <- readRDS('data/GDSC2_Res.rds')
trainingExprData <- readRDS('data/GDSC2_Expr_RMANormalized_and_LogTransformed.rds')
trainingPtype <- exp(trainingPtype)
tcga_gbm_tpm <- qread("data/TCGA-GBM_tpm.qs") %>% as.matr... |
16262e213a8ce44c76d75e67bb7a2f876a1b25bdeb2cdf3dbd11b4fd0c5fe005 | R | 5,072 | 150 | rm(list = ls())
############################################
# Packages
############################################
pkgs_cran <- c("ggplot2", "openxlsx", "reshape2", "rstatix")
for (pkg in pkgs_cran) {
if (!requireNamespace(pkg, quietly = TRUE)) {
install.packages(pkg, dependencies = TRUE)
}
library(pkg, ... |
063730b02076a0f20affe5d214f9bdc425c59dd408bfbc860c5e78057b422123 | R | 5,078 | 87 | ############################
# List of modules for GSEA #
############################
# AD GWAS
bellengez <- read.delim("C:/Users/User/Documents/Drive_PC/Lucas/GitHub/ROSMAP-MOFA/MOFA_real/Raw_data/new_genes_list/gene_lists/AD_GWAS/gwas_ad_bellengez2022.txt")
AD_GWAS <- as.list(bellengez)
names(AD_GWAS) <- 'AD... |
bf3ddb59d9f741d8d5661123cca488eb517163e184449fb48ea6281e7df829f2 | R | 5,081 | 122 | #library(misc)
library(GenomicRanges)
## The pileup function from the Rsamtools package generates coverage information for each position in the genome,
## reporting coverage for each nucleotide type separately, that is
## it outputs the number of reads that align to that position with each type of nucleotide
require... |
06959d0f2a4dd5c9fce7343d4ec96d0d9ada74950cbb9e01b56ff2878d16e813 | R | 5,085 | 128 | # open R
srun -n 10 -p interactive --pty /bin/bash
module load cluster/gsl/1.15
module load cluster/htslib/1.9-devel
module load cluster/build_tools/llvm/8.0
module load cluster/util/gcc/8.2
module load hdf5_18/1.8.21
conda activate r_env
#conda deactivate
R
library(ggplot2)
# MAGMA plot
setwd("/cluster/home/irod... |
9f673b75b79236cb42162a277323a050e6231235daacdade9ed5f4a369552037 | R | 5,085 | 132 | ##################################
# Perform GO term enrichment for each MP (50 genes) for CAREmut malignant states
# Author: Kevin Johnson
##################################
# This analysis was not used in the final version of the paper, but provided further support for metaprogram annotation based on Gene Ontology t... |
219413131a0d5c1185fc37663c0556f502605269c25a90a1a58cd5557ae35f08 | R | 5,088 | 184 | # packages
setwd(Sys.getenv("HOME"))
suppressPackageStartupMessages(library(argparse))
source("R_func/mutate_load.R")
source("R_func/future_load.R")
source("R_func/seurat_load.R")
library(SeuratDisk)
library(MetaNeighbor)
# parameter
parser <- ArgumentParser()
parser$add_argument("-obj_list", "--obj_list", requir... |
cd608d0478c93820c3a016211a20710d9e7d6de76b23cd01859b96e18bc9eb78 | R | 5,097 | 176 | #!/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", "--RData", required=TRUE, help="clustered RData with pmat")
parser$add_argument("-n"... |
005d57924653efd063c7f397087b48a1ee1526712e2889420c6911d7e09825fa | R | 5,099 | 125 | #############################
# PCA Outlier Selection Script
# MTLE outliers: PC2 < 0
# NL outliers: PC2 > 0
#############################
library(dplyr)
###############################################################
##################### Use TPM Count matrix ####################
####################################... |
00265bd4920c3852dc7c573ecdfa323d800f616d0ea2b40fcc15149b61bd4593 | R | 5,103 | 79 | ########################################################################################################
#### Trial dataset for this R script can be downloaded from ####
#### https://data.mendeley.com/datasets/454s2vw255/1/files/bfc0a880-afb9-4c72-8c58-afadc85cf53e ####
##... |
b46b5e7576366895eff2f1a9a2f7c40a14ffab3d7c1d548681bc1529235c1036 | R | 5,108 | 233 | ---
title: "Evaluate gene sets identified by SDAN"
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
params:
cell_type_na... |
a393ed9bb91de08b40c25e3e5c221b1ab11cc996b9c80be1d5aeb4a586acab20 | R | 5,110 | 78 | rm(list = ls())
### Functions to use
glmCal = function(expr){
InteractionEstimate <- InteractionPvalue <- AltEstimate <- AltPvalue <- CaseEstimate <- CasePvalue <- InterceptEstimate <- InterceptPvalue <- NA
fit_res = try(withWarnings(expr), FALSE)
if(sum(grepl("Error", fit_res))==0) {
fit = try(fit_re... |
1dca6711319c13ca31812c82307480cd6ff83319344336b09109325df8220aa5 | R | 5,113 | 136 | here::i_am("scripts/2.validations/2.7.POU5F1_LTR7_enrichment/2.7.5.get_CREs_near_SPP1_and_SCGB3A2.R")
library(BSgenome.Hsapiens.UCSC.hg38)
library(BSgenome.Ggorilla.UCSC.gorGor6)
library(BSgenome.Mfascicularis.NCBI.6.0)
library(tidyverse)
library(plyranges)
library(here)
library(rtracklayer)
wd <- here("data/validati... |
1ad3d984d83e3f9babb5797e029ee2c206d7c7cd0ce35c912262d141e3a74812 | R | 5,116 | 114 | library(tidyr)
library(dplyr)
library(stringr)
library(readr)
library(here)
library(magrittr)
library(purrr)
library(conflicted)
conflict_prefer("first", "dplyr")
conflict_prefer("rename", "dplyr")
conflict_prefer("select", "dplyr")
conflict_prefer("filter", "dplyr")
conflict_prefer("count", "dplyr")
#load top hits, f... |
8f0cfd9a033a9af454715b5227d9ac97944e764ae579cbf10289ed48846cbc78 | R | 5,116 | 173 | # Package Installation and Loading for Fly Connectome Tutorial
# =============================================================
# This script handles all package dependencies for the tutorial
# Core R packages
# ---------------
packages_core <- c(
"arrow", # Reading feather/parquet files
"tidyverse", ... |
e55c3dfc9325d3e8ba33fd4d77d92878345c845c8ff321410e3e3bf3a2260dbe | R | 5,116 | 130 |
require(rcompanion)
require(broom)
require(dplyr)
require(mgsub)
# library(pbapply)
# Set working directory to project root
# setwd("path/to/project/root")
tissues = c("dlpfc","dACC","sACC")
sites = c("CMC_EUR")
out.dir = c("./predictions/Combined/")
## load genes
load("./predictions/Combined... |
369acb4b6f2e462e91704ceb0801934dbc06e0328cc61493290b70b235d958de | R | 5,123 | 117 | #' banc-fanc-skel-transform — Transform FANC neuron skeletons into BANC space.
#'
#' For each FANC v1.116 root_id, fetches the skeleton via `fancr`/neuprint
#' and applies the FANC → JRCVNC2018F → BANC registration chain. Saves
#' the transformed SWC to the per-version BANC NBLAST skel tree.
#'
#' @section Reads:
#' ... |
9c63068d4977cdd19c2c674114e3cf6e42cf28182c0343f2f3cc2d45ef3503df | R | 5,126 | 93 | #################################
## Compare the gene overlap between CAREmut NMF metaprograms and other gene lists
## Author: Kevin Johnson
## Updated:2026.04.03
#################################
library(RColorBrewer)
library(viridis)
library(tidyverse)
library(scales)
proj_dir <- "/vast/palmer/pi/verhaak/kcj28/... |
779ae5d9f0018fb02c86be78ffb457120fee69bff9aa3562c2fde7411190e5dc | R | 5,133 | 202 | ---
title: "Fig_3I_MalignantCell_DEG_post_vs_pre"
output: html_document
date: "2026-02-17"
---
---
title: "Fig_S4R_Malig_cells_GSEA_Hallmark"
output: html_document
date: "2026-02-17"
---
```{r}
library(devtools)
install_github("alserglab/fgsea") # dependency for clusterprofiler
remotes::install_version("yulab.utils"... |
96883ae617714a350e907dd9672f79b25725eb0999ff9e1f83e65131a3e15b83 | R | 5,139 | 105 | ##################################
# Create a visualization for pathway-based metaprogram scores across malignant cell states.
# Author: Kevin Johnson
##################################
library(tidyverse)
library(EnvStats)
library(ggpubr)
proj_dir <- "/vast/palmer/pi/verhaak/kcj28/care_idh_mut"
source(paste0(proj_... |
c4d2eaa5c8f87e5c6f7033e8e552e72fe572758105c828e21f8c5b9828fd5cb3 | R | 5,147 | 106 | ##### Integration of the Combined Dataset #####
# Remove all assays except RNA
DefaultAssay(tanycyte) <- "RNA"
assays_to_keep <- "RNA"
tanycyte@assays <- tanycyte@assays[names(tanycyte@assays) %in% assays_to_keep]
#QC filtering and measuring the percentage of mt- and Rps, Rpl genes
tanycyte[["percent.mt"]] <-... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.