sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 17k | content stringlengths 1 200k |
|---|---|---|---|---|
5895fd55ded074a452dc9942f904193c0bddde97655a86c5e73b9e59d01d0382 | R | 2,308 | 59 | #' This function split the reference data in training and test set to use it as input for the ds_dnn_model function.
#'
#' @param scale.data scale.data A scaled/normalized matrix of gene expressions like in the `scale.data`
#' of the Seurat object. Rows are genes and columns are cells from the reference
#' dataset.
#' ... |
aabbf547a5febc12b87f6cc484022536bc02dbafe18a78575d004a5771e3ff09 | R | 2,315 | 69 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(tensorflow)
tf$config$list_logical_devices()
library(keras3)
library(kerastuneR)
library(abind)
source(textConnection(readLines("10.interactions/03a.sigmoid_PC_int_tuner.R")[11:105]))
# Creates a directory for intermediate caching of hi... |
f59ee0ed40a90bb7a58239f980f98af87fd5234f48f84f31853bfacb1661b3ca | R | 2,319 | 80 | #' Heatmap comparing two cell type annotations
#'
#' This function generates a heatmap which compares the predicted cell types with another cell type annotation
#'
#' @param out The predicted cell types
#' @param cluster A cell type annotation
#'
#' @import ggplot2
#'
#' @return A heatmap comparing out and cluster
#' @... |
58d762e3416a39835f0c73edb562c665423a03547f8a24005557df25c1373c5e | R | 2,331 | 58 | seurat=paste0(outdir,"/",out_name2,".integrateSeurat.rds")
library(MetaNeighbor)
library(SummarizedExperiment)
options(future.globals.maxSize=20000*1024^3)
data=seurat@assays$integrated@data
out_name3=paste0(name,".integrateData.SubClass")
meta=seurat@meta.data
table(meta$clusterName)
meta$group=meta$SubClass
... |
2265b06eda224e297ff1bfc292eaa1dabcb9f90f09161a6c96e3378cebc650dc | R | 2,336 | 61 | library(Seurat)
library(dplyr)
library(data.table)
data_dir <- './data/'
gene_info <- fread('./1k1k_gene_GRCh37.txt')
library(Matrix)
library(edgeR)
sum_sparse <- function(mats) {
all_rows <- sort(unique(unlist(lapply(mats, rownames))))
all_cols <- sort(unique(unlist(lapply(mats, colnames))))
rmap <- setNames(s... |
cc746f62ac33a60541bf4566c4343a3220319c33ed9d05acfb6c6ee165920ca3 | R | 2,337 | 48 | # code for main figure 3 panel b
# source the functions from FLXenium folder, which loads useful libraries and has
# a bunch of functions useful for general analysis of spatial data
miceadds::source.all('~/Multidimensional_STEPN/4.Xenium/resources/FLXenium/')
# source the ependymoma project specific functions
source... |
83ceac906358e2a18102c869956992a872c0e1ae888ee14c9b14f347869ebf87 | R | 2,340 | 80 | ### A collection of function to perform downstream analysis on several
### scATACseq samples at the same time.
get_peaks <- function(folder) {
peak_path <- glue("{folder}/peaks.bed")
peaks <- read.table(peak_path, col.names = c("chr", "start", "end"))
gr <- makeGRangesFromDataFrame(peaks)
return(gr)
}
ge... |
310b5a6edf7b82633b077c64583150064842893f528606c7da4c111210777a61 | R | 2,343 | 96 | library(lme4)
library(lmerTest)
params <- list(
# n = 50,
a = .3,
intercept_sd = 1,
noise = 1,
conditions = 8
)
make_person <- function(sub_id, params) {
# IV & DV
x <- c(0:(params$conditions - 1))
y <- params$a * x + rnorm(length(x), mean = 0, sd = params$intercept_sd) + rnorm(n = length(x), mean = ... |
069237f8fab1eee87440ce63a87adcffa9e1e3d6364bbb097b0712df66c36121 | R | 2,348 | 88 | library(data.table)
library(purrr)
library(ggplot2)
library(ggpubr)
library(MOFA2)
library(readr)
library(reticulate)
.libPaths()
[1] "/home/mik/miniconda3/envs/r_env/lib/R/library"
new_path<-'/home/mik/R/x86_64-pc-linux-gnu-library/4.3'
.libPaths(c(new_path))
Sys.setenv(RETICULATE_MINICONDA_PATH = "/h... |
3e5e5fd8dd03137b8280d251dda566c1155eabb66d1daf14eb87cbf008e11074 | R | 2,358 | 46 | library(data.table)
library(ReX)
library(ggplot2)
path = "...\\results_HCP\\ReX_files"
path_save = "...\\plots"
path_pcc <- file.path(path, "PCC_ICC_80_samples.csv")
data_pcc <- fread(path_pcc)
path_varconet <- file.path(path, "VarCoNet_ICC_80_samples.csv")
data_varconet <- fread(path_varconet)
path_vae <- file.path(... |
98bdf2c9f8886263dcc15d9d6bd2edce752b65ae3792c3ccb8f237dfa717e2f4 | R | 2,375 | 62 | #' This function calculates the feature importance of the deep learning model
#'
#' This function generates a dataframe with the feature importance score of the input features calculated
#' based on the "Permutation Feature Importance" approach.
#'
#' @param X The data with the feature information
#' @param Y The data ... |
c6528df4f88caff18641d4eb9fc685006f3a0cf252e502c3bad09f33c00b0ad4 | R | 2,375 | 80 | #' For HD algorithm., the constructed variable is based on a malhanobis distance statistic, which is theoretically the distance between observations and a hypothetically healthy, young cohort. You need to train separately for men and women who are between the ages of 20 and 30 and not pregnant, and have observe biomark... |
524f90656376c4a93542d46f93fdbcd87fe563280bf43cfe664d6d18bb1fd8cb | R | 2,393 | 66 | #' Plotting personfit estimates
#'
#' This function takes a fitted mirt-model and visualizes person infit and outfit estimates. The function builds on `mirt::itemfit()`. The basic idea is to visualize how many individuals in the sample do not show a response pattern that aligns with the suggested model. At best, the n... |
d62d0cf2626171b49525089bbaae1dff7bb6f008bbf3d1b158c7d32252b77d19 | R | 2,421 | 51 | setGeneric("vector2matrices", function(object, ...)
standardGeneric("vector2matrices"))
##' @exportMethod leverage
setGeneric("leverage", function(object, ...) standardGeneric("leverage"))
##' @exportMethod DModX
setGeneric("DModX", function(object, dat, newdata=FALSE, type=c("normalized","absolute"), ...)
... |
4ba1724a0393e2347e728154c17d8eb69935dd7d551b0ee1971280330223466c | R | 2,434 | 58 | library(here)
library(ggplot2)
library(cowplot)
here::i_am("src/Figure_5_ASO_Microbiome.R")
### Read in files ---
pff_beta_diversity <- readRDS(here("results/PFF/figures/lumcol_beta_diversity.RDS"))
pff_beta_diversity <- pff_beta_diversity + labs(subtitle = bquote(paste(~italic(R)^2,"=0.062 ",
... |
22cc47b3a2cb43bc5a01bc21ba2a25b754ae8363709d40ee2470a679f0b5e5f6 | R | 2,440 | 61 | rsFile="model.classMatrix.txt" #·ÖÀàµÄ¾ØÕóÎļþ
method="NaiveBayes" #Ñ¡Ôñ»úÆ÷ѧϰµÄ·½·¨(ÐèÒª¸ù¾ÝÈÈͼ½øÐÐÐÞ¸Ä)
setwd("C:\\Users\\wx197\\Desktop\\×ÔÑ§Íø113»úÆ÷ѧϰ\\205.geoML×ÊÁÏ\\205.geoML×ÊÁÏ\\17.confusion") #ÉèÖù¤×÷Ŀ¼
#¶ÁÈ¡·ÖÀàµÄ¾ØÕóÎļþ
riskRT=read.table(rsFile, header=T, sep="\t", che... |
39cff80deb4e3aa59e74cbced13870de751c7679786ad33bf64267a5facef6d9 | R | 2,452 | 80 |
## libraries ##
library(tidyverse)
library(ggplot2)
library(lmerTest)
library(doParallel)
library(parallel)
library(foreach)
library(here)
library(fs)
library(lmtest)
library(scales)
library(ggthemr)
## hand written functions ##
source(path(here(), "R", 'mutate_cond.R'))
source(path(here(), "R", 'create_distance_df.R... |
e7e55806d05ddc593ae2ae860e709b7fc973c63df729f6728a50b7d2b37b38d0 | R | 2,458 | 78 | base_dir <- "/Users/sdaniell/Dropbox (Partners HealthCare)/Project_HOPE/SARA"
metadata <- read_excel(file.path(base_dir, 'metadata/metadata.xlsx'))
FileName <- unique(metadata$FileName)
colors_tumor_normal <- c('#d8b365', '#5ab4ac')
colors_samples <- as.vector(paletteer::paletteer_c("scico::roma", n = length(FileName... |
e1c60b11f89daa0dec6820de7023f287672f31672a1ce1f99c1c45d951feaeb3 | R | 2,459 | 81 | args <- commandArgs(trailingOnly = TRUE)
current_sample <- args[1]
## Loading packages
library(Seurat)
library(NMF)
library(tidyverse)
library(pagoda2)
library(glue)
library(readxl)
## Sourcing necessary functions
hvgPagoda <- function(cm, n.OdGenes=3000, gam.k=10, plot_var=TRUE, n.cores=6, verbose=TRUE){
pagod... |
88c56af4550173e8e2477c071a9fc6f7d2a49cf7dc54cbdc4613fc1531685b06 | R | 2,465 | 97 | # Generate plots using the data generated with analyse_plot_data.R
library(ggplot2)
library(patchwork)
library(data.table)
library(behavr)
library(behavr)
library(ggetho)
library(ggprism)
library(colorspace)
theme_plot <- ggprism::theme_prism() + theme(text = element_text(size = 12, unit(12, "pt")))
ggplot2::theme_se... |
58e5c98f61ca225f9f04a7b4069d0f9677ca620d1fd92262bf419b67aeeb4aed | R | 2,466 | 77 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(keras3)
library(kerastuneR)
library(argparse)
source("src/soil_tuner_classes.R")
### Passes the random seed for weight initialization and reproducibility
parser <- ArgumentParser()
parser$add_argument("--seed", type = "integer")
args <-... |
aa257a13fd9a867638ce73eaa768b42e312693a6c08d322370e806d90284c6e5 | R | 2,472 | 77 | rsqrd <- function(observe, model){
ss_res <- sum((observe-model)^2)
y_bar <- mean(observe)
ss_tot <- sum((observe-y_bar)^2)
return (1-ss_res/ss_tot)
}
################################
args <- commandArgs(trailingOnly=T)
encoded_file <- args[1]
train_index_file <- args[2]
outDirection <- args[3]
k <- as.numeri... |
c56805c24f24bae264cd5f3e5a938031e548f570d02bc276134101e709b5cbf8 | R | 2,473 | 70 | ### SOURCE:
# https://github.com/gcostaneto/KernelMethods/blob/master/DeepKernels.R
### Marginal likelihood for the first-order arc-cosine kernel at given number of
### layers following Cuevas et al. (2019) G3
### INPUTS
# y = vector of phenotypic data
# Kh = kernel matrix
### OUTPUTS
# Marginal log-likelihood for ... |
2a9d5f073e7dd832674d9a166564088d2ecc687fc7b8850bd31dc2e7a4121351 | R | 2,483 | 116 | library(sjPlot)
library(broom.mixed) # for tidy()
library(dplyr)
library(emmeans)
library(lme4)
library(lmerTest)
library(ggplot2)
library(ggeffects)
library(patchwork)
library(forcats)
library(scales)
df <- read.csv("E:\\work\\q_backup_06_03_2025\\projects\\isttc\\results\\synthetic\\results\\param_fr_alpha_tau_... |
5841b299aea19693073e1d217f9183f17672b82a93fb0f9dfcd8c26aa0968d0b | R | 2,483 | 82 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(keras3)
library(kerastuneR)
source("src/int_tuner_classes.R")
# Get the hyperparameters for the 4 best models
tuner <- CVTuner(
oracle = BayesianOptimization(
objective = Objective("loss", "min"),
max_trials = 40
),
hype... |
78fa356aa6e2f5b899906e5f7e8b4c2d28ccc298e9cfd07f542e778dc257e361 | R | 2,487 | 117 | library(sjPlot)
library(broom.mixed) # for tidy()
library(dplyr)
library(emmeans)
library(lme4)
library(lmerTest)
library(ggplot2)
library(ggeffects)
library(patchwork)
library(forcats)
library(scales)
df <- read.csv("E:\\work\\q_backup_06_03_2025\\projects\\isttc\\results\\synthetic\\results\\param_fr_alpha_tau_... |
843c3099faaeb7b6c870be4c1d600929bfdfd73259456eac960ad38d080121ec | R | 2,489 | 72 | #' This function calculates the feature importance of the deep learning model
#'
#' This function generates a dataframe with the feature importance score of the input features calculated
#' based on the "Permutation Feature Importance" approach.
#'
#' @param X The data with the feature information
#' @param Y The data ... |
e44346b9a30c6723d1a64c8a89e806f522aa2fcbca94b27689679b308b7dae8b | R | 2,493 | 73 | #if (!requireNamespace("BiocManager", quietly = TRUE))
# install.packages("BiocManager")
#BiocManager::install("limma")
#install.packages("reshape2")
#install.packages("ggpubr")
install.packages("PerformanceAnalytics")
#ÒýÓðü
library(limma)
library(reshape2)
library(ggpubr)
library(PerformanceAnalyt... |
2565ce6938d1c6f990c13fc3a766f45cf1432310505b8725a028b23e324f0620 | R | 2,498 | 74 | #' A quick summary of IRT analyses
#'
#' This function is essentially just a wrapper around several functions in this package and produces a summary of the most important aspects of an IRT model, including an item-person-map,test information curve, scale characteristic curve, and conditional reliability.
#'
#' @param ... |
32c9f324d03cdda1603240d8e1110bc334c35d32e662268dfbd6c410d656db9e | R | 2,501 | 77 |
library(here)
library(ggplot2)
library(rlang)
library(rstatix)
library(nlme)
library(cowplot)
library(ggbeeswarm)
library(ggpubr)
library(ggsignif)
data<-read.csv("Analysis_Files/Spontaneous/Data_Rotarod_Analysis.csv", header=TRUE)
data$SLC_Genotype <- data$Genotype
generate_boxplots <- function(input_data, X, Y, m... |
a58ff3b3b4916e63b0630bbce37f3b11f01f925e8f4aadfb7f9cb5e166183fb7 | R | 2,501 | 82 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(keras3)
library(kerastuneR)
source("src/soil_tuner_classes.R")
# Get the hyperparameters for the 4 best models
tuner <- CVTuner(
oracle = BayesianOptimization(
objective = Objective("loss", "min"),
max_trials = 40
),
hyp... |
3001860f0a2cd2cd02ac9b598ebfb8be06eda6a392336582528ced48e05945a2 | R | 2,508 | 77 | #' Benchmarking: Calculate clustering evaluation metrics
#'
#' This function calculates Purity/F1/Jaccard Index score for each cell type, in the case of the ARI score, it will provide the user a global score.
#'
#' @param predicted_clusters The predicted clusters
#' @param true_labels The true cluster labels.
#' @param... |
b01b053f5fbc6054d88fa652893468b78d205456d5e803f65c0d6c44f8d79366 | R | 2,518 | 82 | library(lme4)
library(multcomp)
library(ggplot2)
library(dplyr)
library(car)
echo=FALSE
# Load the data
data <- read.csv("/Users/jkosnoff/Downloads/logdataframe.csv")
# Specifically only look at the ipsilateral response (IL) for the main conditions.
subset_df <- subset(data, location == "IL" & condition != 'sctFUS'... |
cbe2eadfaeb509e0ad844fd0c6fef7fbbc0d4f7de9bba5c20c3157b64874d93e | R | 2,540 | 68 | #' This function prepares the needed inputs to train the dnn model
#'
#' This function generates a list with the needed inputs to generate the dnn model.
#' @param ref.data The Seurat Object that contains the reference data
#' @param ref.assay The assay in the Seurat Object that contains the reference data
#' @param qu... |
ca0eeb90a6fc20fc9e1af59e394056023d16411575f759014aa42287c694e603 | R | 2,543 | 64 |
#' Methods for Epoch class
#'
#' Truncating iEEG data to a specific time range.
#'
#' @param x An Epoch object
#' @param start Numeric value specifying start of new time range
#' @param end Numeric value specifying end of new time range
#' @param checkTimeRange Logical. Whether to check if the time range is correct. T... |
728dd493d9219e0a79f1347014529b9c73ab4f77fb581c225a5ae379e2563c96 | R | 2,544 | 83 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(keras3)
library(kerastuneR)
source(textConnection(readLines("09.pc_comparison/07a.tanh_tuner.R")[7:84]))
# Get the hyperparameters for the 4 best models
tuner <- CVTuner(
oracle = BayesianOptimization(
objective = Objective("loss"... |
a90b66c4d980193d1e857623e2dbbaf83af76bcc903b6138400a6a3e581c4131 | R | 2,544 | 83 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(keras3)
library(kerastuneR)
source(textConnection(readLines("09.pc_comparison/10a.soil_tuner.R")[7:83]))
# Get the hyperparameters for the 4 best models
tuner <- CVTuner(
oracle = BayesianOptimization(
objective = Objective("loss"... |
4758f4a8b1b60035400efe6080300b65b36c4bb3eb55123e0d6b092b296fdd58 | R | 2,547 | 53 | library(dplyr)
library(Seurat)
library(ggplot2)
## Style plots
theme_vln <- theme(panel.border = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
plot.background = element_blank(),
panel.background = elem... |
cd5db639d84a67116e7224a782047e79a8ed0d130d59cb901477e915973a68b6 | R | 2,551 | 77 | # Each.r
# From 'VsFreq', but operate on single trials and singe frequencies
LO_FREQ = 20 # as low as 5
HI_FREQ = 35 # as hi as 120
STEP_FREQ = BANDS.SEQ[2] - BANDS.SEQ[1]
# Go to nearest
if (LO_FREQ < min(BANDS.SEQ))
LO_FREQ = min(BANDS.SEQ) # else
LO_FREQ = (LO_FREQ %/% STEP_FREQ) * STEP_FREQ
if ... |
deaac4e4c36cb07420e1bef5d13b42f6f353d4eb9226dd450f51755e0bc444fd | R | 2,556 | 83 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(keras3)
library(kerastuneR)
source(textConnection(readLines("09.pc_comparison/05a.sigmoid_tuner.R")[7:84]))
# Get the hyperparameters for the 4 best models
tuner <- CVTuner(
oracle = BayesianOptimization(
objective = Objective("lo... |
a3366fdc0ab6ee51d3f2e625675e0067c28a34cca4bd99469ac712f26fd2ccb5 | R | 2,560 | 73 | #' This function gives the prediction of the deep neural network (DNN) model.
#'
#' @param dnn_model The DNN model output of the ds_dnn_model function.
#' @param model_data The output of the ds_split_data_dnn function.
#' @param query.data The scaled/normalized gene expression data you want to annotate.
#' @param thres... |
b500b7e798dc56215f9af0dd0ee25e00c40a5ac95cb181957befc50eedfa74c7 | R | 2,570 | 51 | #' Chooses a soft-tresholding power
#'
#' This function examines the data to find a suitable soft-thresholding power. It also helps to know if there is a scale-free topology.
#' @param datexpr A matrix of gene expression. Thi SHOULD BE the expression data normally stores under @@assays$RNA@@data for single cell object... |
bb6acde545d8cde765d9e20fdd234565691c9ddc6149e3ac169e02af5ef5accc | R | 2,571 | 54 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
res <- list.files("results/03.gaussian_kernel", "*metrics*", full.names = TRUE) %>%
map_df(read_csv, show_col_types = FALSE) %>%
mutate(Source = "Gaussian",
Model = factor(Model, levels = c("G", "S", "W", "GSW"), ordered = TRUE)... |
20fa8afe5a197d85bf0eff1536d436d644dbfbae28a761dd13325962564901ec | R | 2,576 | 83 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(keras3)
library(kerastuneR)
source(textConnection(readLines("09.pc_comparison/08a.tanh_PC_tuner.R")[7:84]))
# Get the hyperparameters for the 4 best models
tuner <- CVTuner(
oracle = BayesianOptimization(
objective = Objective("lo... |
cc948dfd1caaa48f30e83ff38cf6d77fc9a27c4f8758eb5f07fdd0e38006c765 | R | 2,577 | 78 | ##' Sort the features of NLPCA object
##' @param nlnet The nlnet
##' @param trainIn Training data in
##' @param trainOut Training data after it passed through the net
##' @return ...
##' @author Henning Redestig
sortFeatures <- function(nlnet, trainIn, trainOut) {
weightsAll <- nlnet@weights$current()
weights <- w... |
7b19b88ff353ef86b5d09243b633ad6c5d26f8c45ddc6b53902bf67ad24e58f4 | R | 2,578 | 84 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(keras3)
library(kerastuneR)
source(textConnection(readLines("09.pc_comparison/04a.L2_tuner.R")[7:96]))
# Get the hyperparameters for the 4 best models
tuner <- CVTuner(
oracle = BayesianOptimization(
objective = Objective("loss", ... |
c9193315b78f15c42591d35ff69fa4e4ed61f43c000160ca4cc0e61aa939773a | R | 2,586 | 52 | # code for extended figure 3 panel a
# source the functions from FLXenium folder, which loads useful libraries and has
# a bunch of functions useful for general analysis of spatial data
miceadds::source.all('~/Multidimensional_STEPN/4.Xenium/resources/FLXenium/')
# source the ependymoma project specific functions
so... |
ad452892669dce2f63001027fd731a8791b8b430eeb41a165d2a4194616cf335 | R | 2,588 | 83 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(keras3)
library(kerastuneR)
source(textConnection(readLines("09.pc_comparison/06a.sigmoid_PC_tuner.R")[7:84]))
# Get the hyperparameters for the 4 best models
tuner <- CVTuner(
oracle = BayesianOptimization(
objective = Objective(... |
82e7198c4869969390aa23154dd227e3cb8a22fd4637a683253b49603f445dc5 | R | 2,589 | 84 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(keras3)
library(kerastuneR)
source(textConnection(readLines("09.pc_comparison/03a.dense_tuner.R")[7:83]))
# Get the hyperparameters for the 4 best models
tuner <- CVTuner(
oracle = BayesianOptimization(
objective = Objective("loss... |
271166d82c4d4c16bf1c140999c2e4ce74417f458896f3ff8ba5c7116effe7b8 | R | 2,590 | 74 | #install.packages("colorspace")
#install.packages("stringi")
#install.packages("ggplot2")
#if (!requireNamespace("BiocManager", quietly = TRUE))
# install.packages("BiocManager")
#BiocManager::install("org.Hs.eg.db")
#BiocManager::install("DOSE")
#BiocManager::install("clusterProfiler")
#BiocManager::insta... |
5164e3ee03b35f0d5248f5b431f38f94de70b607cc4187463c336c055029554b | R | 2,592 | 54 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
res <- list.files("results/01.replicate_daniel", "*metrics*", full.names = TRUE) %>%
map_df(read_csv, show_col_types = FALSE) %>%
mutate(Source = "Replicated",
Model = factor(Model, levels = c("G", "S", "W", "GSW"), ordered = TR... |
df0751ed4cacc5b8f04e9bf298e57b0c89313c4feb0a3408590b647b43d78e79 | R | 2,597 | 69 | # ================================================================
# quick_enrich.R – one-function wrapper around clusterProfiler
# Joseph Boktor • May-2025 (GPT assisted scritp)
# ================================================================
suppressPackageStartupMessages({
library(DESeq2) # differential expr... |
69a556fc088e519f7bfaebb2e93aaa6295a72576dcfa3b3588426fadaa76105c | R | 2,612 | 99 | library(sjPlot)
library(broom.mixed) # for tidy()
library(dplyr)
library(emmeans)
library(lme4)
library(lmerTest)
library(ggplot2)
library(ggeffects)
library(patchwork)
library(forcats)
library(scales)
df <- read.csv("E:\\work\\q_backup_06_03_2025\\projects\\isttc\\results\\synthetic\\results\\bin_size_runs\\full... |
f102948985938539d037eb2cfd675a6b24406af18ff35a0a27c56cccbc38294e | R | 2,623 | 86 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(tensorflow)
tf$config$list_logical_devices()
library(keras3)
library(kerastuneR)
source(textConnection(readLines("10.interactions/02a.tanh_PC_int_tuner.R")[11:105]))
# Get the hyperparameters for the 4 best models
tuner <- CVTuner(
o... |
78c14d0ab4688b4e3711cc747a16340389010467af4a9255d6577f82c428ee00 | R | 2,624 | 86 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(tensorflow)
tf$config$list_logical_devices()
library(keras3)
library(kerastuneR)
source(textConnection(readLines("09.pc_comparison/11a.weather_tuner.R")[7:103]))
# Get the hyperparameters for the 4 best models
tuner <- CVTuner(
oracl... |
5b28ddc74d414ff648fe644be7a511e7f972af304ca8bbe9d495aa93bfa81ed0 | R | 2,627 | 77 | ##' Model initialization for Bayesian PCA. This function is NOT
##' inteded to be run separately!
##'
##' The function calculates the initial Eigenvectors by use of SVD
##' from the complete rows. The data structure M is created and
##' initial values are assigned.
##' @title Initialize BPCA model
##' @param y numeri... |
85e0719f71c3718579659d4a448dfaa37d0573c67e080e22367b2c86b5d1c23b | R | 2,629 | 52 | library(dplyr)
library(Seurat)
library(ggplot2)
## Style plots
theme_vln <- theme(panel.border = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
plot.background = element_blank(),
panel.background = eleme... |
f62d7203e899d5e3a1c77cd8ac8422dc1948d95a4f64081c5f92286fb4efb35b | R | 2,629 | 100 | library(sjPlot)
library(broom.mixed) # for tidy()
library(dplyr)
library(emmeans)
library(lme4)
library(lmerTest)
library(ggplot2)
library(ggeffects)
library(patchwork)
library(forcats)
library(scales)
df <- read.csv("E:\\work\\q_backup_06_03_2025\\projects\\isttc\\results\\synthetic\\results\\bin_size_runs\\tria... |
135237cc871186c9f02103208ef9812bd9b8825f20560e1085af02e4ad815288 | R | 2,631 | 88 | ####hierarchical clustering
library(data.table)
dt_parameter <- read.csv("L:/GBW-0138_PAVER/Natalie/C2_ethoscope/ethoscope_results/___AI/_revision_park1_21/summary_results_PDcollection_stats.csv")
scale_sleep5 <- read.csv("L:/GBW-0138_PAVER/Natalie/C2_ethoscope/ethoscope_results/___AI/_revision_park1_21/scal... |
5f423d690717225855a3d7b50debbd9d254553badf9ef54d9eeab96ca593ef6f | R | 2,632 | 86 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(tensorflow)
tf$config$list_logical_devices()
library(keras3)
library(kerastuneR)
source(textConnection(readLines("09.pc_comparison/12a.ReLU_hPC_tuner.R")[10:86]))
# Get the hyperparameters for the 4 best models
tuner <- CVTuner(
orac... |
7966674eafc834dbfc819495562efbf37b3764039cbe802d0a9f70f52cfd32d6 | R | 2,637 | 87 | #####################################
# Example of hierarchical metacognitive efficiency (Mratio)
# at the group level
# exemple of trace plots and posterior distribution plots
# using the Function_metad_group.R
#
# AM 2018
#####################################
## Packages -------------------------------------------... |
a950509d89b3be3e27afbcff1eb8b137ccba8bc75b1ebae15487f963da7bf4b3 | R | 2,637 | 86 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(tensorflow)
tf$config$list_logical_devices()
library(keras3)
library(kerastuneR)
source(textConnection(readLines("09.pc_comparison/14a.tanh_hPC_tuner.R")[10:87]))
# Get the hyperparameters for the 4 best models
tuner <- CVTuner(
orac... |
bb6976c80df808ea8e60c294ed77be6965d50863b87ed7514d90a5f8cd30ee3e | R | 2,643 | 86 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(tensorflow)
tf$config$list_logical_devices()
library(keras3)
library(kerastuneR)
source(textConnection(readLines("10.interactions/03a.sigmoid_PC_int_tuner.R")[11:105]))
# Get the hyperparameters for the 4 best models
tuner <- CVTuner(
... |
d98436d861f10d7da0ff45b1089417126da0f505a4964618c766acea8c875445 | R | 2,646 | 86 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(tensorflow)
tf$config$list_logical_devices()
library(keras3)
library(kerastuneR)
source(textConnection(readLines("09.pc_comparison/13a.sigmoid_hPC_tuner.R")[10:87]))
# Get the hyperparameters for the 4 best models
tuner <- CVTuner(
o... |
1a52beed0d27e8ee43e44e09fa54eaa95e887f6fafb94b4a7d8b898e7faf0cdc | R | 2,653 | 86 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(keras3)
library(kerastuneR)
source("src/gPCs_tuner_classes.R")
# Get the hyperparameters for the 4 best models
tuner <- CVTuner(
oracle = BayesianOptimization(
objective = Objective("loss", "min"),
max_trials = 40
),
hyp... |
cb3efc3bbc476529d60b9411c52614413bd2fd3f65ad4c2d676abce5e702ad7d | R | 2,655 | 63 | source('/cluster/share/atac_group/mafas5/chen_ws/prepare.R')
addArchRThreads(threads = 30)
proj <- loadArchRProject('/cluster/share/atac_group/mafas5/chen_ws/SST/Save-SST-project')
ArrowFiles <- getArrowFiles(proj)
library(parallel)
calPM <- function(ArrowFile, allCells=proj$cellNames, features=proj@peakSet, ceiling... |
f51bc905edbef4087f6b5aff17e11890be4bd985c59fe30168fefcd5286d5c71 | R | 2,655 | 95 | library(tidyverse)
library(ggsignif)
df<- read.table("age.txt", header = TRUE, sep = "\t" )
library(ggplot2)
p1<-ggplot(df, aes(x = gut_age)) +
geom_histogram(binwidth = 1, fill = "skyblue", color = "black") +stat_bin(
binwidth = 1,
geom = "text",
aes(label = after_stat(count)),
vjust = -... |
d8f2f2a7cafd35a9875304e48ea104bf7ae2ed43087c263da440516b6b38ccea | R | 2,667 | 64 | library(ggplot2)
library(cowplot)
library(tidyverse)
colors_to_use <- clusterExperiment::bigPalette
base_dir <- "/n/scratch/users/s/sad167/EPN/scRNAseq"
metadata <- read_excel(file.path(base_dir, 'metadata.xlsx'))
SampleName <- unique(metadata$SampleName)
files <- sprintf(file.path(base_dir, 'analysis/qc/data/ind... |
90e4725a65f545e1c339baf53054ed3314dc644282771e18c4703669835d6184 | R | 2,678 | 99 | #!/usr/bin/Rscript
#' Code used to generate Supplementary Figure 20.
#' Provide as input: (1) a .tsv file with the expression data, rownames
#' should be [x_coordinate]x[y_coordinate]; and (2) a list of genes to
#' be visualized. Output directory can be specified, default is wd.
library(argparse)
library(ggplot2)
li... |
e1bd45cfb1929cccf31a65b6595324c1db8fafa06f89d976593d5efde3f20a9e | R | 2,681 | 84 |
# ---- tryToNum ----
test_that("tryToNum converts valid input", {
expect_equal(tryToNum("123"), 123)
expect_equal(tryToNum(c("1", "2", "3")), c(1, 2, 3))
expect_equal(tryToNum(3.14), 3.14)
})
test_that("tryToNum returns NULL on invalid input", {
expect_null(tryToNum("abc"))
expect_null(tryToNum(c("1", "a", ... |
3f301e8a36ac948d954a5d4b5b88295e4cc1b9ed0419d337f134437fa9c8ec8e | R | 2,698 | 65 | library(Seurat)
library(dplyr)
library(data.table)
library(Matrix)
library(edgeR)
source('../../R/scTWAS_IRLS.R')
gene_info <- fread('../Onek1k/1k1k_gene_GRCh37.txt')
data_dir <- './data/ROSMAP/Gene Expression (snRNAseq - DLPFC, Experiment 2)/processed (March 2024 update)'
sum_sparse <- function(mats) {
all_rows <... |
4c63076250a1a8e9d8de7058d7b9c41c7b7928d6ce8c2a4d6fb9b09ef90e3cbe | R | 2,711 | 94 | library(ggplot2)
library(rlang)
library(cowplot)
library(viridis)
library(tidyr)
library(dplyr)
setwd("~/Documents/pdbehavior/")
data<-read.csv("Analysis_Files/SMT/Buried Food Pellet - Sheet1.csv", header=TRUE)
data$SLC_Genotype <- factor(data$SLC_Genotype, levels=c("WT", "HET", "MUT"))
generate_boxplots <- function(... |
f8eacb551db735e8cdcc0d4a63f71b3939f799d4e91deeb4672b3654ad9f47e0 | R | 2,713 | 66 | ---
title: "Prepare dataset"
output: html_document
---
```{r include = FALSE}
#setwd("analysis")
```
# Load the data
```{r}
#load data
dane <- read.csv("../dane/mismatch_peaks.csv")
# use only the first deviant
dane <- dane[dane$mismatch == "mismatch_1", ]
```
# Info about entropy
The following jitter rates were u... |
7aecbe97cf0f4d5626942b51d1717a7a02a92afe246d00767d6c4f8276e56187 | R | 2,726 | 83 | library(here)
library(ggplot2)
library(dplyr)
library(nlme)
library(cowplot)
library(tidyr)
## Environment --
here::i_am("src/Figure_4_Synucleinopathy.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}})) +
#geom_... |
5c73e77eac7e2cdb5addfb0a7ba4f796d4eff6b503eb927170042eba54fad8f4 | R | 2,730 | 91 | setwd("/homes/amkusmec")
library(tidyverse)
library(keras)
library(abind)
### Data preparation
# Grain yield data
cat("Prepare grain yield...\n")
ref <- read_csv("kernels_in_GP/processed/reference_sorted.csv", show_col_types = FALSE)
idx_train <- which(ref$Set == "Train")
idx_test <- which(ref$Set == "Test")
y_train... |
50706fc7cca03d980e837049ad91ba0bfd67b25485ccdf1f4a435bdd56d66903 | R | 2,735 | 82 | #' Benchmarking: Plotting the output of the function `bench_calcAUC()`
#'
#' This function plots the output of the function `bench_calcAUC()`
#'
#' @param out The output of the function `bench_calcAUC()`
#' @param bar_cols Color vector for the bar plot layer
#' @param ct_mapping Option to fill bar plot layer by groupin... |
7fc1691d8bf898393c9f67f406f48a69d67f8310234f73b445005efd3522a72e | R | 2,736 | 66 | library(Seurat)
library(data.table)
library(dplyr)
library(optparse)
option_list = list(
make_option("--model_hidden_batch", action="store", default=TRUE, type='character',
help="whether to model hidden batch effects"),
make_option("--ct", action="store", default="Microglia", type="character",
... |
60f471f54a166aea43e53d623c34a300e8d88ff28b1dc7f275addd471edd87a8 | R | 2,755 | 87 | setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
library(tidyverse)
library(keras3)
library(kerastuneR)
source("src/weather_tuner_classes.R")
# Get the hyperparameters for the 4 best models
tuner <- CVTuner(
oracle = BayesianOptimization(
objective = Objective("loss", "min"),
max_trials = 40
),
... |
de257394acfd8a48e7b595cf3b5047e3cc60ebca9ca5ff74c16406a078d055cc | R | 2,755 | 78 | #if (!requireNamespace("BiocManager", quietly = TRUE))
# install.packages("BiocManager")
#BiocManager::install("limma")
#if (!requireNamespace("BiocManager", quietly = TRUE))
# install.packages("BiocManager")
#BiocManager::install("sva")
#ÒýÓðü
library(limma)
library(sva)
setwd("C:\\Users\\wx197\\... |
16626610b8e781096d1ddc52ac7c17c788194c251370cd16a5e66aa09513136e | R | 2,756 | 100 | ---
title: "Correlation_Analysis"
output: html_document
date: "2025-06-09"
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Configuration
## Load library
```{r}
library(data.table)
library(dplyr)
library(ggplot2)
library(ggpubr)
int_dir = "analysis/adata_obj/"
int_dir_cc = paste0(int_dir, "... |
8b573d3b2aafff6d11fcee978d6d6a13964e30626a1f0756f060ac633fd1185e | R | 2,758 | 81 |
library(tidyr)
library(dplyr)
library(ggplot2)
library(cowplot)
library(nlme)
library(ggpubr)
setwd("C:/Users/Jacobs Laboratory/Documents/JCYang/SLC_GitHub/slcproject/PFF_Microbiome/")
data <- read.csv("behavior/PFF Rotarod - PFF_Rotarod_Analysis.csv", header=TRUE)
data <- data %>% filter(Day=="three")
### Split i... |
b2868a9e9de45c641013e63005ed5f7e17ea6534d6665b9de6d13fefede6e9e9 | R | 2,759 | 84 |
setwd('C:/Users/User/Desktop/Alina-SpikeSorting')
# Erforderliche Pakete laden
library(lme4)
library(glmmTMB)
library(ggpubr)
library(broom)
library(ggplot2)
# CSV-Datei einlesen
df <- read.csv("all_collected_scores.csv")
# Liste der Spaltennamen (Metriken)
columns <- list("TP", "FP", "TN", "FN")
# Schleife über d... |
f5f7d97fadff3a8bc940c7a306adbc3c05f3caf95452c8f577edc4c7baf0c229 | R | 2,772 | 90 | setwd("/homes/amkusmec")
library(tidyverse)
library(keras)
library(abind)
library(argparse)
source("tuner_src/weather_build_model.R")
parser <- ArgumentParser()
parser$add_argument("--seed", type = "integer")
args <- parser$parse_args()
### Prepare the training and validation data
# Grain yield data
ref <- read_... |
6b8b54c72bfe08c7ba3655251d1e80533c2bf36f1ec37f0bba38d487a76724ce | R | 2,778 | 86 | library(here)
library(ggplot2)
library(dplyr)
library(nlme)
library(cowplot)
library(tidyr)
## Environment --
here::i_am("src/Figure_S5_GFAP.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}})) +
#geom_violin(alpha... |
9374ebcfd155124274ad87ee07e97ca61315a29e7dc2c5662ceef932ad0adc69 | R | 2,794 | 40 | # UI-elements for Home tab
tabPanel(
title = "Home",
icon = icon("home"),
# Main container
div(id = "home",
br(),
p(class = "lead", HTML("<strong><span style='color:#3a69ae;'>Single-cell multidimensional profiling of tumor cell heterogeneity in supratentorial ependymomas</span></strong>")),
d... |
31ed5be0adaefd5149f89367e0c7f9a4622cd13c6184cf23f15b650e6d956494 | R | 2,811 | 88 | ##' Check a given data matrix for consistency with the format
##' required for further analysis.
##' The data must be a numeric matrix and not contain:
##' \itemize{
##' \item Inf values
##' \item NaN values
##' \item Rows or columns that consist of NA only
##' }
##' @title Do some basic checks on a given data matrix
#... |
47fad499051fc55b76f69af962db3b7527de06e3980292a63fc9e502c9f23f0e | R | 2,811 | 132 | 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... |
a06361c42b7d60c31df836d3cd9e582301a697633c045dfcf42b35aad2bd2d02 | R | 2,811 | 101 | #####################################
# Example of hierarchical metacognitive efficiency (Mratio) calculation
# for two domains and correlation coefficient
# exemple of trace plots and posterior distribution plots
# using the Function_metad_groupcorr.R
# The same function allows also the calculation for 3 and 4 doma... |
c096d2c99a6a45aae8d84dc223d78deb20a6bcb5bee5e8f6434a3b18ef5cde14 | R | 2,821 | 60 | #' Plot association of biological aging measures with chronological age.
#'
#' @title plot_ba
#' @description Plot association of biological aging measures with chronological age.
#' @param data A dataset with projected biological aging measures for analysis.
#' @param agevar A character vector indicating the names of ... |
0606c95923ee5fc1b3d1eb0be4a8a3986d9b8f8ed3d44f9c9a136d7963d59200 | R | 2,847 | 81 | ##' The function contains the actual implementation of the BPCA
##' component estimation. It performs one step of the BPCA EM
##' algorithm. It is called 'maxStep' times from within the main loop
##' in BPCAestimate.
##'
##' This function is NOT intended to be run standalone.
##' @title Do BPCA estimation step
##' @p... |
31393778ba7a8fb315e54a2ba2267bc0bdb9f75c28e86f3a7feb284c1b466107 | R | 2,848 | 57 | # code for extended figure 1 panel g
# source the functions from FLXenium folder, which loads useful libraries and has
# a bunch of functions useful for general analysis of spatial data
miceadds::source.all('~/Multidimensional_STEPN/4.Xenium/resources/FLXenium/')
# source the ependymoma project specific functions
so... |
a230d51cf160d3ee3818eac478032e4c441acdb9a07cd0e5d82f87ad5a0dc874 | R | 2,852 | 57 | # master_stats_analysis.R
# Replication script for: "Distinct representational properties of cues and contexts..."
source("roi_lme_analysis.R") # Load the cleaned functions
# -------------------------------------------------------------------------
# 1. LOAD DATA
# ----------------------------------------------------... |
76bd71bf68ed6df0c3b35a408d93e7012504a99f60b28fc70545987a5362ed7d | R | 2,876 | 80 | # setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/")
setwd("/homes/amkusmec/kernels_in_GP")
library(tidyverse)
library(RSpectra)
library(tensorEVD)
library(argparse)
### Process command-line arguments --------------------------------------------
parser <- ArgumentParser()
parser$add_argument("--kernel1", "-k1", ty... |
376d75f9cafdece805413edfae3c438d79ef215897bc832f16424d68d253b78a | R | 2,881 | 82 | cli::cli_h2("┗ [Vasc-AoP] Loading stats helpers")
#------------------------------------#
####🔺Summarizing data or a model ####
#------------------------------------#
distribution_summary <- function(data, dvs, between = "Condition") {
data |>
dplyr::select(all_of(between), all_of(dvs)) |>
tidyr::... |
9a2f8b55dd15b465154e4d53cb0665ee1c332f561887070beb839b3da5ee7a5c | R | 2,889 | 65 |
#' Calculates the graphic networks of scWGCNA data
#'
#' This function calculates the graphic networks of each module in an scWGCNA list object. Returns an updated object.
#' @param scWGCNA.data scWGCNA.data. An scWGCNA.data object, as calculated by run.scWGCNA().
#' @return An scWGCNA.data object, updated with the s... |
eefc77cdc09448db8fb50cbe23886c851be47bacc117ffd1872a2d492295563d | R | 2,891 | 61 | #' @title
#' Milo class definition
#'
#' @description
#' The class definition container to hold the data structures required for the Milo workflow.
#'
#' @slot graph An igraph object that represents the kNN graph
#' @slot nhoods A CxN binary sparse matrix mapping cells to the neighbourhoods they belong to
#' @slot nhoo... |
28fa258cfb97d98702aae17ddec5b4bf1c6ac1c9ffad620d112a29db2c9a3a80 | R | 2,905 | 109 | library(tidyverse)
library(synExtra)
library(data.table)
library(tximport)
library(qs)
library(powerjoin)
synapser::synLogin()
syn <- synDownloader("~/data", .cache = TRUE)
rosmap_quants_raw <- syn("syn43841162") %>%
fread()
rosmap_clinical <- syn("syn3191087") %>%
read_csv()
specimen_meta <- syn("syn21323366")... |
7f61b40b0470f98e974ad3e87a281a6d04d6896fc2df8f2a620dca8f7e14e705 | R | 2,912 | 86 | Sys.setenv(LANG = "en")
rm(list = ls())
#library('performance')
library('sjPlot')
library('lme4')
library('rio')
library('emmeans')
library('ggplot2')
#library('lmerTest')
df <- import("Q:\\Personal\\Irina\\projects\\isttc\\results\\monkey\\fixation_period_1000ms_no_empty\\acf_tau_full_df.csv")
df$method <- as.fa... |
f3d3d440867da6dfae26839faeef9f283b75cd66ddaee863333554c2ba55c026 | R | 2,921 | 90 | #!/usr/bin/env Rscript
library(optparse)
library(Maaslin2)
# arguments
# @dir_job, this is where job will be run, should include inputs and outputs folders
# @job_meta, this is the meta-data file, which dicatates which samples to compare by Function
# @job_data, this is the functional data file, whcih dictat... |
2e683936a1bf74569317c3eafb241b9dda2d5d98fe4db0da20d32b76f9f07978 | R | 2,922 | 88 |
setwd('C:/Users/User/Desktop/Alina-SpikeSorting')
# Erforderliche Pakete laden
library(lme4)
library(glmmTMB)
library(ggpubr)
library(broom)
library(ggplot2)
# CSV-Datei einlesen
df <- read.csv("all_collected_scores_spike.csv")
df$Model <- as.factor(df$Model)
df$FeatureSet <- as.factor(df$FeatureSet)
df$Model <- rel... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.