sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 17k | content stringlengths 1 200k |
|---|---|---|---|---|
a93ac7ec1ecf54af0199d09f426e0b21cbc59083f9f3c5284bdb4f979e1e3bb5 | R | 4,240 | 112 | cli::cli_h2("┗ [Vasc-AoP] Setting project's plots & tables' themes")
#---------------#
####🔺Colors ####
#---------------#
bg_color_light <- "white"
primary_color_light <- "black"
secondary_color_light <- "#0d6efd"
bg_color_dark <- "#222"
primary_color_dark <- "white"
secondary_color_dark <- "#20c997"
strip_color <... |
e7a4cae4397b669d0245439c5fa88d6e4b1ed103b4f70a929092a05e1bca652b | R | 4,283 | 102 | library(Seurat)
library(tidyverse)
library(cluster)
#library(factoextra)
library(dendextend)
library(weights)
library(ggpubr)
library(matrixStats)
library(readxl)
base_dir <- "/n/scratch/users/s/sad167/EPN/scRNAseq"
resources_dir <- file.path(base_dir, 'scripts/resources')
source(file.path(resources_dir, 'single_cell... |
7152b0c31d8da39321038b6a08f0b6f2a954f38958b8ba6582a155794a9732fc | R | 4,322 | 120 | library(ggplot2)
library(dplyr)
library(cowplot)
library(here)
library(tidyr)
## Environment --
here::i_am("Rscripts/Figure_S1_Spontaneous_Aggregated.R")
## Functions --
generate_boxplots <- function(input_data, X, Y, min,max){
data<-as.data.frame(input_data)
#Ensure correct ordering of levels
#data$Genotype <... |
4b5d9820a7df444edecc0180eab9d1466bf5d2377fcfac67c2b87a6a230b9c50 | R | 4,327 | 182 | library(tidyverse)
library(synExtra)
library(synapser)
library(powerjoin)
# Select ROSMAP samples that use rRNA depletion instead of poly-A enrichment
# in library prep. Can't quantify repeat transcripts in samples prepared
# using poly-A enrichment
synLogin()
syn <- synDownloader("~/data", .cache = TRUE)
rosmap_cl... |
d260ec2a0262e29c937953747212f0216b992e8bff004d93d9e28f1293fc8d8c | R | 4,342 | 168 | #!/usr/bin/env Rscript
library(broom.mixed)
library(dplyr)
library(lme4)
library(lmerTest)
library(optparse)
library(tidyverse)
library(vroom)
has_random_effect <- function(formula) {
length(lme4::findbars(formula)) > 0
}
fit_model <- function(formula, data, ...) {
if (has_random_effect(formula)) {
model <- ... |
bf820027050a28d3e6a0f6ff0cc6ff88bf878901da180325906e175337636f15 | R | 4,345 | 157 | ### Indexing functions from:
# https://stackoverflow.com/questions/39005958/r-how-to-get-row-column-subscripts-of-matched-elements-from-a-distance-matri
## 2D index to 1D index
# IMPORTANT: Modified for transposition of rows/columns.
# If j > i, swap i and j to return the appropriate distance (using the fact that
# t... |
d569adcffbee82a5fa576984e0b28fc21365701240b80bde342666caed9ccbaa | R | 4,347 | 144 | library(here)
library(ggplot2)
library(dplyr)
library(nlme)
library(cowplot)
library(tidyr)
library(emmeans)
## Environment --
here::i_am("src/Figure_3_TH_staining.R")
generate_violinplots <- function(input_data, X, Y, min,max){
data<-as.data.frame(input_data)
ggplot(data=data,aes(x={{X}},y={{Y}}, fill={{X}})) ... |
f9209c159495bc3247e8bb123b96e4c8d17cd9e3a192cdda9d7dbf16c80cc224 | R | 4,351 | 149 | ---
title: "VWFA_methods_LMEs"
author: "Jamie Mitchell"
date: "2025-07-22"
output: html_document
---
Set Up
```{r setup-pt1}
library("lme4") # for linear mixed effects models
library("tidyverse") # for wrangling
library("glue") # for setting paths
library("lmerTest") # for linear mixed effects m... |
830f6cc29f0d63c9a8ffd7fc1ee0fd67c31d159d97f3472b1fb975df6b0e78af | R | 4,361 | 55 | ## This R code facilitates the creation of a boxplot with overlaid scatter points for grip strength data, categorized by the variable 'Virus' and colored according to 'Light'. Modifications to the R code will be required for other behavioral datasets.# Sample data:grip strength data, grouped by Virus and colored by Lig... |
b0a9fb7b19ce8a1fa79abad66abf0f8ba567c248312e75723b5ce9e483852cf9 | R | 4,376 | 103 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(multcomp)
source("src/scales.R")
ref_pcs <- read_csv("processed/reference_sorted.csv", show_col_types = FALSE)
y <- scale(ref_pcs$GrainYield[ref_pcs$Set == "Train"])
yc <- attr(y, "scaled:center")
ys <- attr(y, "scaled:scale")
ref_pcs <... |
968d868c16b05edd024fcc733383eeb99920e9894ba87d0b0d52c67112cc4dcd | R | 4,378 | 75 | # Function to preprocess the xenium sequencing output (creates seurat object, find markers for
# different resolutions and score the signatures)
# spatially_subset_coords is a vector storing 4 numerics (xmin, xmax, ymin, ymax) indicating how to spatially subset the sample
# This function both saves the processed file ... |
8d8fdd48301180a380e3d381625eed888174a94841cb10a66bb67e7e614c751f | R | 4,391 | 72 |
prepare_test_datasets = function(subset_n_rows = NA) {
### example dataset and application of MS-EmpiRe following the documentation at: https://github.com/zimmerlab/MS-EmpiRe/blob/master/example.R
f <- system.file("extdata", "c1_c3.data", package = "msEmpiRe")
p <- system.file("extdata", "c1_c3.pdata", package =... |
1760748d6c8e8f41063dedc47df3d2be10edffb4cfb6b4945b196ee312aeb131 | R | 4,401 | 129 | #'@title Pairwise multilevel comparison using adonis
#'
#'@description This is a wrapper function for multilevel pairwise comparison
#' using adonis() from package 'vegan'. The function returns adjusted p-values using p.adjust().
#'
#'@param x Data frame (the community table), or "dist" object (user-supplied distance m... |
f3240e2db26586e2b7284f76df070e898080aa268299f760b6ceff1015d2b577 | R | 4,410 | 141 | library(dplyr)
df <- read.csv("Analysis_Files/ASO/ASO Wire Hang - Wire_Hang.csv",header=TRUE)
df$SLC_Genotype <- factor(df$SLC_Genotype, levels= c("WT","HET", "MUT"))
### Data Wrangling ---
df <- df %>%
group_by(MouseID) %>%
mutate(Exclusion = ifelse(all(Sincerity_Score_Relaxed == "Insincere"), "Yes", "No"))
v1 ... |
53218a7feac3a95e6f8a5a26929ec0fb2c9f034715952a4fb016c1e872299fb0 | R | 4,418 | 129 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(keras3)
library(kerastuneR)
HyperModel <- PyClass(
"HyperModel",
inherit = HyperModel_class(),
list(
build = function(self, hp) {
clear_session(free_memory = TRUE)
model <- keras_model_sequential(input_shape = c(28... |
08a9c8c3655e03d7f68589f1b94ac1527bd9f7596d2d04cf23651961349ae8d4 | R | 4,419 | 143 | ## These are utility functions not meant to be exposed to the user
#' @importFrom methods slot
#' @importFrom Matrix rowSums
.check_empty <- function(x, attribute){
# check if a Milo object slot is empty or not
x.slot <- slot(x, attribute)
if(is.list(x.slot) & names(slot(x, "graph")) == "graph"){
... |
0dd1e0637eb0964a6a7a59d902e6c97aff4e4e47b24217b9f10d8c43e31764c8 | R | 4,422 | 128 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(tensorflow)
tf$config$list_logical_devices()
library(keras3)
library(kerastuneR)
HyperModel <- PyClass(
"HyperModel",
inherit = HyperModel_class(),
list(
build = function(self, hp) {
clear_session(free_memory = TRUE)
... |
6528123bc3fb2d2b02b201b87384f5bf0a6a012a249ae204054a1cff6c840b46 | R | 4,430 | 127 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(tensorflow)
tf$config$list_logical_devices()
library(keras3)
library(kerastuneR)
HyperModel <- PyClass(
"HyperModel",
inherit = HyperModel_class(),
list(
build = function(self, hp) {
clear_session(free_memory = TRUE)
... |
6a29f6045759d8408755960b075472e8c5e4628396ec74fa8999bbbac71b977e | R | 4,466 | 167 | #!/usr/bin/Rscript
pkg.list <- installed.packages()[,"Package"]
if (!("argparse") %in% pkg.list) {
install.packages("argparse")
}
if (!("zeallot") %in% pkg.list) {
install.packages("zeallot")
}
# taken from:
# https://stackoverflow.com/questions/47044068/get-the-path-of-current-scriptk
getCurrentFileLocatio... |
6e4b7d04e60b188ce0b2002b23d7ae592dc51fefcdae0a54407379360a087fad | R | 4,469 | 137 | #'@title Pairwise multilevel comparison using adonis accepting strata
#'
#'@description This is a wrapper function for multilevel pairwise comparison
#' using adonis() from package 'vegan'. The function accepts interaction between factors and strata.
#'
#'@param x Model formula. The LHS is either community matrix or di... |
15bd0faf8d0b1857f30d59ae3dc3ea05081d4cf55645404e39874f8e17a7606a | R | 4,480 | 134 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
source("src/kernel_functions.R")
### Load the hybrid marker matrix ---------------------------------------------
# From Lopez-Cruz et al. (2023)
pcs <- read_rds("09.pc_comparison/hybrid_pc_scores.rds")
### Load the reference pedigree list ----... |
6fa1095e2112340a409784f627aa343f9e58c6d0696c90324a7e6862d2c77c1a | R | 4,495 | 122 | library(here)
library(ggplot2)
library(rlang)
library(rstatix)
library(nlme)
library(cowplot)
library(ggbeeswarm)
library(ggpubr)
library(ggsignif)
library(knitr)
library(here)
here::i_am("Rscripts/MPTP/MPTP_Rotarod.R")
data <- readr::read_csv(here("Analysis_Files", "MPTP","MPTP_Rotarod.csv"))
data$SLC_Genotype <- f... |
f570b056727c231e19aa91937a17f5702569fe674c29f52c6154e91849096e94 | R | 4,530 | 136 | # CPM --------------------------------------------------------------------
.calculateCPM <- function(countData) {
CPM <- apply(countData,2, function(x) { (x/sum(x))*1000000 })
return(CPM)
}
# TPM ---------------------------------------------------------------------
# accounting for gene lengths
.calculateTPM <... |
1fda3c3e3decb4e5d8a8d0416ff0732b9b0c1dbd3f689a887b770091df98852d | R | 4,561 | 126 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(tensorflow)
tf$config$list_logical_devices()
library(keras3)
library(kerastuneR)
library(abind)
HyperModel <- PyClass(
"HyperModel",
inherit = HyperModel_class(),
list(
build = function(self, hp) {
clear_session(free_me... |
02745a7d17480ad5772116a29ef71546145dc804cfb6260c1cd638e35730e2ab | R | 4,570 | 126 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(tensorflow)
tf$config$list_logical_devices()
library(keras3)
library(kerastuneR)
library(abind)
HyperModel <- PyClass(
"HyperModel",
inherit = HyperModel_class(),
list(
build = function(self, hp) {
clear_session(free_me... |
a52311cf5c3707ed6da0d620d42a74d200bd3ca3909b67d8596e6123f31ec07e | R | 4,590 | 121 |
#' placeholder title
#' @param tib_input todo
#'
#' @importFrom ggpubr ggarrange theme_classic2
plot_dia_cscore_histograms = function(tib_input) {
if(length(tib_input) < 2 || !is_tibble(tib_input)) {
return(list())
}
if(!all(c("cscore", "isdecoy") %in% colnames(tib_input)) || !any(tib_input$isdecoy)) {
a... |
d6686ece3285da9f5741acaec6931127825d857b1caf28d8604f14fa314f6134 | R | 4,591 | 105 | library(ggplot2)
library(vegan)
library(dplyr)
library(rlang)
library(cowplot)
library(viridis)
setwd("/Users/rochellelai/Documents/JacobsGit/slcproject/PFF_Microbiome/beta_diversity/")
# here::i_am("PFF_Microbiome_RProj/_Beta_Diversity.R")
### Read data
data_meta <- "/Users/rochellelai/Documents/JacobsGit/slcproject... |
3edfdd956275fe4a8c1ea142de720088e45b0e3cf68274cf0899a09b4b26a7d7 | R | 4,592 | 135 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(tensorflow)
tf$config$list_logical_devices()
library(keras3)
library(kerastuneR)
library(abind)
HyperModel <- PyClass(
"HyperModel",
inherit = HyperModel_class(),
list(
build = function(self, hp) {
clear_session(free_m... |
56e0391ac82c2303770290c9eba3cc22992c5a541514cee10d9284d1584375b3 | R | 4,604 | 135 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(tensorflow)
tf$config$list_logical_devices()
library(keras3)
library(kerastuneR)
library(abind)
HyperModel <- PyClass(
"HyperModel",
inherit = HyperModel_class(),
list(
build = function(self, hp) {
clear_session(free_m... |
b7e42f3f1c18ca9c9c56ca0995fe791f88480d21931036f3ff971964806198e6 | R | 4,606 | 114 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(multcomp)
source("src/scales.R")
ref_pcs <- read_csv("processed/reference_sorted.csv", show_col_types = FALSE)
y <- scale(ref_pcs$GrainYield[ref_pcs$Set == "Train"])
yc <- attr(y, "scaled:center")
ys <- attr(y, "scaled:scale")
ref_pcs <... |
ebe29b455a8b6924bbfdcc4630e489ccdfc37df5aa667f8fd136d2c003569b64 | R | 4,608 | 112 | base_dir <- "/Users/sdaniell/Dropbox (Partners HealthCare)/Project_HOPE/SARA"
# Read metadata file with patient information -----------------------------------
oncoprint_input_tumors <- read_excel(file.path(base_dir, 'metadata/metadata_10X_smartseq.xlsx'))
# remove samples with no goodQC cells left postQC
badqc <- c... |
277124104d849390661659393ee869d578ebddc1eee57bbc22334761e55e9f51 | R | 4,610 | 122 | #' Plot method for Epoch objects
#'
#' @param x An Epoch object
#' @param y Not used (for S4 method compatibility)
#' @param gap Numeric value specifying the gap between electrode traces (default: 2)
#' @param groupIndex Integer or string. A group of electrodes to show together in a different color. If NULL(default), a... |
e7c873f4d9325b4e8c1ccac8465bad74fb2a43648eb590d6c6896311ace55706 | R | 4,663 | 154 | #=========================================
# GENERAL COGNITIVE FUNCTION (g)
#=========================================
# COHORT:
# Lothian Birth Cohort 1936 (LBC1936) wave 2
# MODEL:
# - Structural Equation Modeling (SEM) using lavaan
# - Single latent factor (g) loading onto all cognitive tests
# - Resid... |
184d64e95f25aaf8218704b20300eb0fdda4c2b654a77223832cf0e986ef99bc | R | 4,664 | 136 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(tensorflow)
tf$config$list_logical_devices()
library(keras3)
library(kerastuneR)
library(abind)
HyperModel <- PyClass(
"HyperModel",
inherit = HyperModel_class(),
list(
build = function(self, hp) {
clear_session(free_m... |
cb2e6b7ab657013fe8b81b092e9809e1b620a4dec7096dd3e59aa7a937c243d0 | R | 4,667 | 116 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(multcomp)
source("src/scales.R")
ref_pcs <- read_csv("processed/reference_sorted.csv", show_col_types = FALSE)
y <- scale(ref_pcs$GrainYield[ref_pcs$Set == "Train"])
yc <- attr(y, "scaled:center")
ys <- attr(y, "scaled:scale")
ref_pcs <... |
b715b839e02f1cef979bf53779fe4e93e6ec20e50db3259bcb79f3ce38512b38 | R | 4,675 | 151 | ---
title: "Fig 3 Example Coherence Plot"
output: html_document
date: "2024-11-20"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(
echo = FALSE, # don't print the code chunk
warning = FALSE, # don't print warnings
message = FALSE, # don't print messages
fig.width = 8, # set default width of figures
... |
8622ac439db392f6a2e2a35e97c17e11fddfe06e7645669d71cce183e1d46bad | R | 4,676 | 136 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(tensorflow)
tf$config$list_logical_devices()
library(keras3)
library(kerastuneR)
library(abind)
HyperModel <- PyClass(
"HyperModel",
inherit = HyperModel_class(),
list(
build = function(self, hp) {
clear_session(free_m... |
8f961b79bfe74ebf5f8ecf380c6e128e97670f8ee6adabbc306b1891a0c9b95d | R | 4,676 | 136 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(tensorflow)
tf$config$list_logical_devices()
library(keras3)
library(kerastuneR)
library(abind)
HyperModel <- PyClass(
"HyperModel",
inherit = HyperModel_class(),
list(
build = function(self, hp) {
clear_session(free_m... |
65662e435c301d0a09e459e3f5f972bac4f30dd738f392b1ae2cea35938ecbd5 | R | 4,688 | 136 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(tensorflow)
tf$config$list_logical_devices()
library(keras3)
library(kerastuneR)
library(abind)
HyperModel <- PyClass(
"HyperModel",
inherit = HyperModel_class(),
list(
build = function(self, hp) {
clear_session(free_m... |
9556b3bb6febc56e0b560c6fa2f86c94574af0699fa1db0d13975a2d983f73f6 | R | 4,721 | 91 | testthat::context("assert pipeline output equal to example from MS-EmpiRe R package")
msdap::enable_log(FALSE)
######################################################## generate results ########################################################
### example dataset and application of MS-EmpiRe following the documentatio... |
0ea0a447d5725c5f7eac60d902f610ac100175870de09f618bd7bfe58c5f1212 | R | 4,732 | 157 | # %%
Sys.setenv("OMP_NUM_THREADS" = 32)
Sys.setenv("OPENBLAS_NUM_THREADS" = 32)
Sys.setenv("MKL_NUM_THREADS" = 32)
Sys.setenv("VECLIB_MAXIMUM_THREADS" = 32)
Sys.setenv("NUMEXPR_NUM_THREADS" = 32)
library(Seurat)
library(SeuratObject)
library(DESeq2)
library(ggplot2)
library(scales)
library(qs)
library(dplyr)
path_dat... |
9f2f6f8753bc1a2aa84076b4eb96771269d342d966f37edda36a840aba41f574 | R | 4,749 | 181 | # Analyse the sleep trace of flies listed in metadata files under metadata/
library(data.table)
library(parallel)
library(behavr)
library(digest)
if(!file.exists("paths.txt")) {
stop("Please make a file called paths.txt with the format:
root,cache
path_to_root,path_to_cache")
}
paths <- read.table("paths.txt", ... |
e61629dd13a01690f72c16cc5d5d82a019f1b8557daa03fe10ea0433f77793e8 | R | 4,771 | 201 | #####################################
# Estimate metacognitive efficiency (Mratio) at the group level
#
# Adaptation in R of matlab function 'fit_meta_d_mcmc_group.m'
# by Steve Fleming
# for more details see Fleming (2017). HMeta-d: hierarchical Bayesian
# estimation of metacognitive efficiency from confidence rating... |
5858ee0d56882fba9867a8c854a9ed0a7b6fb86b0ce4f4f4918f6090a3989c23 | R | 4,772 | 48 |
## The following R code enables the generation of a pie chart to represent the proportions of immuno-positive and immuno-negative neurons.
## Sample data preparation
neuron_data <- data.frame( ## Create a data frame to hold the counts of immuno-positive and immuno-negative neurons
Immuno_positive = c(155... |
35f9c7d6fc2611d61f8ef17712d3e2f24a7cd2b5dfacacd1ef3d41920b80ded7 | R | 4,793 | 130 | library(ggplot2)
library(dplyr)
library(cowplot)
library(here)
generate_boxplots <- function(input_data, X, Y, min,max){
data<-as.data.frame(input_data)
#Ensure correct ordering of levels
#data$Genotype <- data$SLC_Genotype
#data$SLC_Genotype <- factor(data$SLC_Genotype, levels = c("WT", "HET", "MUT"))
g... |
fd9e0d5190b34763480c4b438ebb78c8f9520091e687b2a61f8e46daa260a7c1 | R | 4,807 | 128 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
require(tidyverse)
require(keras3)
require(kerastuneR)
HyperModel <- PyClass(
"HyperModel",
inherit = HyperModel_class(),
list(
build = function(self, hp) {
clear_session(free_memory = TRUE)
model <- keras_model_sequential(input_shape = c(17... |
3c4801fdfc8c9dbe539d33439392193d6242f02efa551aaceeb0a0916a0b36e9 | R | 4,823 | 119 | ##' This implements the SVDimpute algorithm as proposed by Troyanskaya
##' et al, 2001. The idea behind the algorithm is to estimate the
##' missing values as a linear combination of the \code{k} most
##' significant eigengenes.
##'
##' Missing values are denoted as \code{NA}. It is not recommended
##' to use this fun... |
51738080f178f499ab354d09571abd76dbf0a5be35ef219dc373768308556ad6 | R | 4,836 | 84 |
#' Import a label-free proteomics dataset from a peptide-level Biobase ExpressionSet object
#'
#' provided mostly for compatability with results from prior bioinformatic analyses, as it is preferred to import raw data files.
#'
#' @param eset a Biobase ExpressionSet containing peptide data
#' @param column_fdata_prot... |
6334453fffee974419defe55a3337fffe59ab4381f3d270ded7311a534a84d00 | R | 4,843 | 133 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(keras3)
library(abind)
source("src/scale2.R")
### Reproducibly select sub-model runs ----------------------------------------
seeds <- c(758069L, 929940L, 591511L, 882475L, 961222L, 780783L, 139364L,
220106L, 841340L, 252774... |
b5945db59c972e3499e2523ddda8b89db16466ef9b31f883c5ed200615e81a3f | R | 4,851 | 140 | #' Estimate cellular composition with error
#'
#' Estimate the cellular composition from a DNA methylation profile and
#' calculate the CETYGO score error metric associated with this estimate.
#'
#' @param YIN a matrix of DNA methylation levels from the samples that require
#' cell composition to be estimated.
#' @para... |
9f6b7b4ef2d6a2de716f5052e9af69591022a440de02e46067277753db8f931e | R | 4,871 | 142 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(rrBLUP)
library(parallel)
### Load the hybrid marker matrix ---------------------------------------------
# From Lopez-Cruz et al. (2023)
X <- read_csv("../../genomes2fields_curated/data/data_g2f/GENO.csv", show_col_types = FALSE)
x_taxa... |
2ee0514ea5fd8c0a15aa5efb079704e9a73c86be33304aae033e6613f9fd233d | R | 4,875 | 114 | #' Check for separation of count distributions by variables
#'
#' Check the count distributions for each nhood according to a test
#' variable of interest. This is important for checking if there is separation
#' in the GLMM to inform either nhood subsetting or re-computation of the
#' NN-graph and refined nhoods.
#' @... |
9add86d53560bd3703a57dce3ef014912d9380ac3a618e3942254416e186216d | R | 4,899 | 149 | # Nearest.r
# Includes hemisphere and monkey info
# Absolute value of NEAR is the criterion distance
# NEGATIVE value means exclude the originals - give JUST the added ones
# Warning: some LIP/PRR do not have depths, so will not be in LIP & PRR
# If we append only a single monkey as a last column, then 'base' se... |
1089117075c9165e56d9c44785d2a52c8cffebacb9b73a6f2896a88acc18b635 | R | 4,906 | 200 | library(tidyverse)
library(synExtra)
library(synapser)
library(powerjoin)
# Select ROSMAP samples that use rRNA depletion instead of poly-A enrichment
# in library prep. Can't quantify repeat transcripts in samples prepared
# using poly-A enrichment
synLogin()
syn <- synDownloader("~/data", .cache = TRUE)
rosmap_cl... |
568af66b0873314a54e12b17f57c5f88b4594ba9d2263ade60620ebfdd86c216 | R | 4,909 | 142 | #06_enrichment_analysis.R
rm(list=ls())
library(dplyr)
library(ggplot2)
#1.SNP-based PheWAS----
#41 lead SNP
SNP_lead=read.table('./GWAS/pheWAS/26_Topic_lead_SNP.txt')
SNP=list()
for(i in SNP_lead$V1){
if(file.exists(paste0('./GWAS/pheWAS/',i,'.csv'))){
SNP[[i]]=read.csv(paste0('./GWAS/pheWAS/',i,'.csv'),header... |
6214f4debbe86ab95fe4bc8fa272f75209402877956acaf2328103a62e09381d | R | 4,916 | 135 | # Load packages -----------------------------------
library(Seurat)
library(tidyverse)
library(enrichR)
library(patchwork)
library(glue)
library(Matrix)
library(DropletUtils)
library(SeuratWrappers)
library(dorothea)
library(org.Hs.eg.db)
library(clusterProfiler)
library(DOSE)
library(qs)
library(enrichplot)
library(wr... |
c99c9410daa4cd8323b1ae566622a10b59a9869787f3ff616617388b271e1086 | R | 4,944 | 130 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(RSpectra)
library(tensorEVD)
### The reference table has the pedigree and environment of each data record --
ref <- read_csv("processed/reference_sorted.csv", show_col_types = FALSE)
ug <- unique(ref$Pedigree)
ue <- unique(ref$Environmen... |
e1879d6dcc33b44527c1c32bfa89dcd91beabc5f52b5934a96606fd323b9002a | R | 4,947 | 106 | context("Testing buildGraph function")
library(miloR)
### Set up a mock data set using simulated data
library(SingleCellExperiment)
library(scran)
library(scater)
library(irlba)
library(MASS)
library(mvtnorm)
set.seed(42)
r.n <- 1000
n.dim <- 50
block1.cells <- 500
# select a set of eigen values for the covariance ma... |
5d78cad5153977778928bc5ee66ff6cdb62981e777b43e1c26492da958a3b93e | R | 4,951 | 149 | # Nearest.r
# Includes hemisphere and monkey info
# Absolute value of NEAR is the criterion distance
# NEGATIVE value means exclude the originals - give JUST the added ones
# Warning: some LIP/PRR do not have depths, so will not be in LIP & PRR
# If we append only a single monkey as a last column, then 'base' se... |
9af07661fa214254d92413e25593ab3a67384fed16bca83b9ddd9ecfea78b22e | R | 4,963 | 138 | ---
title: "Granger Plots"
output: html_document
date: "2025-02-18"
---
```{r setup, include=FALSE}
## libraries ##
library(tidyverse)
library(ggplot2)
library(lmerTest)
library(doParallel)
library(parallel)
library(foreach)
library(here)
library(fs)
library(lmtest)
library(scales)
library(ggthemr)
library(RColorBrewer... |
def059fc64e164acc9f2680bd2a40c05b0a7f34e18812ae9d20da435cb9a1946 | R | 4,963 | 246 | #!/usr/bin/env Rscript
# Run this script in r-linda environment
library(broom.mixed)
library(dplyr)
library(lme4)
library(lmerTest)
library(optparse)
library(tidyverse)
library(vroom)
##
## READ TABLES
##
df_meta <- read.table(
"../seq-meta-data-tidy/outputs/mapping/meta-data-bcm-all-sequencing.tsv",
sep = ... |
8b381f31c1899bfac092ad679d1c990230fc53a806057166ad7f4b2af00be8f8 | R | 5,026 | 141 | library(here)
library(tidyverse)
library(cowplot)
library(ggplot2)
### Establish location ---
here::i_am("src/PFF/PFF_Correlate_DAT_with _Rotarod.R")
### Read in input files ---
PFF_rotarod <- read.csv(here("data/PFF/PFF Rotarod - PFF_Rotarod_Analysis.csv"))
PFF_rotarod <- PFF_rotarod %>% filter(Day=="one") %>%
d... |
4bfd258a1e5dce87eb843c472e9292d79ec03214b0a13c2f4d259040736d9435 | R | 5,075 | 162 | ## libraries ##
library(tidyverse)
library(here)
library(fs)
library(scales)
library(brms)
## load data ##
conn_df <- read_csv(path(here(), "combined_ghost_connectivity_newsubs.csv"))
## split the dlpfc electrodes into MFG and SFG ##
regions_df <- read_csv(path(here(), "mni_coordinates_all_subs_with_detailed_re... |
e12072c0f19d7c788d50f5425efca614d01b0222866fe331e79bd9d3d6d74a3e | R | 5,080 | 136 |
#' Parekh et al. 2016: Gene Expression Matrices
#'
#' 250 ng of Universal Human Reference RNA (UHRR; Agilent Technologies; catalog #740000) and ERCC spike-in control mix I (Life Technologies) were used and cDNA was synthesized as described in the Smart-Seq2 protocol from Picelli et al. 2013.\cr
#' Base-calls were perf... |
6789dddd92220741bb82df9c7f16620ec09e3fbf5abfee03395e4c44df6253fe | R | 5,086 | 162 | ## libraries ##
library(tidyverse)
library(here)
library(fs)
library(scales)
library(brms)
## load data ##
conn_df <- read_csv(path(here(), "combined_ghost_connectivity_newsubs.csv"))
## split the dlpfc electrodes into MFG and SFG ##
regions_df <- read_csv(path(here(), "mni_coordinates_all_subs_with_detailed_re... |
76c5ffc7dc6ff16b1290947074b443663baaf56f415102cce59a02301cad3beb | R | 5,105 | 138 | library(here)
library(ggplot2)
library(rlang)
library(rstatix)
library(nlme)
library(cowplot)
library(ggbeeswarm)
library(ggpubr)
library(ggsignif)
library(knitr)
library(here)
here::i_am("Rscripts/MPTP/MPTP_Open_Field.R")
data <- readr::read_csv(here("Analysis_Files", "MPTP","MPTP_Open_Field.csv"))
data$SLC_Genotyp... |
a156e1889bbca5c0eac2564c51a24e28ffe4098e8f31960b56211afff368f199 | R | 5,108 | 145 | # --- mr_T1D_to_PD.R ---
# One-shot bidirectional MR: T1D (exposure) -> PD (outcome)
# IVs: P < 5e-8, F >= 10; LD clumping r2 < 0.001 (other clump params default)
library(TwoSampleMR)
library(data.table)
library(openxlsx)
library(genetics.binaRies)
setDTthreads(threads = 0)
# ========= Paths (edit if needed) =======... |
03c23d286c62eeacda10da5d388c99dd57f15e34d575f98009ea5ea869cdeeb3 | R | 5,113 | 154 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
ref <- read_csv("processed/reference_sorted.csv", show_col_types = FALSE)
y <- scale(ref$GrainYield[ref$Set == "Train"])
yc <- attr(y, "scaled:center")
ys <- attr(y, "scaled:scale")
rm(ref, y); gc()
ref_pcs <- read_csv("processed/reference_sort... |
7394ed215f97b6c0e01a21cd83a80793c9946c32e78e9353eca78a4ce9995543 | R | 5,116 | 162 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(abind)
source("src/scale2.R")
# For reproducibility:
set.seed(620200)
ref <- read_csv("processed/reference_sorted.csv", show_col_types = FALSE)
# Number of unique environments in each set (distinguished by site-year)
ue <- ref %>%
... |
b8d31022be4df0b88612a85d0d8f285a88b68037c5a8efd8be20dc90fa364f97 | R | 5,116 | 114 | # doGroupPower.r (Seul Ah Kim)
#
# This is a modified version of doPower.r to run with PowerVsDistance.r in R/ subdirectory.
###########################################################################
# GRAB PARAMETERS #
###########################################################################
... |
d71595937549a3f845900cf345166916d29e3bdc22959cef4c680d7ff72e8b31 | R | 5,123 | 111 | library(here)
library(tidyr)
library(dplyr)
library(ggplot2)
library(cowplot)
library(nlme)
library(ggpubr)
setwd("/Users/rochellelai/Documents/JacobsGit/slcproject/PFF_Microbiome/alpha_diversity/")
# here::i_am("PFF_Microbiome_RProj/Alpha_Diversity.R")
### Read data frames
# Choose one type of data set below
# JEJU... |
9d4d2962200a15b212795b533321389ceba06929ed5f1bdf9b9f852de9db8a26 | R | 5,136 | 158 | ## libraries ##
library(tidyverse)
library(here)
library(fs)
library(scales)
library(brms)
## load data ##
conn_df <- read_csv(path(here(), "data_mount", "remote", "pacman", "connectivity", "ieeg", "imcoh_ppc_pli", "combined_ghost_connectivity_newsubs.csv"))
## split the dlpfc electrodes into MFG and SFG ##
regions... |
dc9ebbb3f886932a6d5c7ac34a634e80f788fc0edf1be4784ea680d1c469a30c | R | 5,139 | 88 | safeBinomTest = function(x, y) {
if (y == 0) {
output = list(estimate = NA, conf.int = c(NA, NA))
} else {
output = binom.test(x, y, p = 0.5, alternative = "two.sided", conf.level = 1 - SIG_THRESHOLD)
}
output
}
safeFisherTest = function(x, y, z, w) {
if (x + y == 0 || x + z == 0 || y + w == 0 || z ... |
4723c48b64431cdd50bfef8cc2e8dcebe5a9cf08e3befd1980888a4bb82578eb | R | 5,142 | 172 |
DeepScore <- function(hidden_nodes, common_features, n_labels, epochs=10,
batch_size=32, activation="relu", dropout=TRUE,
dropout_rate=0.2, batchnorm=TRUE, lr=0.001,
weight_reg=TRUE, l1=0, l2=0) {
ds <- list(
model = NULL,
common_featur... |
194e25a4082fb58d7a87e31e43b3b95fb347486637f36964e38e7c4e76cfc96f | R | 5,146 | 158 | ## libraries ##
library(tidyverse)
library(here)
library(fs)
library(scales)
library(brms)
## load data ##
conn_df <- read_csv(path(here(), "data_mount", "remote", "pacman", "connectivity", "ieeg", "imcoh_ppc_pli", "combined_ghost_connectivity_newsubs.csv"))
## split the dlpfc electrodes into MFG and SFG ##
region... |
636dfb516d7bcedcfcf72d372ca8aafab58d1f3a1db08edf9cea381be979be96 | R | 5,163 | 139 | ```{r}
source(here::here("src/init.R"))
```
<!---------------------------------------------------------->
<!---------------------------------------------------------->
# I. Data
```{r}
data_dict <- load_data_dict()
(supplementary_data <- load_supplementary_data())
# Use reprocess = TRUE to re-process the data and r... |
605aaee69bd9bf233d0ca0cd14015194c851514a085ccfd2d9137e6fcec7e997 | R | 5,210 | 149 | library(ggplot2)
library(dplyr)
library(cowplot)
library(here)
library(tidyr)
library(ggbeeswarm)
## Environment --
here::i_am("Rscripts/Figure_S3_MPTP_Behaviors.R")
## Functions --
generate_boxplots <- function(input_data, X, Y, min,max){
data<-as.data.frame(input_data)
#Ensure correct ordering of levels
#dat... |
20ddc655c7ec2b8690a05c393961d61d57df9ad13f57cdd7e379f3f33d23a1b1 | R | 5,223 | 166 | ---
title: "Patient models - heatmap of expression"
output: html_document
author: "Daeun Jeong/Sara Danielli"
date: "2025-04-21"
---
```{r}
# Load packages -----------------------------------
rm(list = ls())
library(data.table)
library(tidyverse)
library(R.utils)
library(ggpubr)
library(dplyr)
library(Seurat)
librar... |
26f47a60a94bbf8628132119de822b34fe32a00874347c3ef7c9a5a9cda989fe | R | 5,228 | 116 | ##' This is a simple estimator for the optimal number of componets
##' when applying PCA or LLSimpute for missing value estimation. No
##' cross validation is performed, instead the estimation quality is
##' defined as Matrix[!missing] - Estimate[!missing]. This will give a
##' relatively rough estimate, but the numbe... |
54e63afc9d1167295ae94e040e3e4edda13f3c1a76f34cd4a15b77c0f4daf0da | R | 5,253 | 138 | #' This function trains, fits and evaluates a deep neural network (DNN) model.
#'
#' This function creates a DNN model from the reference dataset (scRNA-seq) by using the keras package.
#' @param out The output of the ds_split_data_encoder function. The input data used to train the DNN model.
#' @param hnodes The numbe... |
b308c5b533ce446123d20d62afa66158c458a5ea4a274ea1ff3bee9b7236b055 | R | 5,257 | 95 | Co_Embeddinglog<-function(snATAC,snRNA,name){
library(parallel)
library(Seurat)
library(dplyr)
library(ggplot2)
out_name1=paste0(name,".log")
#1、downsampling from each cluster or each Subclass
#2、Integrate snATAC & snRNA
print(snATAC)
print(snRNA)
#choose the intersection genes
gene=intersect(rownames(snATAC... |
47d988c56e0a6072e347fa6e5c6d659167f8c7effd9ecdd121acdc2e2378a6eb | R | 5,260 | 118 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(multcomp)
res <- read_csv("results/metrics_all_env.csv", show_col_types = FALSE) |>
filter(Data %in% c("G", "A")) |>
dplyr::select(-Data) |>
mutate(Model = if_else(Model == "DNN-CO", "ReLU", Model))
res2 <- list.files("09.pc_com... |
e3582040e51cf6038742f4229160ef276015e527cacad7dcdbe02b7747436bd8 | R | 5,280 | 171 | # spectragram.r
# first run power.r to get mdata (ReadData.r) (mean, baseline-removed)
# data[times, bands, stacks]
# BANDS.SEQ frequencies (total of BAND)
# 1:dim(data)[1] time points
# dimnames(data)[[2]] another way to get these
if (!exists("mdata"))
stop("Must run doAll.r, with ALIGN='go', class='', all els... |
a2704036a9a02299afcf90b136e968112b5e5946c494f02bd0ae9ef7f3de6c71 | R | 5,281 | 164 | ## libraries ##
library(tidyverse)
library(here)
library(fs)
library(scales)
library(brms)
## load data ##
conn_df <- read_csv(path(here(), "data_mount", "remote", "pacman", "connectivity", "ieeg", "imcoh_ppc_pli", "combined_ghost_connectivity_newsubs.csv"))
## split the dlpfc electrodes into MFG and SFG ##
regio... |
f268784d1d39a4bd07b55221a1dce67849a61a41c6e5475162b45b133a629cef | R | 5,283 | 195 | ---
title: "P3 latency"
output: html_document
---
```{r include = FALSE}
# clear old outputs
if(dir.exists(file.path("../output/p3_latency"))) {
unlink("../output/p3_latency", recursive = TRUE)
}
output_dir <- file.path("../output/p3_latency")
dir.create(output_dir)
nice_tables_file <- paste0(output_dir, "/nic... |
e2387d22c282062629e1d384ec048a66c1943708991bb75fbdf9eacaf5a8baf2 | R | 5,291 | 193 | ---
title: "MMN latency"
output: html_document
---
```{r include = FALSE}
# clear old outputs
if(dir.exists(file.path("../output/mmn_latency"))) {
unlink("../output/mmn_latency", recursive = TRUE)
}
output_dir <- file.path("../output/mmn_latency")
dir.create(output_dir)
nice_tables_file <- paste0(output_dir, "... |
168ac542f572da2292b2d3da02b053e7b7401c358f0bcb57e6ee98cf8e04d556 | R | 5,343 | 129 | # Step 5: Test data and future directions
## Public datasets
The pipeline with default settings (smoothing and color clusters of k-means in VNS function) used for the [Maynard, Collado-Torres et al, Nature Neuroscience, 2021](https://doi.org/10.1038/s41593-020-00787-0) LIBD data has been applied on the [public datase... |
1964dd4e778c45d476f06580ff15cea3378457c6ecf2a789aa9f6d8c33bccc63 | R | 5,376 | 146 | context("Test buildFromAdjacency function")
library(miloR)
### Set up a mock data set using simulated data
library(SingleCellExperiment)
library(scran)
library(scater)
library(irlba)
library(MASS)
library(mvtnorm)
library(miloR)
set.seed(42)
r.n <- 1000
n.dim <- 50
block1.cells <- 500
# select a set of eigen values f... |
84a3514c0f52396dc183535bdd07d306e134a63298b17fb31f5318531ebc0537 | R | 5,376 | 67 | #### epiTOC2.R
#### Author: Andrew E Teschendorff (a.teschendorff@ucl.ac.uk)
#### Date: 8th Apr.2019
#### Copyright 2019 Andrew Teschendorff
#### Copyright permission: epiTOC2 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version-3 as published by the Free... |
1ab0d8938053c2dfbbde106298c9f8a85bd9633e0fca49480524ac460e10257b | R | 5,397 | 176 | library(sjPlot)
library(broom.mixed) # for tidy()
library(dplyr)
library(emmeans)
library(lme4)
library(lmerTest)
library(ggplot2)
library(moments)
library(ggeffects)
library(robustlmm)
library(glmmTMB)
library(patchwork)
library(forcats)
library(scales)
df <- read.csv("E:\\work\\q_backup_06_03_2025\\projects\\i... |
78b69841b1f82cf049cd447cf4900d1b93aa3341d1b7daa07e9ddf5a4deed5e8 | R | 5,397 | 124 | library(ggplot2)
library(dplyr)
library(ggplot2)
library(data.table)
run_subtype <- T
n_models <- 4
mode <- '_converge'
resdir <- 'results'
batch_suffix <- '_with_hidden_batch_'
data_dir <- './data'
cts <- c('Microglia', 'Astrocyte', 'Inhibitory Neurons', 'Oligodendrocytes', 'cux2+', 'cux2-', 'OPCs')
summary <- func... |
035ad3767220e247cd3328b2ba6c2376fbc22e559431123ea4af094c02d14a9f | R | 5,440 | 152 | library(ggplot2)
library(vegan)
library(dplyr)
library(rlang)
library(cowplot)
library(viridis)
library(here)
## Environment --
here::i_am("Rscripts/Figure_Correlate_PFF_Rotarod.R")
metadata <- read.table("Analysis_Files/PFF/PFF_Microbiome/starting_files/PFF_Mapping.tsv",header=TRUE)
counts <- read.table("Analysis_Fi... |
b53af45d8dc29cb0d84727a582702eb38b34041976e9dabdf114d4b227d405fe | R | 5,445 | 131 | library(data.table)
library(infercnv)
library(tidyverse)
library(crayon)
library(ape)
library(readxl)
options(scipen = 100)
base_dir <- "/n/scratch/users/s/sad167/EPN/scRNAseq"
resources_dir <- file.path(base_dir, 'scripts/resources')
ext_ctrl <- file.path(resources_dir, 'ctrl_data')
source(file.path(resources_dir, ... |
ae24c34c9f178dff50d01299f60bb93b3bf69b1910c3ebad6b71ff105745bea4 | R | 5,449 | 153 | ##' Later
##' @param nlnet the nlnet
##' @param trainIn training data
##' @param trainOut fitted data
##' @return derror
##' @author Henning Redestig, Matthias Scholz
derrorHierarchic <- function(nlnet, trainIn, trainOut) {
weights <- nlnet@weights$current()
netDim <- dim(nlnet@net)
if(nlnet@inverse) {
num... |
1ea75c73099074638b99ce6deedd085f4e96f676a4f7549be5707c5f319052c4 | R | 5,450 | 98 | #' Training HD algorithm using the NHANES III (1988 - 1994) and projecting into NHANES IV (1999 - 2018) dataset. For this function, NHANES III included men and women who are between the ages of 20 and 30, and have observe biomarker data within clinically acceptable distributions.
#'
#' @title hd_nhanes
#' @description ... |
e0caab1cc413810cf2d710770e98a474244d36626736393f1435148f028f935a | R | 5,462 | 169 | ### Approach Theta Coherence ~ Time ###
## libraries ##
library(tidyverse)
library(ggplot2)
library(doParallel)
library(parallel)
library(foreach)
library(here)
library(fs)
library(scales)
library(brms)
## load data ##
conn_df <- read_csv(path(here(), "munge", "combined_ghost_connectivity_newsubs.csv"))
## split the... |
1f9cf6c1214ca4971299afe42e5faf23e73799e1d29d4c005bbdfdd5d6e902c9 | R | 5,463 | 168 | ### Approach Theta Coherence ~ Time ###
## libraries ##
library(tidyverse)
library(ggplot2)
library(doParallel)
library(parallel)
library(foreach)
library(here)
library(fs)
library(scales)
library(brms)
## load data ##
conn_df <- read_csv(path(here(), "munge", "combined_ghost_connectivity_newsubs.csv"))
## split the... |
03a885b953a5f71c7fbedcb1c776ebd0ade8f37eacd3218950a8f1ab991c2e0e | R | 5,467 | 111 | surv_res = function (dat, agevar, covar) {
covars = paste(covar, collapse = "+")
cox = list()
for (i in agevar) {
form = formula(paste("survival::Surv(time,status)~", i, "+", covars, sep = ""))
cox[[i]] = survival::coxph(form, data = dat)
}; rm(i)
res = lapply(cox,summary)
table = as.data.fra... |
2e4c2b3289ca506fa7d565aa35dfe5919b13ddc7a9291a93d46c0106d9391de0 | R | 5,475 | 96 | #' Import a label-free proteomics dataset from Peaks
#'
#' @param filename a features.csv file exported by Peaks
#' @param collapse_peptide_by if multiple data points are available for a peptide in a sample, at what level should these be combined? options: "sequence_modified" (recommended default), "sequence_plain", ""... |
56be95c41a2f6504dd2df41e9776e9d8805b11a9c6fe84f2def0ea6b5c28dc66 | R | 5,547 | 153 | #03_GWAS_for_ES-Ana.R
rm(list=ls())
#1.mh plot----
results_log <- data.table::fread("./01_taxa/all/Topic/lm.topic.assoc.linear", head=TRUE)
results_log=results_log[,c('SNP','CHR','BP','P')]
a1=subset(results_log,-log10(P)>2)#60872
a1=a1[,c('SNP','CHR','BP','P')]
dd2=read.table('./01_taxa/all/Topic/clumped_results.c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.