sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
17k
content
stringlengths
1
200k
abedbdb2159689e3a5f6641bcb0652f7af9426ecf3b098e987c163806689bc47
R
2,939
91
--- title: "Supercluster Crossvalidation" output: html_notebook --- Version 1.0, July 2025, SA For leave1out crossvalidation purposes, this script provides 212 clustering solutions leaving a subject out each time. - Input: Hippo_BinxAxis_F_betas.txt and subj_list_n212.txt - Output: clusters_leave1out.txt - cluster...
d9b14367c48bc606c844bc58c0421f2be1ae3779d2b3bd1d39236cb6d194d6be
R
2,949
68
# Load necessary libraries library(lme4) library(lmerTest) library(emmeans) library(ggplot2) library(dplyr) # ------------------------------------------------------------------------- # 1. Behavioral Analysis: US Expectancy Ratings # ------------------------------------------------------------------------- # Analyzes ...
a4741bc5cc740137667c090ad07bc55108e65ad12e8eba989c8ae8188c882456
R
2,957
99
library(ggplot2) library(rlang) library(cowplot) library(viridis) library(tidyr) library(dplyr) setwd("~/Documents/pdbehavior/") data <- readr::read_csv(here("Analysis_Files", "ASO","ASO Food Pellet - Buried_Food_Pellet.csv")) data$SLC_Genotype <- factor(data$SLC_Genotype, levels=c("WT", "HET", "MUT")) generate_boxpl...
ed601b5bc556ee44f70cc863283b4976f73e932f355b563a4eee2180aae567b0
R
2,987
98
library(sjPlot) library(broom.mixed) # for tidy() library(dplyr) library(emmeans) library(lme4) library(lmerTest) library(ggplot2) library(moments) library(ggeffects) library(patchwork) library(forcats) library(scales) df <- read.csv("E:\\work\\q_backup_06_03_2025\\projects\\isttc\\results\\mice\\dataset\\cut_30...
cd211272215674f3cbfcb4bc2ed7d052147497c8343687194759758620fb9fdf
R
2,992
86
#' 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...
1556e3cb0de928a7a854925b43572c54bc2f926d7421754960308f18672da4e4
R
3,010
96
# Concat.r if (exists("Diff1_EM") && exists("Diff1_CC") && exists("Diff1_CCC")) { # pdf("Concat.pdf") # Set up the plot par(las=1) par(xpd=NA) par(oma=c(4,0,2,0)) par(mfrow=c(1,1), mar=c(3,4,4,2)+.1) LIM1 = -1.5 LIM2 = 4.5 if (SCALE==0) { LIM1 = LIM1 * 5 LIM2 = LIM2 * 2.25 ...
f86801f2e82472ca635c543755edefb98cbfe78ff8095b3ea9c9f8ef0c1bbbd2
R
3,065
81
library(Matrix) library(monocle3) library(cicero) library(stringr) library(argparse) library(GenomicRanges) library(BSgenome.Mfascicularis.NCBI.5.0) library(ArchR) library(parallel) library(tidyverse) parser <- ArgumentParser(description='extarct bedfiles from ArchR project') #parser$add_argument('-I', '--input', help...
db2f6097b1cd4d5b4b8efa21fd5342b686cc6def29374e902c44618d6c0de160
R
3,111
109
#' Plotting item characteristics curves #' #' This function takes a fitted mirt-model and the underlying data and visualizes item characteristic curves. #' #' #' @param model an object of class `SingleGroupClass` returned by the function `mirt()`. #' @param items numerical vector indicating which items to plot (curr...
7c79805cafc72ba7b19128c3ab732dceef09ed7c8832a33826eb4206f37adf52
R
3,120
68
library(ggplot2) library(cowplot) library(tidyverse) colors_to_use <- clusterExperiment::bigPalette base_dir <- "/Users/sdaniell/Dropbox (Partners HealthCare)/Sara Danielli/Project/Ependymoma/6 - scRNAseq models" metadata <- read_excel(file.path(base_dir, 'metadata.xlsx')) FileName <- unique(metadata$FileName) Pro...
a1f4471841d6832c490d1a96867175e0a545fb24b4ff81b8c9ca1db233048329
R
3,135
77
library(Matrix) library(fitdistrplus) library(ggplot2) library(argparse) parser <- ArgumentParser(description='fit model for filtering peak link') parser$add_argument('-T', '--type', help='input subclass type') parser$add_argument('-O', '--path', help='output directory path') args <- parser$parse_args() ctype <- args$...
b6a0f195b3756ab03bfeccde94a2b514e157d46e7b24601ab81b7141f2b81194
R
3,136
100
suppressPackageStartupMessages({ library(splatter) library(scater) }) library(stats) library(rhdf5) library(tidyr) library(stringr) # n_list <- c(100, 200) # args <- commandArgs(trailingOnly = TRUE) # n <- 200 #n_list[1+as.numeric(args[1])] args = commandArgs(trailingOnly=TRUE) if(length(args)==0){ ind <-...
861a1b3dd98490978b82db8a4e9283b1d6387191d5cf5084bcc3bc6f3c28dae7
R
3,144
60
# this file takes a single input, the sample_name (such as 'STEPN47_Region_2'). One can simply create a variable # by running something like: "sample_name <- 'STEPN47_Region_2'", and run this script line by line, skipping the # first part where the sample_name is read from supplied arguments, or can execute this scri...
965dcb2b0b5169a49b93e66cee82382384a59ae1bdcb32086874acd847ffe882
R
3,160
81
# install.packages("BiocManager") # BiocManager::install("clusterProfiler") # BiocManager::install("org.Hs.eg.db") # BiocManager::install("AnnotationDbi") # BiocManager::install("rrvgo") library(clusterProfiler) library(org.Hs.eg.db) library(AnnotationDbi) library(rrvgo) library(purrr) library(stringr) library(ggplo...
df3a4b472a08132738d86e23e9398000abf82d0cbc9adeb68f2efe4de3707d8a
R
3,173
88
#if (!requireNamespace("BiocManager", quietly = TRUE)) # install.packages("BiocManager") #BiocManager::install("limma") #BiocManager::install("org.Hs.eg.db") #BiocManager::install("DOSE") BiocManager::install("clusterProfiler") BiocManager::install("enrichplot") #ÒýÓðü library(limma) library(org.Hs.eg....
f809def9fc43a1dc2a7104676c24353c25c9d01e15dc3a46e3c44f29f90e22b2
R
3,178
100
##' Line search for conjugate gradient ##' @param nlnet The nlnet ##' @param dw .. ##' @param e0 .. ##' @param ttGuess .. ##' @param trainIn Training data ##' @param trainOut Fitted data ##' @param verbose logical, print messages ##' @return ... ##' @author Henning Redestig, Matthias Scholz lineSearch <- function(nlne...
a847edc85213c0717d90f0e5f39bd7327f78e83a360594cee7f21541ad0b2e8c
R
3,192
89
merge_ieeg_and_behavioral_data <- function(roi, sub, distance_df, timelock_folder, keyword_include = "*", keyword_exclude = "9999"){ shift <- 0 hc_elecs <- list.files(path(here(), "data_mount", "remote", "preprocessing", sub, "ieeg", timelock_folder)) hc_elecs <- hc_elecs[grepl(keyword_include, hc_elecs) & !gr...
1b92d36db35941aa241dc533820c7c355e53e36b14fb2e7a60f55b2ebe6f02cd
R
3,204
84
library(ArchR) library(Seurat) library(tidyverse) library(presto) library(parallel) library(chromVARmotifs) library("GenomicRanges") library("BSgenome.Mfascicularis.NCBI.5.0") gene_file="/cluster/share/atac_group/mafas5/ref/MJ_creat_Gene_Macaca_fascicularis_5.0.91.2.2.V20230616.txt" exon_file="/cluster/share/a...
ff7b5fc89307582b0465efef456da0c25ae06aed84a2cc221b3a696eb58ddf92
R
3,229
90
df<- read.table("mofafactor_most_cor_features.tsv", header = TRUE, sep = "\t" ) corr_coef <-cor.test(df$Factor2, df$Sarcosine, method = "pearson")$estimate corr_p <- cor.test(df$Factor2, df$Sarcosine, method = "pearson")$p.value p3<-ggplot(df, aes(x = Factor2, y = Sarcosine, color = group)) + geom_point(size =2...
be4f395797fa9584087e8075f04116028031d4d8e312dd899f93334c8e7d8809
R
3,240
87
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(21L)) num_layers <- hp$Int("layers", min_value = 1...
e4b11be7aea8ed5b20a6dc7a129346233ea8ba4ba183f7e055857b92378a0408
R
3,243
87
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(1725L)) num_layers <- hp$Int("layers", min_value =...
eff7bc89364a23d656a4e20a6af84cc55e6327ba7d5187f9384669ba50b63d7d
R
3,275
102
tryToNum <- function(x) { x <- tryCatch(as.numeric(x), error = function(e) x, warning = function(w) x) if (is.numeric(x)) { return(x) } else { return(NULL) } } isWholeNumber <- function(x) { stopifnot(is.numeric(x)) sapply(x, function(y) y %% 1 == 0) } .message <- function(ve...
111709729a665ac5bbe2b1ef6745b99369a84917f21dc012e220b0270659550d
R
3,282
68
library(dplyr) library(Seurat) library(ggplot2) ## load signatures for scoring ## Read ZFTA::RELA patient scores NMFmarkers <- readRDS(file.path(resource_dir, "ZFTA.gene.set.merged.rds")) ## Combine neuronal signatures NMFmarkers$Neurons <- c(NMFmarkers$ZFTA_NPC.like.1, NMFmarkers$ZFTA_NPC.like.3,NMFmarkers$ZFTA_NPC....
70fb0d211034a4843994d1905581b9d8c3fd30b4a952d1f313b0422b8344261b
R
3,311
92
#' split a ggplot object into 2 ggplots; original plot minus legend and only the legend #' #' @param p ggplot object #' @importFrom ggpubr get_legend as_ggplot ggplot_split_legend <- function(p) { return(list(plot=p + theme(legend.position = "none"), legend=ggpubr::as_ggplot(ggpubr::get_legend(p)))) } ...
6737c19d7f684af87ddb97ac17bfa4cac0d4f817572740c9a3252b54bad78ff1
R
3,316
91
#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) geneFile="interGenes.tx...
d3feb12e584dd1579c7d24b175e5a0b6e76eb1a16747bc1769bd18fd8fc7ee41
R
3,318
79
#' peptide-level ExpressionSet from long-format peptide data #' #' @param peptides peptide tibble #' @param proteins protein tibble #' @param samples sample tibble #' @importFrom Biobase pData fData exprs annotatedDataFrameFrom #' @export tibble_as_eset = function(peptides, proteins, samples) { # append_log("groupin...
9a6c3cddae36fb1223d2816aa568a87f386f801d679a047b862c3ae49c76186f
R
3,347
93
# # This is a Shiny web application. You can run the application by clicking # the 'Run App' button above. # # Find out more about building applications with Shiny here: # # http://shiny.rstudio.com/ # rotarod <- read.csv("Analysis_Files/ASO/ASO Rotarod - Rotarod.csv",header=TRUE) rotarod$SLC_Genotype <- factor(rot...
46ee17bf80de69ec238a18a42888834cc8d65fa8b36ca186842f5ae57b0a49d0
R
3,353
125
--- output: github_document --- <!-- README.md is generated from README.Rmd. Please edit that file --> ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%", fig.retina = 2 ) ``` <div style = "padding-top:1em; padding-bottom: 0...
ca044d9b126175e4d0fc70403c1ad562dbb5613e602394966f02e5cce38d013a
R
3,366
89
compute_lfp_correlation <- function(sub_list, roi1, roi2, freq_df, tag){ # Loop over subjects # for(sub in sub_list){ # filter to sub df sub_df <- freq_df %>% filter(subject == sub) # pull the first set of regions roi1_elecs <- sub_df %>% filter(region == roi1) %>% pull(elec_s...
910a436e0bb54f45c36418c2d35d49c1cd1625d61e006e730ce6e54eb920a835
R
3,372
92
### SOURCE: # https://github.com/gcostaneto/KernelMethods/blob/master/Gaussian_Kernel.R ### Marginal likelihood for the bandwidth parameter of a Gaussian kernel following ### Perez-Elizalde et al. (2015) J. Agric. Biol. Environ. Stat. ### INPUTS # theta = vector of h and phi # y = vector of phenotypic data # D = dist...
c227dea9e10e41f3573e320d7515483d90596fac7dc1fd301cd2fedbac3411de
R
3,387
120
--- 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(pheatmap) library(ggplot2) library(ggpubr) library(cowplot) library(ComplexHeatmap) libr...
ad6f6f2d229c9a7adbf3dc30a71996ecd7ad0fd4dd61b2dbcb6dd2330d318c4e
R
3,407
97
source('/cluster/home/chencheng/Mac_gaba/prepare.R') library(ArchR) library(parallel) library(tidyverse) library(GenomicRanges) addArchRThreads(threads = 30) library(argparse) parser <- ArgumentParser(description='extarct bedfiles from ArchR project') parser$add_argument('-G', '--group', help='specify a column in colD...
9a94e554b2b50857b50b1912597911522e6f3aa8a1fbde39d5be3ce694bf492a
R
3,441
101
context("Testing buildNhoodGraph function") library(miloR) ### Set up a mock data set using simulated data library(SingleCellExperiment) library(scran) library(scater) library(dplyr) library(patchwork) data("sim_trajectory", package = "miloR") ## Extract SingleCellExperiment object traj_sce <- sim_trajectory[['SCE']...
2f6707733ce96e789c72289ec711a6275490ae63a349b87637aeb1cddb9c8884
R
3,484
88
source('/cluster/share/atac_group/mafas5/chen_ws/prepare.R') library(ArchR) library(parallel) library(tidyverse) library(GenomicRanges) library(argparse) addArchRThreads(threads = 16) parser <- ArgumentParser(description='extarct bedfiles from ArchR project') parser$add_argument('-I', '--input', help='input peak matr...
f706ad23ca98ae3d8561b0838feb677ce81b0a878cd9761c99bb09aa5f905d06
R
3,497
129
# ------------- Figure S7 -------------- #----Figure S7A---- library(Seurat) library(ggplot2) library(patchwork) rm(list=ls());gc() #1.ST validate prognostic marker---- visiumPath <- "./ST/P10-B1/" visiumPath <- "./ST/P10-T1/" visiumPath <- "./ST/P10-T2/" visiumPath <- "./ST/P11-B1/" visiumPath <- "./ST/P1...
4f022e51eb2cb148b1508552cdc83a785b8490716fd3fb1850f2f0077ade3b8a
R
3,501
103
# Select.r # Pick the right files to run (using cell database) MEMORY = F ########################################################################### options(stringsAsFactors = FALSE) a = b = NULL if (MONK=="zen" || MONK=="both") { a = read.table( paste0("/data/coord/zen/zenunits", ifelse(MEMORY, "_memory", ...
7ee91889016034022b6cbd05ae3f5602eb702978a232c59330c2bedbf4f2fba3
R
3,518
93
library(Rtsne) library(here) library(dplyr) library(ggplot2) library(cowplot) ### Compiling PFF data into one single sheet ## Rotarod -- data <- readr::read_csv(here("data", "PFF","PFF Rotarod - PFF_Rotarod_Analysis.csv")) summary_rotarod <- data %>% group_by(MouseID) %>% summarise(mean_latency = mean(Average_La...
816d70ba2ab7b59c6b4f33b19a8cb23ef8cb5dba3a1b4de5768cf601062fb33b
R
3,522
88
setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/") library(tidyverse) source("src/kernel_functions.R") source("src/scale2.R") ### 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 <- un...
7b6b6901eb281188ecd732dc1dbb2c7142427bfa0b2412d00ad9c9e3abf44f00
R
3,526
100
require(tidyverse) require(keras3) require(kerastuneR) require(abind) HyperModel <- PyClass( "HyperModel", inherit = HyperModel_class(), list( build = function(self, hp) { clear_session(free_memory = TRUE) # The input shape comes from the concatenated outputs of the submodels model...
7a6211267aa0875164711c1cbd2885e5868ecf6f6f5708bb840ca2e4a0b7b1c3
R
3,532
52
# devtools::load_all() # load our R package # # ## generate some test data # npep = 4 # nsamp = 5 # nprot = 2 # samples = tibble(sample_id = paste0("s", 1:nsamp), group="grp1", exclude = F) %>% mutate(shortname=sample_id) # peptides = tibble() # for(j in sample(1:nprot, size = nprot)) { # randomize row order, to catch ...
c2626a2241db7e273e082d7ddb5bdd36986f3554bc7fdc063620a4bd9d3ead3e
R
3,554
97
#' Average expression within neighbourhoods #' #' This function calculates the mean expression of each feature in the #' Milo object stored in the assays slot. Neighbourhood expression data are #' stored in a new slot \code{nhoodExpression}. #' #' @param x A \code{Milo} object with \code{nhoods} slot populated, alterna...
8e151ad18758e6134e2661906c1a7229818840168385f8aa3a8f9f828388b248
R
3,585
96
#Read project rds projHeme=readRDS(proj_file) projHeme$group=projHeme$SampleName output_directory=getOutputDirectory(projHeme) addArchRThreads(threads = 8) options(future.globals.maxSize= 1000*1024^3) projHeme <- addGroupCoverages(ArchRProj = projHeme, groupBy = "group",force = TRUE) saveRDS(projHeme,file=past...
8f468497b925b66534e2e53d1d1e899644834eaaaece290da11b32e559fee60d
R
3,619
138
#build a formula form = function(y,x){ return(as.formula(paste0(y,'~',x))) } #get effects from linear models on biomarkers get_effs = function(mod){ m = summary(mod) res = data.frame(q=coef(mod)['(Intercept)'],k=coef(mod)[2],s=NA,r=NA) if('glm' %in% attr(mod,'class')){ #sd of residuals is the RMSE res$...
ef24d47407c984b26a6a423518446e6fa85632db1f442f948bf7d6a83b84ed9b
R
3,624
107
#' Item difficulty distribution #' #' Visualizes the distribution of item difficulty (b) parameters from a fitted #' mirt model. For dichotomous models (1PL, 2PL, 3PL), a single difficulty #' parameter per item is plotted. For graded response models (GRM), all #' threshold parameters are shown as separate colored point...
398e09e19445b5c5f18ed81e1e43509834cc4775c2ef49179661e05573ac2a35
R
3,643
115
.isMatrixBackedOrStop <- function(object, FUN) { if (!.isMatrixBacked(object)) { stop("'", FUN, "()' only supports matrix-backed minfi objects.", call. = FALSE ) } } .isMatrixBacked <- function(object) { stopifnot(is(object, "SummarizedExperiment")) all(vapply(assays(object)...
4d5170403ff96c5b1ad008bd45983cefe7b2219be06e54aa25bb10b29c3c7734
R
3,646
127
#builds a formula surv_form = function(x){ return(as.formula(paste0("Surv(time,status)~", x))) } #' Projecting Phenotypic Age algorithm onto new data. #' #' @title phenoage_calc #' @description Project Phenotypic Age algorithm onto new data. #' @param data A projection dataset. #' @param biomarkers A character ve...
66a2ce33a3a7a17faab7b1450e894bf31c579bb1839b44882359076c48650b28
R
3,671
92
#' Foo #' #' @param x foo #' #' @return fooo #' @noRd #' my.foo=function(x){ cat("\n\nIMPORTANT NOTE!!!\nYou have run this analysis witht the option less=TRUE. This means that the analysis will try to reduce the number of modules detected, based on their expression pattern. If modules have very similar expression pro...
810ea0b20e293001c2bd9ad5733bec6c6d21a2bc749960816a9019ab11c87e06
R
3,693
90
#install.packages("reshape2") #install.packages("ggpubr") #install.packages("corrplot") #ÒýÓðü library(reshape2) library(ggpubr) library(corrplot) inputFile="CIBERSORT-Results.txt" #ÃâÒßϸ°û½þÈóµÄ½á¹ûÎļþ setwd("C:\\Users\\wx197\\Desktop\\×ÔÑ§Íø113»úÆ÷ѧϰ\\205.geoML×ÊÁÏ\\205.geoML×ÊÁÏ\\25.barplot") ...
58416a755efb8522938154bd21172e235838dffecbb50aecd0896cb2d482c3b5
R
3,720
102
#' Build a graph from an input adjacency matrix #' #' Construct a kNN-graph from an input adjacency matrix - either binary or distances between NNs. #' @param x An n X n \code{matrix} of single-cells, where values represent edges between cells; 0 values #' are taken to mean no edge between cells. If the matrix is not b...
595517c745e4a4c5f11dc02ee391f2d55e45e30d9a8d0d6e5f4e933c077c0626
R
3,728
82
#WholeBrain Analysis Pipeline - Coronal Sections # #Semi-Automated Pipeline for the Segmentation and Registration of Brain-Wide Labels # #Requires WholeBrain software package (http://www.wholebrainsoftware.org/cms/install/) #Ilastik segmentation and further image preprocessing in ImageJ are recommended # # #Removed nec...
912a5907b081fdc9d48e68d57a32beadbd2702b61589a2ff64d7840f1cfdea07
R
3,745
102
#' Count cells in neighbourhoods #' #' This function quantifies the number of cells in each neighbourhood according #' to an input experimental design. This forms the basis for the differential #' neighbourhood abundance testing. #' @param x A \code{\linkS4class{Milo}} object with non-empty \code{graph} and #' \code{nh...
9df926d4178bd8fec5a419d8a50a6f69e5d2527e41fb8413369da2e9d386265d
R
3,791
83
#WholeBrain Analysis Pipeline - Coronal Sections # #Semi-Automated Pipeline for the Segmentation and Registration of Brain-Wide Labels # #Requires WholeBrain software package (http://www.wholebrainsoftware.org/cms/install/) #Ilastik segmentation and further image preprocessing in ImageJ are recommended # #Pipeline modi...
512e38dbefcfe77f9e96c7071e2311919c8190e852ac2dd63575b48630479d88
R
3,794
102
##' Scaling and centering a matrix. ##' ##' Does basically the same as \code{\link{scale}} but adds some ##' alternative scaling options and functionality for treating ##' pre-processing as part of a model. ##' @title Pre-process a matrix for PCA ##' @param object Numerical matrix (or an object coercible to such) ##' w...
2591a7288b05efccdbfe36d49d5de0ca4a7192900fac8400107c6d59f21f14e5
R
3,798
118
library(here) library(ggplot2) library(dplyr) library(nlme) library(cowplot) library(tidyr) ## Environment -- here::i_am("Rscripts/Figure_3_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}})) + geo...
9dead5a7e781b908c8084308f91c1f5d5553ce603c73443f6415f7f8fd16c0e8
R
3,835
111
#' Plotting conditional reliability #' #' This function takes a fitted mirt-model and visualizes a conditional reliability curve. Heavily inspired by code from Phil Chalmers (author or 'mirt') #' #' #' @param model an object of class `SingleGroupClass` returned by the function `mirt()`. #' @param theta_range range t...
2ff75f9cc52741c97bd965ef59586a823219be0aed38cc1ce7de6fd1f4509bab
R
3,836
102
# doAll.r OVERRIDE.OVERRIDE = T options(warn=-1) rm(FREQ.OVERRIDE,MEMORY.OVERRIDE,SACSPLIT.OVERRIDE,SPLITCODE.OVERRIDE, SACONLY.OVERRIDE, CC_INACT.OVERRIDE, ALIGN.OVERRIDE,NEAR.OVERRIDE,AREA.OVERRIDE,MONK.OVERRIDE,CLASS.OVERRIDE) options(warn=0) FREQ.OVERRIDE = "4:240:2" # ["4:240:2"] Overwritten for match...
c780aa4f865f3d1a7560ec8c9cd6008a9f7a946862a32c93a7ab34f3cbbeaf6b
R
3,842
101
# load cleanActivityAndSleep data in data.frame setwd("C:/Users/Masterthesis_Mayla/Step2_cleaning_ActivityandSleep/Result") # install.packages("jsonlite") library(jsonlite) # path to csv directory pfad <- "C:/Users/Masterthesis_Mayla/Step2_cleaning_ActivityandSleep/Result" # list .csv data paths <- list.files(path ...
a588aa57ebe8a921a773cb443a3ea685aac2641af0744d9c1980a842929c47bb
R
3,850
104
# setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/") ### Modified from the original to account for missing pedigrees in the ### genotype data. setwd("/homes/amkusmec/kernels_in_GP") library(tidyverse) library(RSpectra) library(tensorEVD) library(argparse) ### Process command-line arguments -----------------------...
cd5875628d84c0e536cc09c0d2333029c4fe330d818af985cb6a5ebc7cc34240
R
3,867
94
#' 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. #' ...
12c2048ce2326196153da30af18308cffc521f46af2b40fa3483fa7c42c5dc24
R
3,885
85
### Annotate neighbourhood results ### #' Add annotations from colData to DA testing results #' #' This function assigns a categorical label to neighbourhoods in the differential abundance results #' data.frame (output of \code{testNhoods}), based on the most frequent label among cells in each #' neighbourhood. This c...
71ae7c1f0f5dcd12c692f8c27117b9e7d775cb10fd7de8c9ca4e533c80a39278
R
3,892
105
library(ggplot2) library(here) library(tidyr) library(cowplot) here::i_am("src/Figure_S2_Schizophrenia.R") data<-read.csv("data/Q22/Startle_PPI_Analysis - Analysis.csv", header=TRUE) data$SLC_Genotype<-data$SLC data$SLC_Genotype <- factor(data$SLC_Genotype, levels=c("WT", "HET", "MUT")) data$Q22 <- factor(data$Q22, l...
7fe4444dc8c77dabcc3cd4faf25bd2bb76b8a8f417a5003c517089f71869cd80
R
3,893
117
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...
a2364acce1c419498bd731f58e4138b3e31bb6c89b4a37fc062577f71b0fc023
R
3,900
123
library(ggplot2) library(rlang) library(cowplot) library(ggpubr) library(viridis) library(tidyr) library(dplyr) library(tidyverse) setwd("~/Documents/slcspontaneous/Analysis_Files/") data<-read.csv("SLC_Spontaneous_Open_Field_Analysis.csv", header=TRUE) generate_boxplots <- function(input_data, X, Y, min,max){ da...
79f49fd4b46034ef16a6f70f5baa7051ca9d88ed5f0cecbb1e756bb2d225244d
R
3,903
109
#if (!requireNamespace("BiocManager", quietly = TRUE)) # install.packages("BiocManager") #BiocManager::install("limma") install.packages("pheatmap") #install.packages("ggplot2") #???ð? library(limma) library(dplyr) library(pheatmap) library(ggplot2) logFCfilter=0.585 #logFC?Ĺ???????(logF...
aa5e2102cf7b674d17debbc6eca20c59cfd82483f1b538ace92ac012b605d956
R
3,908
85
library(Seurat) library(dplyr) library(data.table) data_dir <- './data/' gene_info <- fread('./1k1k_gene_GRCh37.txt') # read cov for(ct in c('CD4effCM','Bmem','CD4TGFbStim','CD8all','CD8eff','CD8unknown','DC','MonoNC','NKact','MonoC','CD4all','BimmNaive', 'NKmat','Plasma')){ obj <- readRDS(sprintf('%s/...
e201532ad94eff16b6660827ef19c55b50fb584f8528e3bb49c256ed049a327e
R
3,918
63
# library(venn) library(data.table) library(dplyr) # library(ggVennDiagram) source('/home/panwei/lin00374/TWAS_helper.R') wgtdir = '~/UKB_TWAS/WEIGHTS/' resdir = '~/UKB_TWAS/result1/' gwas_list = c('30000_irnt','30010_irnt','30020_irnt','30030_irnt','30040_irnt','30050_irnt','30060_irnt','30070_irnt','30080_irnt','300...
de9e45c68c68d5ee32df6055f4973b8562df8fb75a30f295efdfbad70e4a5286
R
3,948
74
library(dplyr) library(Seurat) library(ggplot2) ## Style plots # Barplot function theme_ggplot = theme(legend.position = "none", plot.title = element_text(hjust=0.5, face="bold"), panel.border = element_blank(), plot.background = element_blank(), ...
d38b228b8c09c2e5164f4d0d69429d360a24f4549dd2036b2818dbccf163cd97
R
3,956
143
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_...
ad0f34b104ec31c06649f7c657dec9228233bc84eba4fd297afd29ea144b5fa4
R
3,961
143
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_...
106dc7347bb728a4abebebdd3c258ce2414bf49aaef97d6fcef1ec88fba9ca61
R
3,962
136
# ============================================================= # AGEING BIOMARKER CORRELATIONS # ============================================================= # COHORT: Lothian Birth Cohort 1936 (LBC1936) Wave 2 # MODEL: Pearson's correlations # ============================================================= # ----...
9debb0e047ad6c784ebb24fe17d46917da999c690c4d51e14e0f9d3877a13d2c
R
4,000
152
library(sjPlot) library(broom.mixed) # for tidy() library(dplyr) library(emmeans) library(lme4) library(lmerTest) library(ggplot2) library(moments) library(ggeffects) library(patchwork) library(forcats) library(scales) df <- read.csv("E:\\work\\q_backup_06_03_2025\\projects\\isttc\\results\\mice\\dataset\\tau_un...
3af9a1c3596cfb4e1acbdc65e7ef8a7fd36978fba09a0498698a78568955fb4b
R
4,002
107
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(280L, 19L)) # inputs <- layer_input(shape = c(280L...
493f4ff6c499988ebf7ebb9bf765bcb6081047173a26f47e23cbd4b522d56849
R
4,017
104
#if (!requireNamespace("BiocManager", quietly = TRUE)) # install.packages("BiocManager") #BiocManager::install("limma") #install.packages("dplyr") #install.packages("ggplot2") #install.packages("tidyverse") #install.packages("devtools") devtools::install_github("Hy4m/linkET", force = TRUE) #ÒýÓðü l...
125718607003d24b0296ee864207d67cc8e4d50dbb0d06fa054c0e35cda13104
R
4,028
99
# library(msEmpiRe) # library(MSnbase) # # # load ExpressionSet we prepared earlier; LFQbench dataset processed by Spectronaut. we selected only peptides with good q-value and applied vsn normalization # load("C:/temp/ExpressionSet_contrast A vs B.RData") # # # we stored our intensity data on log2 scale, transform back...
4125e201206a85795d1734b89aeee59579ad79edd599804a158bb6e703933721
R
4,030
84
#### public gist @ https://gist.github.com/ftwkoopmans/7c4413811f08162ab35814b8259b09db # code snippet to demonstrate MS-EmpiRe reproducibility issues & resolve by setting set.seed() # msEmpiRe package build used for this testcase: https://github.com/zimmerlab/MS-EmpiRe/tree/ae985a92dada3ea6bce9ee88e6eb674ffe975f41 #...
5193e8669c913c7a381eaafb310e6a7f0368e0883d1ee81be6f5d17216d0ed1c
R
4,035
115
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(21...
37a5b1e41c3e1818daa1a27fb98410d32680728ea8cd2efe7093980abbf3dd88
R
4,039
115
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...
0727f6f983fb33747650b1b60436ac867caedab8bd3652db1638c4f26d58eed9
R
4,048
107
##' Simulated data set looking like a helix ##' ##' ##' A matrix containing 1000 observations (rows) and three variables ##' (columns). ##' @title A helix structured toy data set ##' @name helix ##' @aliases helix ##' @usage data(helix) ##' @docType data ##' @references Matthias Scholz, Fatma Kaplan, Charles L. Guy, ...
341449ee2480dce8e7b1c456f376fabfa28c9de9fade75e0a52907f31cd4eaed
R
4,049
100
#04_PRS_association.R rm(list=ls()) #1.data preparations---- PRS=read.table('./01_taxa/all/Topic/v6.all.score',header = T) datas=merge(PRS,meta,by=c('FID','IID'),sort = F) datas=datas%>%mutate( C1.sd = C1/sd(C1, na.rm = T), C2.sd = C2/sd(C2, na.rm = T), C3.sd = C3/sd(C3, na.rm = T), C4.sd = C4/sd(C4, na.rm = ...
6bc145d347b8f3f81b5815189dc99c18edb46a38265a87ea4b9cde1077667dd5
R
4,049
96
#' Perform simulations to test deconvolution model with constructed bulk #' tissue profiles. #' #' Function to implement the Houseman deconvolution method for a provided #' set reference data and apply it to a series of bulk profiles #' constructed from user-provided proportions. The function first selects #' the sit...
89830ace5c9af2ad2668dda549e84c939b131e7a4312a590607ed926a7a619c3
R
4,049
122
#' Log function that takes any string, appends it to global log (log_ , a list) and prints to console #' #' @param x your message as a character string #' @param type the type of message. options: info, progress, warning, error. For the latter, an R error is thrown after logging! #' #' @importFrom crayon red cyan blue ...
4ad1d32e6bd8cb4c0e0afe400c6f121f1b877a6407e83200a35b2648c29d4ba5
R
4,066
81
#Brain Analysis Pipeline - Coronal Sections # #Semi-Automated Pipeline for the Segmentation and Registration of Brain-Wide Labels # #Requires WholeBrain software package (http://www.wholebrainsoftware.org/cms/install/) #Ilastik segmentation and further image preprocessing in ImageJ are recommended # #Read through comme...
d03bc824c3729bf86d30515d14306c409f28090c9ab3b0c9b47b4d477434ecbd
R
4,068
128
# lineplot.r LINES = T # Solid line to show mean RIBBONS = T # Ribbon of +/- 1 SEM (can have both) # Plots = list(24:32, 38:42, 90:110) # Name ALL frequencies; it'll handle it Plots = list(24:36, 70:120) PRINT_FIGURE_DATA = T if (CC_INACT) stop("Not written\n") # Pull out just the recorded frequencies # Plot...
00e0d29a8e75a4005b646a598741a99822bd06775a8c1bd696f3817fa34cf828
R
4,076
151
library(sjPlot) library(broom.mixed) # for tidy() library(dplyr) library(emmeans) library(lme4) library(lmerTest) library(ggplot2) library(moments) library(ggeffects) library(patchwork) library(forcats) library(scales) df <- read.csv("E:\\work\\q_backup_06_03_2025\\projects\\isttc\\results\\mice\\dataset\\tau_un...
bed7d7864995c371d24f1a738f6c5ba2cbf98c33ccae99620a2318fb0f772a4a
R
4,086
81
#Brain Analysis Pipeline - Coronal Sections # #Semi-Automated Pipeline for the Segmentation and Registration of Brain-Wide Labels # #Requires WholeBrain software package (http://www.wholebrainsoftware.org/cms/install/) #Ilastik segmentation and further image preprocessing in ImageJ are recommended # #Read through comme...
78a67b3b1e0ab73c8da8eb39111c069a992db1a23efaa03e4fbae979928aea51
R
4,095
103
nn.cre <- lapply(nn,\(x){read.table(paste0(path,x),sep='\t')}) nn.cre <- do.call(rbind,nn.cre) nn.cre$name <- paste(nn.cre$V1,nn.cre$V2,nn.cre$V3,sep='_') nn.cre <- nn.cre[!duplicated(nn.cre$name),] gaba.cre <- lapply(gaba,\(x){read.table(paste0(path,x),sep='\t')}) gaba.cre <- do.call(rbind,gaba.cre) gaba.cre$n...
507c0a388446efa3160eff1c5e1cb4d05460163faaf4e6056eb024891a1f3399
R
4,098
118
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) ...
a00eddf42af686f131a4d018d5eb120f4f0d9d9f320de6c471c1137bfbeec073
R
4,100
161
#!/usr/bin/Rscript # check if necessary packages are installed pkg.list <- installed.packages()[,"Package"] if (!("argparse") %in% pkg.list) { install.packages("argparse") } if (!("deconvSeq" %in% pkg.list)) { if (!("devtools") %in% pkg.list) { install.packages("devtools") } devtools::instal...
d8dbf9e8ce2eb1321dc3426858394e28796150763618de282620c405d9eacb02
R
4,111
95
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 <...
deb50676d55e75cf2274fe94940f122cb4a9a09d0d447abb3ab89dbf3f1dbd4a
R
4,115
116
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...
d92aabf7af0116a1d2ba44b3d264416bdc70f13b73f4e20a3be4d23d62b84286
R
4,121
116
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...
a51d8a74ba053c8a0e6ce6fe723ef5b52b96f267c6cbdca045fb39ddce9a9074
R
4,126
116
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...
592d92469d2ea25205eb224b42622f501d60f401ba7a5cc9b25f68added043ae
R
4,132
116
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...
535006f12adec394988c5dd7d8f8ec279bb391b60db218d5034f937ecfce9e53
R
4,139
87
#' Filtering modules internally #' #' @param dynamicColors the dynamic colors #' @param s.Wdata the single-cell Seurat object #' @param datExpr the expression data used to calculate #' @param geneTree the gene tree from the iteration we are filtering #' @param my.power the power used to construct the trees #' @importF...
690b6a860a0d99d67c594a13bd2e10c7c9dad091fa5a7432b31fb17dc3024821
R
4,144
119
# Load packages ----------------------------------- rm(list = ls()) library(dplyr) library(Seurat) library(ggplot2) library(patchwork) library(readxl) library(data.table) library(ComplexHeatmap) library(circlize) library(qs) library(writexl) # Organize environment ----------------------------------- base_dir <- "/Us...
0431363244dab1fd086264ddb9d2f166750f1857675689a300e8ca5aa15e0e35
R
4,156
120
setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/") library(tidyverse) library(keras3) library(kerastuneR) # source("src/soil_tuner_classes.R") HyperModel <- PyClass( "HyperModel", inherit = HyperModel_class(), list( build = function(self, hp) { clear_session(free_memory = TRUE) model <- keras...
fb8cd9606f7a2226b90547c97b2008504ebb043e60428d154ea1a8a491c1e652
R
4,177
71
#' This function trains, fits and evaluates n deep neural network (DNN) models, and select the best one according to the selected metric #' #' This function creates n DNN model from the reference dataset (scRNA-seq) by using the keras package, #' and selects the best model based on the user selected metric. #' @param n...
e9b0f0c6c99f9aa0eca3e60619993b7ba4c290e699514d0bd1ab0f3a6c593e16
R
4,181
103
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...
3da3b86b3242d327e2a9fd5952c14e5d2086273a07cdaf9bf1dc00cd68a4b529
R
4,193
141
#!/usr/bin/env Rscript library('optparse') library('MicrobiomeStat') library('phyloseq') library('tidyverse') # arguments # @dir_job, this is where job will be run, should include inputs and outputs folders # @job_prefix, this is the string prefix for file inputs # @job_suffix, this explains the type of form...
2e84907440f36c91bf995cf6af95e1f2833cd926fdcacea85a9924f685c05515
R
4,223
125
library(here) library(tidyverse) library(cowplot) library(ggplot2) ### Establish location --- here::i_am("src/ASO/ASO_Correlate_DAT_with_Rotarod.R") ### Read in input files --- ASO_rotarod <- read.csv(here("data/ASO/ASO Rotarod - Rotarod.csv")) ASO_rotarod <- ASO_rotarod %>% filter(Day=="One") %>% filter(ASO_Tg==...
4e57f3f28015bc7096f13fce413e05315372eee84d711fc67830f86ca0aa7b3b
R
4,235
101
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 <...