sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
8affd32ef56410615474368396b26c8c80b1f4d51e62da6fb43be71e08f9727b | R | 11,214 | 254 | #' @title Register lesions in template space
#'
#' @description
#' Brings lesion maps in template space by registering the
#' subject\'s anatomical to the template and applying the
#' same transform to the lesion. To improve the registration
#' the anatomical image is bias corrected and denoised. In
#' addition, you ca... |
21236842c199e1b07b66212d1180398f4c4323a9989d75ddfb1a19843b085fd3 | R | 11,216 | 350 | # ===============================================================
# 🎨 Module for colors customization
# ===============================================================
# ---- Palette ----
basic_color_palette <- c(
"steelblue" = "#4682B4",
"red" = "#FF0000",
"green" = "#008000", # ✅ web green (not ggp... |
5ec605989778c5e3cbb47f689be57919447f6cf2022dcce7fbcc71f5141cc3f6 | R | 11,216 | 310 | library(ordinal)
library(tidyr)
library(dplyr)
library(lmerTest)
library(BayesFactor)
library(bayestestR)
library(emmeans)
library(ggplot2)
library(ggeffects)
library(rlang)
library(afex)
"
The following are the eye-tracking data analyses for experiment 1 of the Cogitate Consortium.
The models below follow pre-regis... |
c5b5213fa65e179a7440decf00706a38a539d3b1c9d2ab853e13fe23dbd1c288 | R | 11,217 | 303 | #' banc-al-review-images — Generate comparison PNGs for AL connectivity mismatches.
#'
#' For each row in `al_connectivity_mismatches.csv`, render a three-mesh
#' comparison PNG: BANC neuron (blue), curated SeaTable-type FAFB neurons
#' (red), connectivity-matched FAFB neuron (green). Uses `fafb_match`
#' where availab... |
ae59470c856ca86b815e10381382f416db06686b6580f16a4d86e02bb589524f | R | 11,240 | 295 | # ==============================================================================
# Script 01: Supplementary Figure 1 - Genotypic Similarity Analysis
# ==============================================================================
# Description: Performs genotypic similarity analysis between ICLE and Marcotte
# ... |
a70737f34ac6a1daa370462d5fb6ac16ecb658f251fbeeaa6c6732788f040986 | R | 11,261 | 241 | # ----------------------------------------------------------------
# The following script loads and processes data from:
#
# Yachida, Shinichi, et al. "Metagenomic and metabolomic analyses
# reveal distinct stage-specific phenotypes of the gut microbiota
# in colorectal cancer." Nature medicine 25.6 (2019): 968-97... |
bd55b4cf11bfbad7ebf13c587b16e0a3677a4ef312488857b38c291ef57be467 | R | 11,266 | 289 | # ============================================================================
# Figure 1G: ISR Score Boxplots - DATA PROCESSING SCRIPT
# ============================================================================
# This script prepares data for boxplots of ISR (Factor 1) scores by condition.
# Generates CSV output fo... |
b4bddabc12463d4d53b5f7c8efbb12a5233bafcf5f0f9766e5846e13428f4bdb | R | 11,278 | 308 | #' Null-coalescing operator
#' @noRd
`%||%` <- function(x, y) {
if (is.null(x)) y else x
}
#' Set Python Environment for InfluenceCalculator
#'
#' Configure the r-reticulate Python environment for use with the ConnectomeInfluenceCalculator
#' Python library.
#'
#' @return Invisible TRUE if successful
#' @export
#'
... |
74efee07aaa9a954080b67ab1609fcae59c32dea22ca8897190d1e2d0d397c25 | R | 11,280 | 287 | ####### Script to identify spine clusters and spine types #######
## 0. required packages
## 1. spine morphology - spine types + normalisation
## 2. spine number & distribution - cluster + normalisation
## 3. example genearlised linear model taking nested data structure into account
#####
### 0. required packages
in... |
685baa600fa6a59566d064fe0380ebaea4122c0384ed5b3c6abec5bf39f653d5 | R | 11,281 | 309 | # ===============================================================
# ?? Regression shared exports
# ===============================================================
write_lm_docx_combined <- function(flat_models, file) {
if (length(flat_models) == 0) stop("No models provided for export.")
anova_entries <- list()
... |
971b900e5ecb0405c4934998d98da7c32608e435f69f877eea33209879f95e5a | R | 11,286 | 352 | ---
title: "Get correlation between PHC_MEM and DNAm_residual or PHC_pTau"
author:
- David lukacsovich^[University of Miami]
- Lily Wang^[University of Miami]
date: "`r Sys.Date()`"
output:
rmarkdown::html_document:
highlight: pygments
theme: lumen
toc: true
number_sections: true
df_print: pa... |
02dac82f7895db2593a5db0518500f568efd4033f6a445118222be911be9d729 | R | 11,338 | 460 | #!/usr/bin/env Rscript
# use new version
suppressPackageStartupMessages(library("SnapATAC"))
suppressPackageStartupMessages(library("GenomicRanges"));
suppressPackageStartupMessages(library("foreach"))
suppressPackageStartupMessages(library("doParallel"))
library("umap")
library("leiden")
library("tictoc")
inputF <- ... |
5ed40320f7e4f3b5dd8d133977861d130a85dd113c385aca953fa6a3ca472752 | R | 11,345 | 483 | ---
title: "Create a Venn Diagram comparing hyper and hypo methylated DMRs and CpGs in AD vs Aging"
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: t... |
53f4b3bb82d9487cdb812a88f9b06c01bc7cb1c5525682b199a18cb6f9aa2dd8 | R | 11,354 | 330 | no.extension <- function(filename) {
if (substr(filename, nchar(filename), nchar(filename))==".") {
return(substr(filename, 1, nchar(filename)-1))
} else {
no.extension(substr(filename, 1, nchar(filename)-1))
}
}
extract.ages <- function(file = NULL, replicates = 1, cutoff = NULL, random = T... |
75f3df0c5bdccad286cdac0404f972b045b63bf289f6aa1f3e4642bb6f7c66b3 | R | 11,360 | 485 | ---
title: "Create a Venn Diagram comparing hyper and hypo methylated DMRs and CpGs in AD vs Aging"
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: t... |
22535b6d56c4edf21451d955c7531964a0e3f8aecb453c7186ddc4556f812e43 | R | 11,388 | 284 | library(data.table)
library(openxlsx)
library(protr)
source("R/combined_ml.R")
source("R/score_funs.R")
#model driver, save plots to file
same_holdout_plotter = function(plot.type = "scatter", ml = "rf", feats = "mixed"){
set.seed(1234)
#first get variants only in version 3
indata = read.csv(... |
d754852de1503bcd618ebaec434d11f18802017836cab0cd3091b00e7519b1f1 | R | 11,413 | 374 | library(circlize)
results <- read.csv("D:/GeneMatch/GO.ADvsADD10.Meth.GS.25000.csv")
top_pathways <- head(results[order(results$pvalue), ], 12) ############set to 7 ofr normal
#Split geneID into individual genes and create pathway-gene pairs
pathway_genes <- lapply(1:nrow(top_pathways), function(i) {
genes <... |
b1066353527a4012d5b65679ad58219a781a93a6feabf1cdbf3491c7b0c40dfb | R | 11,425 | 174 | # ==============================================================================
# Script 13: Figure 2H - CDH1 Alteration Landscape (TCGA + Cell Lines)
# ==============================================================================
# Description: Generates multi-omic CDH1 heatmaps showing mutation, copy number,
# ... |
a0e6d7c18549e79d12fb156b9245cf6e50f6390256aae2bfdd0a3231bcb0cb30 | R | 11,426 | 287 | # ============================================================================
# Figure 4E: Proliferation Scores by Death Place Comparison
# ============================================================================
# This script compares proliferation scores between tissues with significant
# HI>ER vs ER>HI ISR patt... |
362481494df88c351b1e377b1fbc173a4266bf2196a3d74487e4d3803a08b175 | R | 11,432 | 228 | ###*****monocle3--------
Excitatory <- readRDS(file = "./temporal_lobe\\subcluster\\Excitatory\\resolution8\\Excitatory_anno_cluster_1.rds")
library(Seurat)
library(monocle3)
data <- GetAssayData(Excitatory, assay = "RNA", slot = "counts")
cell_metadata <- Excitatory@meta.data
gene_annotation <- data.frame(gene_short... |
d043aa8ad506d0faef312d2548c11ef1751b4da3a5b094272a6059f58eb4878a | R | 11,445 | 229 | library(Seurat)
library(Matrix)
library(dplyr)
library(ggplot2)
library(reshape2)
# library(MAST)
library(cowplot)
setwd("/histor/sun/wangtao/0_user/3_shixh/singlecell/choline/sc/Hippocampus/12samples-mt20-filter/QC")
################################ Integrate scRNA-seq data from 3 wild-type and 3 homozygous mice usi... |
e21b6d8231b306dd431864de75e22050f840a0850bdcf7570228a5620f377c6a | R | 11,459 | 229 | # ===============================================================
# ADD-ON:bar plots (padj-based) for CHCHD10
# - Reads DEG data
# - Extracts CHCHD10
# - Saves summary table + bar plots
# ===============================================================
suppressPackageStartupMessages({
library(dplyr)
library(... |
f9c14120448d0f876e4ce8b771d70b4c390ec8f3e6619e6db19de50f94b28534 | R | 11,502 | 284 | #' banc-update-status — Update status flags + side assignments in SeaTable.
#'
#' Computes status flags (LR_TYPE_CONFLICT, SIDE_CONFLICT, UNROOTED,
#' TOO_SMALL, FAFB_MATCH_WRONG_SIDE, MANC_MATCH_WRONG_SIDE, NO_*_MATCH,
#' TRACING_ISSUE_RESOLVED, CONFLICT_RESOLVED, *_TYPE_CONFLICT) and side
#' from `root_position_nm`. ... |
f72376f32e1709a49d9ba6bd4beff92bb497dd5627b5be99275f7eec62d12441 | R | 11,517 | 212 | # wd <- '/net//mraid20//export/tgdata/users/yonshap/proj/mmcortex/'
wd <- '.'
# setwd(wd)
source(file.path(wd, 'scripts/util.r'))
library(grid)
library(gridExtra)
load(file = file.path(wd, 'output/mcatac/fig4_atac_data.rda'))
load(file = file.path(wd, 'output/methylation/fig4_meth_data.rda'))
mcmd <- readr::read_tsv... |
7d6387d7e1127c4f22db48dc5123b5aed13a004b0e0a2a8d352f106bc642d306 | R | 11,521 | 230 | ---
title: "Introduction to sleuth"
author: "Harold Pimentel, Nicolas Bray, Pall Melsted and Lior Pachter"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Introduction to sleuth}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
## Overview
__sleuth__ is a... |
4734287dc410aee874f3c93fdaa69093fe913ae7f947775940899e4411793c10 | R | 11,536 | 358 | .initializeMat <- function(
ArrowFile = NULL,
Group = NULL,
Class = "Double",
Units = "none",
cellNames = NULL,
featureDF = NULL,
params = NULL,
date = Sys.Date(),
force = FALSE
){
#Add Group Entry of SparseMatrix Format
#This Includes the following format
#
# Info
# - Class - Sparse.I... |
bfed2abade322fe70049c2d64f7693d0133ff435e7a6e48cb52d18d8b0809c1e | R | 11,550 | 216 | ########################################################################################################
#### Trial dataset for this R script can be downloaded from ####
#### https://data.mendeley.com/datasets/454s2vw255/1/files/fd399949-da35-4e3a-897a-acb831fcf0cf ####
##... |
b7dabfc58950926f5f24e22ad2f39cfce4677483ac2410834e6c0dc8782970b0 | R | 11,555 | 314 | ##########################
# SCRIPT TO PERFORM GSEA #
##########################
library(fgsea)
library(MOFA2)
library(foreach)
library(reshape2)
library(matsbyname)
library(dplyr)
# Retriving MOFA
load("C:/Users/User/Documents/Drive_PC/Lucas/GitHub/ROSMAP-MOFA/MOFA_real/Raw_data/mofas/standart_50f.RDATA"... |
bdebf98a677a065112abcf4080520f9dcfbfe019ac6895f177d8ac5f4b390a82 | R | 11,555 | 231 | #############################################################################################
# PLOT THE RELATIONSHIP WITH FACTORS AND COVARIATES AND THE VARIANCE EXPLAINED BY PHENOTYPE #
#############################################################################################
library(MOFA2)
library(reshape2)
... |
487407e59136d59f44daf05ea76546f66cda7014b9ad78ae892d3e80b7f0a8a3 | R | 11,572 | 590 |
library(ggplot2)
#common gems for individuals wrt to a treatment
common_gens <- function(x, i_stds, ngens, treat, par, tol) {
i=1
thisx <- x[i_stds[1:ngens],3]
thisy <- thisx-x[i_stds[1:ngens],3-treat]
#print(length(thisy[(-1)^par*thisy>0]))
thisins <- which((-1)^par*thisy > t... |
b11f6125b0f2f26d500b129c8696113793de04f467ef1926663d1fd84555c240 | R | 11,596 | 252 | #######################################
# Factors enrichment characterization #
#######################################
library(dplyr)
library(reshape2)
library(ComplexHeatmap)
# Function to identify terms through keywords
find_matches <- function(pathway, keywords) {
matches <- keywords[sapply(keywords, fu... |
639087fbada3ff61d1cc6a5b5313141214d3fd0c128c8d03b9704067ca5d9749 | R | 11,606 | 328 | ## Aims
#
# 1. Reproduce upsetplot
# 2. Expand the function of upsetplot
# 2.1 Allow non-unique intersections
# 2.2 More applicable subplot types (boxplot, points), useful to show subsets properties
## Structures
#
# 1. plot and subplots
# 2. themes
# 3. subsets processing [see regions.R]
## (PART) Plot
#' Pl... |
3b14261d13541749e39302bbdfe2f6e8a18c47a6b84915dcc781acaf46fa6efc | R | 11,610 | 209 | ########################################################################################################
#### Trial dataset for this R script can be downloaded from ####
#### https://data.mendeley.com/datasets/454s2vw255/1/files/b5ca5b96-c7a0-48f1-aee9-43565b5c322a ####
##... |
d2f2b8fc258e63f1f30504da5725a24fccc4705ea6dfec9272ecf3873d48f3c3 | R | 11,641 | 291 | # Portrait divergence comparison - bootstrap sample dist vs real data ####################
# Load packages
library(dplyr)
library(tidyr)
library(ggplot2)
library(grid)
library(ggpubr)
# Working directory
#setwd("~/FC-Network-Replicability-Effects")
############# Pipeline Effect ######################################... |
dd970c7f2ccf3a36b06e0fc71c7c4bb37b351c3ee0cc553d976c67f746f564df | R | 11,657 | 321 | #' Plot a TSS Enrichment Plot for Each Sample
#'
#' This function will plot a TSS enrichment plot for each sample. Cells in `ArchRProject` are the only ones
#' used when making this plot.
#'
#' @param ArchRProj An `ArchRProject` object.
#' @param groupBy The name of the column in `cellColData` to use for grouping cell... |
b89320e1ba4631e7d08e99c2b7e70b7893803e50c1227db6415553d2e915d1dc | R | 11,668 | 275 | context("databricks-utils")
library(withr)
test_that("mlflow creates databricks client when scheme is databricks", {
with_mocked_bindings(.package = "mlflow", get_databricks_config = function(profile) {
config_vars <- list(host = "databricks-host", token = "databricks")
config <- new_databricks_config( ... |
414b2bcd08f7f1bec62b4cfa58bfe3c2052a3dc88248cbb00ea9138281323499 | R | 11,674 | 324 | ---
title: "Combined Sleep Spindle & Slow Oscillation Analysis"
author: "Dr Emily Stanyer"
date: "`r Sys.Date()`"
output:
html_document:
toc: true
df_print: paged
params:
# ---- INPUTS ----
spindle_file: "Data/raw/EEG/spindles/spindle_data.csv"
so_dir: "Data/raw/EEG/SOs"
blinding_file: "Data/raw/EEG/b... |
86cee5e6dd57d7bc26d41b069f8345c40576f193b011462d99efbc9f042a3860 | R | 11,685 | 285 | #' Add Module Scores to an ArchRProject
#'
#' This function calculates a module score from a set of features across all cells. This allows for
#' grouping of multiple features together into a single quantitative measurement. Currently, this
#' function only works for modules derived from the `GeneScoreMatrix`. Each mo... |
3fe043fe7849422660fdf2c7270aa0b63c6fb2ad5bf237d11939428a171ba788 | R | 11,699 | 236 | #' Creates marker-based visualizations for cell type annotation
#'
#' Generates various visualizations based on marker-based cell type annotation results stored in the `ann` object. Requires cell type metadata in the `meta` data frame for adding cell type class information as facets.
#'
#' @param ann An SAHA analysis o... |
208cb479f7de9c939a307de746c2cadc86f7a142eca3bdb50a06bb8111438fa0 | R | 11,701 | 247 | #!/usr/bin/env Rscript
################################################
################################################
## REQUIREMENTS ##
################################################
################################################
## PCA, HEATMAP AND SCATTERPLOTS FOR SAMPLES IN CO... |
94159afbe0637556955203dd2a6fe72713deb64409299ca02242302759faa419 | R | 11,711 | 338 | #' Plot gene expression across spatial coordinates
#'
#' Visualizes expression of selected genes on a spatial plot using
#' cell coordinates and expression matrix.
#' Can display expression for all cells or a subset
#' (e.g., by cluster or manually specified cells).
#' Also supports splitting the plot using metadata co... |
33c435ec24fc3f7470f6dac1cfe5fb7b7aa7b82fcc287c6380f8897a12a9aaba | R | 11,730 | 321 | ---
title: "Fig_S4Q_Malignant_cell_state_by_sample"
output: html_document
date: "2026-02-17"
---
Note: This script re-calculates cell state scores and identity from gene expression. Cell state calls are also already present in the seurat object provided on GEO
```{r}
library(Seurat)
library(dplyr)
library(stringr)
li... |
8798c3097e5deafa639cd2fca09b4520e1d2699f304a146bd66f6346a095f784 | R | 11,758 | 290 | ###################### UMAP for Pipeline and Atlas ############################
# Packages
library(umap)
library(ggplot2)
# Working directory
#setwd("~/FC-Network-Replicability-Effects")
############ UMAP Full Network ######################################
# Load data
load("Data/processed_data_network_regressed.RDat... |
99b4bb31dd56e48e4276c410c5e752340405a711daa9f6a0b0e84cc3302497a0 | R | 11,761 | 312 | ###############################################################################
## 3.9 Cross-Database Pooled Dotplots ##
## Creates pooled GSEA dotplots with: ##
## - Gene Ratio on X-axis (correctly calculated) #... |
66e6deb9ede79041d9f6249f7d65bf54b3cdde53d6b5651a5b53e12229262bf4 | R | 11,763 | 272 | # Written by Nanbo Sun, Angela Tam & CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md
Args = commandArgs(TRUE)
print(Args)
sessionInfo()
mat18 = Args[1]
link_colorscale = Args[2]
min_thre = as.numeric(Args[3])
max_thre = as.numeric(Args[4])
outname = Args[5]
if (!require(... |
a2a4884af4eb7a9979b99d87f898788f2b98cbd1b053b5a7c453f3b582cbafc9 | R | 11,766 | 356 | rm(list = ls())
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)
source('~/SCRIPTS/utility_functions.R')
set.seed(1234)
#####
## LOAD CO... |
03805b9315f38e7207fe9d043bb0cf11056c194c9eac89f093e75bdf1c1d5886 | R | 11,789 | 314 |
# These functions are used for data processing and analytics
#' Load single cell RNA-seq data from directory or file
#'
#' @param metadata A dataframe - must contain a column named "sample", and a column named "folder" or "file".
#' @param ... Additional arguments to be passed to the function \code{\link{CreateSeura... |
d46eb62508e6c953b6204ebebcf466f80e90235b290d16b391fbb8d603275b30 | R | 11,789 | 203 | library(neuprintr)
library(malevnc)
library(bit64)
library(tidyverse)
library(ggplot2)
library(ggpubr)
library(Matrix)
library(cowplot)
choose_malevnc_dataset("MANC")
#get the whole maleVNC matrix, these first steps will take quite some time
mdf = manc_dvid_annotations()
query.ids = as.integer64(mdf$bodyid[!(mdf$statu... |
fc9a08339813303b67ce72f5d5635222f2dbfac39803966acf3b3e6d742b6ee5 | R | 11,796 | 336 | # Targeted DESeq2 analysis for an a priori hypothalamus gene set
# Requirements:
# - Working directory contains:
# quants/ # per-sample Salmon quant directories
# tx_id.txt, gene_id.txt # transcript-to-gene mapping inputs
# sampleInfo.csv (or sampleInfo_2.csv) with SampleID, c... |
7598d36b312dd71b9b25cd5ef0b5732b14463923b69577c944e350a48898203f | R | 11,810 | 303 | #' banc-calculate-regions — Assign region of innervation per BANC neuron.
#'
#' Tests L2-skeleton neuropil containment to assign each neuron one of
#' `ventral_nerve_cord`, `central_brain`, `optic_lobe`, `brain`, `rind`.
#' Incremental.
#'
#' @section Reads:
#' - SeaTable `banc_meta`, L2 SWCs
#'
#' @section Writes:
#... |
dab1d76b6b37ffc059518ec6061c4867291bcaa5168f67762ae9d05b4e5b00cd | R | 11,814 | 333 | ####################################################################
# Gene Activity Score Methods
####################################################################
#' Add Gene Expression Matrix to ArrowFiles or an ArchRProject
#'
#' This function, for each sample, will add gene expression values from a paired scA... |
2b60c9e311c9c88d0f5c40724438edcaa8957d4e683ff4ad1c0c663bc6dec60c | R | 11,835 | 221 | # MODEL FITTING: whole-brain co-fluc amplitude DEPENDENT CHANGES IN regional co-fluctuation score.
library(dplyr)
library(R.matlab)
library(ggsegGlasser)
library(ggsegSchaefer)
library(ggseg)
library(ggplot2)
library(ggdensity)
library(ggseg3d)
library(cifti)
library(stringr)
library(factoextra)
library(matrixStats)
li... |
88e88d827ca079031edae01e3df974f2267f7e90b096add343a8bf2df34b6e0b | R | 11,846 | 249 | find_duplicate_indices <- function(df) {
df <- as.data.frame(df)
# Convert dataframe rows to character strings for fast comparison
row_strings <- do.call(paste, c(df, sep = "_"))
first_occurrence <- !duplicated(row_strings)
index_map <- match(row_strings, row_strings[first_occurrence])
return(index_map)
}
... |
2b7860b36def396e9ebef15dec25c015ddae6ce7060e63cb67b0cf9d763f2bef | R | 11,853 | 333 | # Environment ------------------------------------------------------------------
library(here)
library(tidyverse)
library(gtsummary)
library(glue)
library(flextable)
library(officer)
source(here("src", "R", "is_binary_column.R"))
# Data I/O ---------------------------------------------------------------------
# ABCD... |
860faf7b90a57505f04da8f3ea3d54f12de98c6d63af603d4b61a2ab844dc278 | R | 11,854 | 292 | # Frobenius norm comparison - bootstrap sample dist vs real data ####################
# Load packages
library(dplyr)
library(tidyr)
library(ggplot2)
library(grid)
library(ggpubr)
# Working directory
#setwd("~/FC-Network-Replicability-Effects")
############# Pipeline Effect ###########################################... |
c9f907d400b6d7670f927e99073f164d4e81e4a7629f2a36f863c9a1f84ca9b0 | R | 11,864 | 337 | library(lightgbm)
library(Hmisc)
library(caret)
library(randomForest)
library(e1071)
library(nnet)
library(xgboost)
library(catboost)
library(adabag)
library(dplyr)
library(stringr)
library(ROCR)
library(pROC)
library(neuralnet)
all_file_paths <- "D:\\work2\\t2dAndComplicationsUkb\\data\\processed\\Lass... |
91eced2acb8dcb3ba162ca50a76657be8f8a32fa6ad07e0e51201924c21d86ae | R | 11,873 | 377 | #' Access PCA from sample
#'
#' @param sample sample from which to access PCA
#' @rdname getPca
#' @export
setGeneric("getPca", function(sample) standardGeneric("getPca"))
#' @rdname getPca
setMethod("getPca", signature("Pagoda2"), function(sample) sample$reductions$PCA)
#' @rdname getPca
setMethod("getPca", signat... |
c0942727a9aaad8883bd356e6df0b6c28865d8de7485652fa4fc5dfb5aa4e4c0 | R | 11,884 | 287 | # Association between EDT and HGF parameters
## Model setup and posterior predictive checks
```{r edt, fig.height=6}
# set some priors
priors = c(
prior(normal(0, 0.50), class = Intercept),
prior(normal(0, 1.00), class = b),
prior(normal(0, 0.50), class = sigma)
)
# fit the model
m.edt = brm(EDT ~ sbe1 + sbe2... |
53e8887575546af678958e778c12bfd2b889a66b243ad6ba48a777aa18d37b81 | R | 11,905 | 340 | ---
title: "Ambra Villani's microglia RNA-seq, custom plots"
author: "Izaskun Mallona, Mark D. Robinson's lab, UZH"
date: "`r format(Sys.time(), '%d %B, %Y')`"
output:
html_document:
toc: true
toc_float: true
code_folding: hide
code_download: true
number_sections: true
df_print: kable
them... |
4b4dbc783a5e651a9a4434b9bd12f7d5b512f5a354071df5ee42f128896d64b4 | R | 11,930 | 316 | #!/usr/bin/env Rscript
# =====================================================================
# Omics ML Pipeline (General, Tabular Data)
# Author: Your Name
# Version: 0.1.0
# Dependencies: caret, randomForest, xgboost, nnet, tidyverse, pROC, VennDiagram
# =============================================================... |
7919c84a005dd7db47d1375ba5acaf19a5baf937917905722eac67977f245edc | R | 11,945 | 198 | ---
title: "Building PANDA Regulatory Networks from GTEx Gene Expression Data in R"
author: Camila Lopes-Ramos
date: 2020-10-19
output:
rmarkdown::html_vignette:
toc: yes
vignette: >
%\VignetteIndexEntry{Building PANDA Regulatory Networks from GTEx Gene Expression Data in R}
%\VignetteEngine{knitr::rmarkdown}... |
c795911a28da5880bd97388ce51e1d1df78d9a13347e4313e96fcd719be653ec | R | 11,946 | 326 | #Find differential expressed genes comparing fed and fasted
library(Seurat)
data<-readRDS("diet_nodomap_cleaned.RDS")
DefaultAssay(data) = "originalexp"
data <- SetIdent(data, value = "seurat_clusters")
levels(Idents(data))
#Subset sn-RNA seq inhouse data
table(paste0(data$Dataset, data$Nutr.cond))
inhouse <- subse... |
a307f66ed837f5c9f2644c1bf4803494c1078b7dda98853a99dc914259813fcb | R | 11,951 | 350 | ---
title: "Guide to Multi-Gene Plots"
author:
- name: Nicholas J. Eagles
affiliation:
- &libd Lieber Institute for Brain Development, Johns Hopkins Medical Campus
email: nickeagles77@gmail.com
- name: Leonardo Collado-Torres
affiliation:
- *libd
- &biostats Department of Biostatistics, Joh... |
4d0065922d08044d6bee16b19aa5229c74bc8b08f6432348b0c93f8b3443c646 | R | 11,958 | 263 | #' banc-update-seatable-clusters — Push spectral cns_cluster + cns_network to SeaTable.
#'
#' Reads the canonical v888 v2 spectral CSV, joins on `root_888` (NOT
#' `root_id` — root_id is live/dynamic, root_888 pins to the version the
#' spectral pipeline wrote), and overwrites both `cns_cluster` and
#' `cns_network` co... |
78fe3d13d5f7209c3fe64d1250ad6b406e5ad6a1ee85b278f1addc20bab36d3a | R | 11,959 | 418 | # l2.var: the variance of the prior, so the penalty is 1/(2*l2.var)
# l2.var.pos: the position of the covariates that applied to l2 penalty
fast.logistf.fit.WithL2 <- function (x, y, weight = NULL, offset = NULL, firth = TRUE, col.fit = NULL,
init = NULL, l2.var=NULL, l2.var.pos=NULL, cont... |
2fdfefc4c2dc492480b22f0e9e0868b258794b9c79df8f5a611d4ddd0389cd61 | R | 11,966 | 337 | library(ggplot2)
ggmiami2 <-
function (data,
split_by,
split_at,
chr = "chr",
pos = "pos",
p = "p",
chr_colors = c("black", "grey"),
upper_chr_colors = NULL,
lower_chr_colors = NULL,
upper_ylab = "-log10(p)",
... |
ca07454db7a2f0d67cb899e9e50d84b2f3cb19b0624efe6eddf0be8238e52bd8 | R | 11,993 | 174 | ---
title: "Multivariable MR Tutorial"
author: "Wes Spiller, Eleanor Sanderson, and Jack Bowden"
date: "31^st^ January 2021"
output: html_vignette
vignette: >
%\VignetteIndexEntry{Multivariable MR Tutorial}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r setup, include=FALSE}
knitr::opts_c... |
180de33c5547fe5245d98377a070b5ff1709a80a1b03cc7d28d3e8df38b49df7 | R | 12,012 | 294 | #' banc-calculate-ntpred — Per-neuron neurotransmitter predictions from per-synapse classifier.
#'
#' Joins external `synister_banc` per-synapse NT parquet (K. Dasari) to the
#' versioned v2/v3 synapse table; computes per-neuron NT + confidence plus
#' cell-type consensus.
#'
#' @section Reads:
#' - `synister_banc/ba... |
4e6cbed3451d28da51c9db8a55254e24e9b042f800940523f44650c9bcbfd377 | R | 12,022 | 196 | library(here)
library(sessioninfo)
outdir <- "spatialLIBD_files"
pkgname <- "spatialLIBD"
meta <- data.frame(
Title = c(
"habenula_atlas_HD_spe_cell",
"habenula_atlas_HD_spe_cell_pseudobulk",
"habenula_atlas_visium_spe",
"habenula_atlas_visium_spe_pseudobulk",
"habenula_atl... |
cb197892b4f0dd6397f3563547e395dec1cea74abc3c9bf7c1eed6a8d9b2300e | R | 12,034 | 378 | ---
title: "Guide to Spatial Registration"
author:
- name: Louise Huuki-Myers
affiliation:
- Lieber Institute for Brain Development
email: lahuuki@gmail.com
output:
BiocStyle::html_document:
self_contained: yes
toc: true
toc_float: true
toc_depth: 2
code_folding: show
date: "`r doc... |
40be8e1e556b2f65090cfab508e789ba132aba907716a3cbe8d8e8a482b8f61e | R | 12,040 | 309 | ---
title: "RNA-seq glia/hemocytes/neurons analysis"
author: "Thomas Boutet"
date: "2/23/2025"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Library
```{r library}
library(DESeq2)
library(dplyr)
library(ggplot2)
library(ggdendro)
library(gridExtra)
library... |
2713add3e51f81db545fe7fe8fc76ad3366844028d760d93b458a72285dfbd32 | R | 12,042 | 315 | #!/usr/bin/env Rscript
#' Generate Rasterized FDR Volcano Plots
#'
#' Creates volcano plots with rasterized points but vector text and plot elements.
#' This allows for easy editing in vector graphics editors while handling plots
#' with many data points efficiently.
#'
#' @description
#' This script:
#' 1. Loads the c... |
80885183e4722dfe1e56f3ef7593b722b280400caf93eb215c3db146d9c2211d | R | 12,052 | 368 | #############################
#
ReadGroupFile<-function(groupFile){
#groupFile = "./SAIGE_GENE_Test/group_multiSets_2.txt"
group_info_list<-list()
line=0
gf = file(groupFile, "r")
while (TRUE) {
line = line+1
marker_group_line = readLines(gf, n = 1)
if (length(marker_group_line) == 0) {
bre... |
8922f7eee094b536745d55248d1719d78f3a262979d3b39f7a5cc7c1a3206aef | R | 12,055 | 314 | # =============================================================================
# INGENE: LIBD-GTEx vs LIBD-LIBD vs CMC Predictions
# =============================================================================
# This script identifies replicable genes across datasets by comparing
# INGENE predictions independentl... |
512147d30974c38709421295bb1ae48c47287e8ba915d64e808f3aa5935d6966 | R | 12,057 | 314 | # =============================================================================
# MODULE: LIBD-GTEx vs LIBD-LIBD vs CMC Predictions
# =============================================================================
# This script identifies replicable genes across datasets by comparing
# MODULE predictions independentl... |
9864595791e838dc3fa6934d5fcca0aa9d63c7cc127bbe0050c2225ff9fb672c | R | 12,058 | 308 | #' Plot the gene set enrichment results with ComplexHeatmap
#'
#' This function takes the output of [gene_set_enrichment()] and creates a
#' ComplexHeatmap visualization of the results. Fill of the heatmap represents
#' the -log10(p-val), Odds-ratios are printed for test that pass specified
#' significance threshold `O... |
aef42ebc580b505822c81f67988503b6d3dc24b5b1702842219408a85e7115ad | R | 12,108 | 312 | #' Extract annotations from a neuroglancer scene into a dataframe
#'
#' @param x A neuroglancer scene or URL (passed to
#' \code{\link{ngl_decode_scene}} as necessary) or a neuroglancer layers
#' (\code{\link{nglayers}}) extracted from such a scene.
#' @param layer Optional index vector specifying the layers within... |
da5d0dffc493e226b6e5925e47a8d4b4acc0faf81bc261f8ffb64ce29353bd64 | R | 12,114 | 263 | ##################################
# Plot malignant states across IDH-mutant hierarchy previously described by Tirosh et al.
# Author: Kevin Johnson
# Date Updated: 2026.04.10
##################################
library(tidyverse)
library(RColorBrewer)
library(viridis)
library(ggpubr)
library(EnvStats)
library(scales)
... |
39c6153026036c786dbe40958f4e21b054aad7a1a5831c88373ebf870dc5d6b3 | R | 12,120 | 314 |
###################################################################################################
# Code with this aesthetic means code that may need to be changed
###################################################################################################
#rm(list = ls())
# install.packages("data.table")
... |
bcc94fcc0e98c7b68f00c15e781bd8a2beed979da6d380a7f3935d61e68f3732 | R | 12,148 | 263 | library(dplyr)
library(lme4)
library(lmerTest)
library(readr)
library(effectsize)
library(reshape2)
library(ggplot2)
library(ggpubr)
# Set the seed for reproducibility
set.seed(42)
nboots <- 5000
# Function to extract statistics from the model
stats_models <- function(model) {
fixed_effects <- coef(summary(model... |
73942bdc10913022188085fdd743571f17f0f37ff66c4229804e2ab600c15e41 | R | 12,161 | 361 | rm(list = ls())
library(dplyr)
library(plyr)
library(Seurat)
library(ggpubr)
library(reshape2)
library(tidyr)
library(tidyverse)
library(DropletQC)
library(readr)
source('~/SCRIPTS/utility_functions.R')
#####
## LOAD COUNT MATRIX
#####
# Only the caudate samples
srrMeta = read.table('~/workdir/MACAQUE/HE/Macaque_He_S... |
e255acf95117c4d626af840a6418c30ae78795595852f7e64118bbcad7225f38 | R | 12,177 | 363 | context("Model Registry")
get_mock_client <- function() {
client <- new_mlflow_client_impl(
get_host_creds = function() {
new_mlflow_host_creds(host = "localhost")
}
)
return(client)
}
test_that("mlflow can register a model", {
with_mocked_bindings(.package = "mlflow",
mlflow_rest =... |
6fb8ffc10d2c3764d0459acc2b62c633504746e0b9dab32be88499c8fbfd705b | R | 12,221 | 369 | #!/usr/bin/env Rscript
suppressPackageStartupMessages({
library(Seurat)
library(SeuratObject)
library(dplyr)
library(ggplot2)
library(reshape2)
library(SingleCellExperiment)
library(scDblFinder)
library(scuttle)
})
# ============================================================
# Purpose
# =========... |
d25a2db8019c9e0079cc569c0206df8fa93db844094d185229d6c5f0fa8fcf89 | R | 12,244 | 320 | test_that("dr_fafbseg works", {
expect_output(dr_fafbseg(), "java", ignore.case=TRUE)
})
test_that("pyids2bit64 works", {
skip_if_not_installed('reticulate')
skip_if_not(reticulate::py_available())
reticulate::py_run_string('import numpy as np')
sids=c("720575940625861628","720575940621611957")
sids64=bit... |
86c92cba3032c07a34475ab89e10877fdf1904142d3c540ef939876545da88af | R | 12,247 | 244 | # 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 ... |
5287518098c2ce8c8420aa76d6e65845b61fa50f7fc9d9f761aae340dd0a126d | R | 12,252 | 189 | library(here)
library(sessioninfo)
library(tidyverse)
outdir <- "spatialLIBD_files"
pkgname <- "spatialLIBD"
meta <- tibble(
Title = c("visiumStitched_brain_spe", "visiumStitched_brain_spaceranger", "visiumStitched_brain_Fiji_out"),
Description = c(
"SpatialExperiment object at the spot-level for the ... |
e71a5b35ff8784a101394272702bac9729eef6720e2187e1637f762023494752 | R | 12,257 | 257 | #' banc-malecns-nblast — Pairwise BANC ↔ maleCNS (v0.9) NBLAST.
#'
#' Iterates per super_class (motor + visceral_circulatory first). Resumable.
#'
#' @section Reads:
#' - SeaTable `banc_meta`, `malecns_09_meta.csv`, maleCNS BANC-space skeletons
#'
#' @section Writes:
#' - `<banc.nblast.malecns.save.path>/results/<v... |
437bbc9416ac8bbe3c39c1bfbae5462d5badc701a023bdbf81a3a6de945c4032 | R | 12,261 | 268 | context("Tracking - Experiments")
teardown({
mlflow_clear_test_dir("mlruns")
})
test_that("mlflow_create/set/get_experiment() basic functionality (fluent)", {
mlflow_clear_test_dir("mlruns")
artifact_relative_path <- "art_loc"
experiment_1_id <- mlflow_create_experiment("exp_name_1", artifact_relative_path)
... |
4d4da47873ee6fb757d7f774232e6829b81ae532c114e9b5ddef666c398e300e | R | 12,266 | 276 | make_info <- function(samples, type){
info <- list(
subjects = samples$subjects,
par_names = samples$par_names,
n_pars = samples$n_pars,
n_subjects = samples$n_subjects,
prior = samples$prior,
type = type,
model = samples$model
)
info <- bridge_add_info(info, samples, type)
}
eval.... |
827c3d9448e5672a80bf878c6ad62d2b303634f829ce606c9dba08588a13725c | R | 12,270 | 288 | suppressPackageStartupMessages({
library(dplyr)
library(tidyr)
library(purrr)
library(ggplot2)
library(stringr)
})
find_repo_root <- function(start = getwd()) {
current <- normalizePath(start, winslash = "/", mustWork = TRUE)
repeat {
if (dir.exists(file.path(current, "Validation")) &&
dir.ex... |
343ed843042623d3e1ddbd020f7a2a704871633f5a185dbd9e32a619a730af07 | R | 12,282 | 249 | # ----------------------------------------------------------------
# The following script loads and processes data from:
#
# Wang, Xifan, et al. "Aberrant gut microbiota alters host
# metabolome and impacts renal failure in humans and rodents."
# Gut 69.12 (2020): 2131-2142.
#
# The output tables are:
# 1) metada... |
27035a2ca387e895cd6a1c6a7956bcd8410a69949219467ac74034ea31107a81 | R | 12,300 | 321 | ####################################################################################
###############--------------- DESCRIPTIVE STATISTICS ---------------###############
####################################################################################
### In this script:
# (1) Demographics
# (2) Psychiatric comorb... |
0cb8f49c077714512111261c46ae596cab303a09272433f58c887f05c8a55f57 | R | 12,307 | 359 | #' Plot gene expression across spatial coordinates
#'
#' Visualizes expression of selected genes on a spatial plot using
#' cell coordinates and expression matrix.
#' Can display expression for all cells or a subset
#' (e.g., by cluster or manually specified cells).
#' Also supports splitting the plot using metadata co... |
232f098e917c08dae6e30e65c0f808d0e3647656a4b9de9d1d385e654d0612c1 | R | 12,308 | 159 | 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_RegionVsClinical')
#### Load in related information
# Statistics of Sig/Sug
tmp <-... |
cafc39528fbc5f73881ea6a6ecfa291551b28335c17c4cb2ca5e2d702ada76fe | R | 12,324 | 307 | #1)PE types: one/more to one/more relationshps for E-P P-G --> Five combined types
## "df.PEG"
#2) PE existense: majorgroups + subgroups
## "dt.glCRE.MajorGroupExist" "dt.glCRE.groupExist"
#3) PE differential state : P/E is DA? G is DEG?
## "PEGinfo"
library(ggplot2)
add<-theme_set(theme_bw())+
theme(axis.tit... |
b4abfa885006200ec950b75811e3e8b63de0c262f911f4e9f2f9b34157e80699 | R | 12,372 | 386 | #' Get Relevant Data For ArchR Tutorials
#'
#' This function will download data for a given tutorial and return the input files required for ArchR.
#'
#' @param tutorial The name of the available tutorial for which to retreive the tutorial data. The main option is "Hematopoiesis".
#' "Hematopoiesis" is a small scATAC... |
21f20e89704db5027863d9ef6d7c2147c8d8dc959672605b059020bbe047a4b4 | R | 12,373 | 168 | #' Compare preservation statistics
#'
#' Compares the two topology-based preservation statistics - correlation of adjacencies (cor_adj) and correlation of intramodular connectivities (cor_kIM) - in terms of their ability to distinguish actual modules from random ones and to capture the expected decrease in module prese... |
a82f5af51fdb30757e72daec692d0ffdfbc7bbb9b63ffdb9c48755a6e509bf5a | R | 12,374 | 272 | #' Runs unsupervised version of MetaNeighbor
#'
#' When it is difficult to know how cell type labels compare across datasets this
#' function helps users to make an educated guess about the overlaps without
#' requiring in-depth knowledge of marker genes
#'
#' @param var_genes vector of high variance genes.
#' @... |
f7cc89a1767410f543cd415cb950feef039efd04b6512f8d0e56927c2e23374f | R | 12,380 | 317 | # ==============================================================================
# Script 17: Figure 3C - Chromothripsis Identification (ShatterSeek)
# ==============================================================================
# Description: Runs ShatterSeek on ICLE CNV + SV data to call chromothripsis events.
# ... |
61dd5c2f080334c49d2e4a47878836620d57510410cd7afed875050f908cfa96 | R | 12,396 | 283 | ---
title: "Installing python modules: cloudvolume, meshparty and skeletor"
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
## tl;dr
Experts disagree on the best method to install Python and its associated packages.
For those users whose principal use of Python will be f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.