sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
17k
content
stringlengths
1
200k
75b2b5253b4f2ac1d33f4b17abdd041effbc2d24ccab25b332242ae1f545d428
R
5,551
120
context("Testing calcNhoodExpression 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 valu...
b7c73fa5d2da4e8fab7d2e8de2343b31590148f7c0ecb93b812f9606555afb74
R
5,597
197
# some functions || encode_1mer <- function(seq, map){ features <- c() n <- nchar(seq) seq <- toupper(seq) for (i in 1:n) features <- c(features, map[substr(seq, i, i),]) return(features) } complDNA <- function(seq){ tbl <- list() tbl[["a"]] <- "t" tbl[["c"]] <- "g" tbl[["g"]] <- "c" ...
1aec75a9173d04ec93297856f08117ae44559f08c054adefaee5e0db535af6a5
R
5,600
161
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...
e7c566db1d0fcb0cc1e5311dfc9ecafec40e0b0cd1ef83455ebb49992ca7a6d2
R
5,607
162
library(ggplot2) library(dplyr) library(cowplot) library(nlme) library(tidyr) data <- read.csv("Analysis_Files/Spontaneous/SLC Spontaneous Gastrointestinal Motility - Analysis_Wide.csv",header=TRUE) data_long <- pivot_longer(data, cols = starts_with("X"), names_to...
469f7688ee8e25b1befb5ead1d1696fec310f674877cc23e87d114f546ab6d75
R
5,630
106
# Step 1: Split Visium histology whole slide image into individual capture area images The Visium histology whole slide image from the imaging system (slide scanner) is a multiplane tif image (~20GB). The sample image [Lieber_Institute_OTS-20-7690_rush_anterior.tif](https://visium-libd.s3.amazonaws.com/Lieber_Institut...
39875e79eecd41df1cc116d10cdf33c43ffacf306e06447918bfb6fc59e53468
R
5,649
121
context("Testing fitGLMM function") ### Set up a mock data set using simulated data suppressWarnings({ library(miloR) library(SingleCellExperiment) library(scran) library(scater) library(irlba) }) ##### ------- Simulate data ------- ##### data(sim_family) sim.df <- sim_family$DF set.seed(42) rando...
6c4ac99fbf619334856a27d4fb55c991ea984e727a37fdc4b19540de11fbe343
R
5,676
169
--- title: "Hemisphere x Age Bin Interactions" output: html_notebook --- Version 1.0, July 2025, SA This script plots hippocampal connectivity with neocortical clusters identified by a significant hemisphere x age-bin interaction. Input: Hippo_BinxHem_F_betas.txt Output: Plots in Fig S4C # Packages and functions ...
32ffff19a7d2b82fb2a151f575fb1600a8d604fc64ddbf53959192de02acb2fb
R
5,686
193
# merge peak ------------------------------------------------------------------------- source('/cluster/home/chencheng/Mac_gaba/prepare.R') library(future.apply) library(argparse) parser <- ArgumentParser(description='merge peaks to union peakSet') parser$add_argument('-I', '--input', help='cluster peak information') a...
d8a4e45411fabfc754739feda9bdc853987002a88c9cab6e538c3ed4b82b22b2
R
5,712
174
setClassUnion("matrixOrNULL", c("matrix", "NULL")) setClassUnion("arrayOrNULL", c("array", "NULL")) setClassUnion("numericOrNULL", c("numeric", "NULL")) setClassUnion("data.frameOrNULL", c("data.frame", "NULL")) #' @title Epoch Class #' @description S4 class to handle epoch data with electrodes and time points #' @slo...
56f6b1a5eb1e23b66f6f47a4941b919c2579738388226ccfae0bb72fd5ccbcbf
R
5,731
121
## List of all drugs and their short names DRUG_LIST = c("Amikacin", "Bedaquiline", "Capreomycin", "Delamanid", "Ethambutol", "Ethionamide", "Isoniazid", "Kanamycin", "Levofloxacin", "Linezolid", "Moxifloxacin", "Pyrazinamide", "Rifampicin", "Streptomycin", "Clofazimine", "Pretomanid") SHORT_NAMES =...
7ed5e8a2d9c7d225822d1c84bd850270d619f5daed4256c67e925e9ed8bcbff7
R
5,734
146
#if (!requireNamespace("BiocManager", quietly = TRUE)) # install.packages("BiocManager") #BiocManager::install("limma") #install.packages("reshape2") #install.packages("ggpubr") #install.packages("ggExtra") #ÒýÓðü library(limma) library(reshape2) library(ggpubr) library(ggExtra) gene="KLHL21" ...
059392cff24c205ba528f49a9ae2d406a977becf23bb0bec3d4e4a2ba03d29f5
R
5,738
129
context("Testing annotateNhoods function") ### Set up a mock data set using simulated data suppressWarnings({ library(miloR) library(SingleCellExperiment) library(scran) library(scater) library(irlba) library(MASS) library(mvtnorm) }) set.seed(42) r.n <- 1000 n.dim <- 50 block1.cells <- 50...
2e2daacab041813df616c952440b09ebfeeb90205ef3bc96dcc2893fc7a30a1d
R
5,744
274
# ---- libs ---- library("dplyr") library("tidyr") library("tictoc") library("foreach") library("EmpiricalCalibration") library("Sequential") library("arrow") library("ggplot2") # ---- consts ---- min_event <- 1 alpha <- 0.05 cv_df_0 <- expand_grid( cntl_to_case_ratio = seq(0.5, 5, by = 0.5), max_n = ...
526c22e6b99618da202ffc9dace593ace1091150f6563e07b8cb9f959fffc1b5
R
5,773
167
library(ggplot2) library(dplyr) library(cowplot) library(nlme) library(tidyr) data <- read.csv("Analysis_Files/PFF/PFF Gastrointestinal Motility - FP_output.csv",header=TRUE) data_long <- pivot_longer(data, cols = starts_with("X"), names_to = "timepoint", ...
e760cb178cc5c02b3efe3b2df1ada2ae19fc106c1e27ddf35eb5ce76827acfbb
R
5,783
154
#' 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...
0e1d9ed7220f8e5ba1b76d5dcde0fe48a6dadd177279c7703872478a08f6eb44
R
5,788
157
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) %>% mutate(yNA = if_else(Set == "...
6071f61343d9176bfa7f2d6c535b69e501ad1b6423f1ad95e92fb3c788f31f0e
R
5,796
195
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...
4ccee37001ae3f9e8587a45bf54e113840d24d2e09480dcbd36d6af16ee6cfb3
R
5,832
238
library("readr") library("stringr") # raw data rawd <- read_csv( ### previously # "https://raw.githubusercontent.com/curtis-murray/MedicalDevicesNLP/master/data/all_reports/all_reports_df.csv" ### now saved locally for snapshot "dat/all_reports_df.csv" ) # rawd <- vroom::vroom("dat/all_reports_df...
3f65a782866e6564cfcbc341fb84ab3058288282e8ac612ace67fef92e5faefd
R
5,853
108
# ------------- Figure S1 -------------- # -------- Path settings -------- project_dir <- "./NSCLC-DMSPsig" data_dir <- file.path(project_dir, "data") results_dir <- file.path(project_dir, "results") figure1_dir <- file.path(results_dir, "Figure1") figure2_dir <- file.path(results_dir, "Figure2") dir.create(figu...
75385b0e12ae1ad25cebd5761c0617ea8aff837df7c85350d1e7d410b6efeee6
R
5,860
104
--- output: rmarkdown::github_document: html_preview: true toc: false --- ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, fig.path = "images/dea-", comment = "#>" ) ``` ```{r setup, include = FALSE} devtools::load_all() ``` # Differential Expression Analysis In this vignette we wil...
15c79e9e534ee0626a01efd8fd29348d3702297eeb909abd16a132507445e269
R
5,861
160
--- title: "tSNR analyses" output: html_notebook --- Version 1.0, July 2025, SA This script plots mean and standard deviation of connectivity across the age bins examined. Input: Mean_and_SD_cortical_conn_Schaefer2018_200Parcels.csv Output: Figs S12 and S13 # Read in packages ```{r} library(ggplot2) library(dpl...
fbf14174e91598a3fe5abb96343822a36d1959bbf1c73fa6eae0d93345dba7f9
R
5,886
223
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...
cc5443823539ef67476a7e9a23b340ca5753d9cfe6eccc6305e5a50af2898bab
R
5,903
175
# Spec[tagram].r # Smooth with blur() from library(spatstat) !! SHOW_PALETTE = T BANDS.USE = 16:100 # 16:100 (10:48) BANDS.OUT = 54:66 # 54:66 (52:68 or more for small windows) # stop band if (CC_INACT) stop("Not written!\n") # FROM http://sebastianraschka.com/Articles/heatmaps_in_r.html if (!require("RColorBre...
e5b6e00c121cb8bea2300ee969f47669c14e6986a3b0485a1d10d3862fafdb9a
R
5,913
181
--- title: "MNI Space CSV" output: html_document date: "2023-11-07" --- ```{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 = 5, # set default width of figures fig.height = ...
90f22033b1656688d422f2feae8482fcbe51db07bded73589fcfe52c5bccbe32
R
5,915
176
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) X <- read_csv("../../genomes2fields_curated/data/data_g2f/GENO.csv", show_col_types = FALSE) x_taxa ...
b2818a5dbf67744933f5de0befa0c54f4eb09a942f0cd5ef5aef673e7e9195b0
R
5,927
149
#By Library lst=readRDS("/cluster/home/mengjuan/project/snATAC_snRNA/5.WB_mafas5/5.merge2macaque/snATAC.AnnoColor.V1105.rds") MonkeyCols=lst$MonkeyCols region_L0_cols=lst$region_L0_cols outdir=getOutputDirectory(proj) outdir samples=proj$Sample %>% unique FragmentSizes=list() TSSEnrichment=list() FeaturePlot=l...
62155b0d464d5d61e26ebacfe9d24742494bd010604cd5169cc6d042135e57b9
R
5,936
203
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...
98c6bbfff91a458ce9700eff2a7808b79af4d75bd92d0b9d5de18ea91381f8c9
R
5,937
206
library(tidyr) library(dplyr) library(ggplot2) df<- read.table("radj_ados.txt", header = TRUE, sep = "\t" ) # 假设数据框名为df,包含variable、mri、ec等列 df_long <- df %>% pivot_longer( cols = c(mri, ec, pathway, taxon, met), # 选择需要可视化的指标列 names_to = "metric", values_to = "value" ) p<...
7a9867c4db62da0283894f367bf7b6aa79d0551cb906d0f1ca90dd91b42bd91b
R
6,006
101
library(sceasy) library(reticulate) library(SingleCellExperiment) library(org.Hs.eg.db) library(org.Mm.eg.db) library(scater) setwd("/scr1/users/manchela/Data") #change to ENSEMBL ID for cellxgene # convert rds to h5ad for human objects seu <- readRDS("human_face_no-neuro_clustering_cellrangerARC-raw_emptyDrops_sing...
b4eb156500804f945ba172535192de69e7884a91d20a0535851ac57fc073f078
R
6,008
147
setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/") library(tidyverse) library(RSpectra) library(tensorEVD) source("src/bigLK.R") # Needed for the soil kernel ### BGLR uses an internal tolerance of 1e-10 (see setLT.RKHS in BGLR.R) ### For our purposes, we keep any eigenvalue > 0 for completeness. ### The reference...
b778e430de810b6a2774639bb3ba00213b82b12a4fb54acb9620d4310bd29976
R
6,028
130
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("GSW", "ASW")) |> dplyr::select(-Data) |> mutate(Model = if_else(Model == "DNN-CO", "ReLU", Model)) res2 <- list.files("10.in...
65c01ce8e2d3893dfaf4a58f482f020ffacdd75b951a9f4293b96f7cabc71026
R
6,063
162
# doIndiPower.r ########################################################################### # Set basic parameters # ######################## MONK = "zen" # zen, tyr, both (don't use both: R calls will merge monks) AREA = "LIP" PRINT = F # Print the calls? PRINT.BRIEF = T # Just the names of the cells EXECUTE = T ...
bd3133a638b572c5d941be073fe217cb9164261940066036e0e200493dbfe373
R
6,063
216
#' CIBERSORT R script v1.03 #' Note: Signature matrix construction is not currently available; use java version for full functionality. #' Author: Aaron M. Newman, Stanford University (amnewman@stanford.edu) #' Requirements: #' R v3.0 or later. (dependencies below might not work properly with earlier versions...
3a86f25a25126c656c96daac49fd88ddedcce34bed8d907582986350d706de0f
R
6,090
125
library(Maaslin2) library(funrar) library(plyr) library(dplyr) library(ggplot2) library(cowplot) library(readr) #### JEJUNUM #### setwd("/Users/rochellelai/Documents/JacobsGit/slcproject/PFF_Microbiome/differential_taxa/Jejunum/") ### Run Maaslin2 and get table of relative abundances input_data <- read.csv("export_s...
de4c7bd65659dba6dec24a882de47e9d5f75f873cb2867cb79e1d9902498213c
R
6,099
139
context("Testing class instantiation and methods") 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 v...
e9dc8829e17fbec84c452d17d67a9023f34a34ad7e20479d2c6748d3f5f991ff
R
6,112
148
##################################### # Estimate metacognitive efficiency (Mratio) at the group level # # Adaptation in R of matlab function 'fit_meta_d_mcmc_groupCorr.m' # by Steve Fleming # for more details see Fleming (2017). HMeta-d: hierarchical Bayesian # estimation of metacognitive efficiency from confidence ...
113d10268ca19e66699c30644eb5beb54b883b21fa3b362e866c7bcbe8d50812
R
6,129
180
# doConcat.r FROM.TIME = 800 # [ 650] [-300 100 800 -100 100] END.TIME = 1050 # [1150] [ -50 350 1050 -100 100] [go:maxi 160] # NOTE: intervals are centered on these times ALIGN.OVERRIDE = "" NEAR.OVERRIDE = 2 AREA.OVERRIDE = "LIP" MONK.OVERRIDE = "both" CLASS.OVERRIDE = "all8" INACT_INTERVAL.OVERRIDE = ...
50e4dc032d0a1a51cde53ebbc81d68291d8e16c93c5bc9c3f0ee30eea2eb6c75
R
6,131
226
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\\is...
b4aaa54a1e766d5a76622814bdfd555d299719759fe119eaacf3a5efdf144963
R
6,147
125
context("Test function countCells") 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 for the c...
33aa1dff298a86a3d004e6b1f15b7178fa2e6ac405f351f641ac78201b4e340c
R
6,167
145
#' Calculates pseudocells from a Seurat object #' #' This function calculates pseudocells from a Seurat object, based on pre-calculated cell clusters and dimentionality reduction. WARNING: This might be time consuming, depending on the size of the dataset. #' @param s.cells The seurat object, with pre-computed PCA or ...
f66d544fa68c8daf5044d942607766033fe7598a739b1c1fc6f27f88efe3ff2b
R
6,179
201
--- title: "Hierarchical Clustering" output: html_notebook --- Version 1.0, July 2025, SA This script clusters the clusters resulting from a long-axis x age bin interaction into superclusters that share similar profiles of connectivity with the anteroposterior hippocampus (as visualized in Figure 4A) It also plots s...
95dc23096ca5aa12586ee1d451b19aaecb89e279f7ddac4592e7f76d31dbe4e4
R
6,190
165
--- output: github_document: html_preview: true toc: false --- ```{r, echo = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>", # fig.path = "man/figures/README-", message = FALSE ) ``` # Installing the MS-DAP R package This guide helps you install the MS-DAP R package and all of its s...
f64fdab5a1bec8dd7a046d5cc7eac02879a3395642655a221a9e04d5c4bde972
R
6,199
249
library(tidyverse) library(synExtra) library(qs) library(data.table) library(powerjoin) library(ggbeeswarm) synapser::synLogin() syn <- synDownloader("~/data", .cache = TRUE) rosmap_quants <- syn("syn43841162") %>% fread() msbb_quants <- syn("syn50920431") %>% fread() msbb_clinical <- syn("syn6101474") %>% re...
b0158aad8cab1829e60c9aab26112931706b30d5ddb4e70e82505d44147284e6
R
6,206
180
library(Seurat) library(SeuratObject) library(DESeq2) library(ggplot2) library(scales) library(qs) library(dplyr) library(zebrafishRNASeq) library("biomaRt") #'####################################################################### # Load method functions ---- #'#######################################################...
687b139af7251d95dead0b166e8713f5e455ee4362756d95eb3b27acd8a9b36b
R
6,229
165
library(ggplot2) library(vegan) library(dplyr) library(rlang) library(cowplot) library(viridis) ## Environment -- here::i_am("Rscripts/Figure_Correlate_PFF_Puncta.R") metadata <- read.csv("Analysis_Files/PFF/PFF_Microbiome/starting_files/PFF_Mapping.csv",header=TRUE) counts <- read.table("Analysis_Files/PFF/PFF_Micro...
a53dcb57a3849717f9b1cc4e4564f99d3acdad70338da0a3aa1a6141731a1739
R
6,239
192
#' @title #' The Milo constructor #' #' @description #' The Milo class extends the SingleCellExperiment class and is designed to #' work with neighbourhoods of cells. Therefore, it inherits from the #' \linkS4class{SingleCellExperiment} class and follows the same usage #' conventions. There is additional support for ce...
7da37c1028a2bb991a7b5ac86cab27eac08abe2dabdea8b72c1808f59b432512
R
6,244
176
# ============================================================= # ELASTIC NET-PENALISED COX PH MODEL FOR SOMASCAN 11K PLASMA PROTEINS # ============================================================= # COHORT: Lothian Birth Cohort 1936 (LBC1936) # ELASTIC-NET PENALISED COX MODEL: # Surv(time_to_death, dead) ~ protei...
4501d142ae02504db75479830ec49aff7c71383fdf4fd0e0a54238dff914d0ec
R
6,262
140
context("Testing checkSeparation function") ### Set up a mock data set using simulated data suppressWarnings({ library(miloR) library(SingleCellExperiment) library(scran) library(scater) library(irlba) library(MASS) library(mvtnorm) }) set.seed(42) r.n <- 1000 n.dim <- 50 block1.cells <- 5...
8c685498dcc6a3927bd9226e5c5f8aca1276e54315aef6721c1d5d5b5bbf728b
R
6,338
113
# set threat function threat_function <- distributions3::Beta(2, 5.5) create_distance_df_bci <- function(df, ghost = TRUE){ if(ghost){ distance_df <- df %>% filter(Trial != "ITI") %>% filter(TrialType <= 16) %>% # ghost trials only group_by(trial_numeric) %>% # user movement and dista...
654ff19c3b059b355af429f698356e3475d7e53c6ece81f849b2e3f8ae4607cd
R
6,348
237
```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) library(data.table) library(SCAVENGE) library(chromVAR) library(gchromVAR) library(BuenColors) library(SummarizedExperiment) library(data.table) library(dplyr) library(BiocParallel) library(BSgenome.Hsapiens.UCSC.hg38) library(igraph) ``` ```{r} set.see...
d547cdec906338d1a24602ad87a45dc1b0f93b7d1f9181a6218e3bcd72e75e3f
R
6,409
130
#05_mediation.R rm(list=ls()) library(mediation) library(dplyr) meta=read.csv('./01_taxa/all/state_table/00_meta_all.csv') Topic=read.table('./01_taxa/all/Topic/pheno.txt',header = T) datas=merge(meta,Topic,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)...
ad568801d7e31457ce4791bdc4ae8fc0f810b7e0fdaa62a87251576d7a720f78
R
6,424
168
# 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...
d52c8e94b5911483e6f8fb40b5d551cdb843c3503725ab142550f54e4e61ebd5
R
6,449
232
library(dplyr) library(tidyr) df<- read.table("taxon_beh_vf_sel.tsv", header = TRUE, sep = "\t" ) df_processed <- df %>% mutate(across(c(X1812935,X2052056,X2714945,X33887,X37919), ~ ifelse(is.na(.), "NA", "non-NA"))) %>% pivot_longer( cols = c(X1812935,X2052056,X2714945,X33887,X37919), names_to = "...
ffcc593a64d6965bf5e63eb837a765ec4f4ffc9697019ccfa9b1cd878eba70a4
R
6,490
178
# 1. °²×°²¢¼ÓÔØ±ØÒªµÄ°ü if (!require("sva")) install.packages("sva") if (!require("limma")) install.packages("limma") if (!require("kBET")) { if (!require("devtools")) install.packages("devtools") devtools::install_github("theislab/kBET") } if (!require("ggplot2")) install.packages("ggplot2") if (!require("...
04d3a6cbdd0249af63d328302f16fa7054c23341295c10f5b7e62360c7c66941
R
6,505
170
library(ggplot2) library(vegan) library(dplyr) library(rlang) library(cowplot) library(viridis) ## Environment -- here::i_am("Rscripts/Figure_Correlate_PFF_Puncta.R") metadata <- read.csv("Analysis_Files/PFF/PFF_Microbiome/starting_files/PFF_Mapping.csv",header=TRUE) counts <- read.table("Analysis_Files/PFF/PFF_Micro...
c328ef598825decb90b215b93298732082c260817140e024d2a95f50509f0529
R
6,534
200
library(here) library(tidyverse) library(cowplot) library(ggplot2) ### Establish location --- here::i_am("src/ASO/ASO_Correlate_DAT_with_GFAP.R") ### Read in input files --- ASO_lum_col_counts <- read.delim(here("data/ASO/Microbiome/differential_taxa/ASO_L6_Subset_Luminal_Colon.tsv")) %>% t() %>% as.data.frame()...
904f820e0a77085f735fe9f8bee4634fdf8e2bc23bac3e9076f4a9f00736c9ce
R
6,556
173
##' Implementation of probabilistic PCA (PPCA). PPCA allows to perform ##' PCA on incomplete data and may be used for missing value ##' estimation. This script was implemented after the Matlab version ##' provided by Jakob Verbeek ( see ##' \url{http://lear.inrialpes.fr/~verbeek/}) and the draft \emph{``EM ##' Algorit...
1fb555348f5b23c0bd188fe9c03d93977920fa99e999293e63b73987f89d9f6d
R
6,583
197
library(Seurat) library(SeuratObject) library(DESeq2) library(ggplot2) library(scales) library(qs) library(dplyr) library(zebrafishRNASeq) library("biomaRt") #'####################################################################### # Load method functions ---- #'#######################################################...
b501353e59e854937bd9cbd3c215b4a5fa81d8409c33e34a457aff2b2bebe644
R
6,592
289
```{r} library(tidyverse) library(synExtra) synapser::synLogin() syn <- synDownloader(normalizePath("~/data"), .cache = TRUE) ``` ```{r} dge_gmt <- map( c("syn20820056", "syn20820060"), ~syn(.x) %>% DRIAD::read_gmt() ) %>% enframe("experiment", "gene_sets") %>% mutate( gene_sets = map(gene_sets, ~enf...
e6e9e5f832d391b0bf1cf402d3a727120effac9e3846c31424347078064c6694
R
6,597
189
# Taken from the supplementary code file of # 'Characterizing noise structure in single-cell RNA-seq distinguishes genuine from technical allelic expression' # by Jong Kyoung Kim # published in Nature Communications # DOI: 10.1038/ncomms9687 # Estimate gamma and theta #' @importFrom stats lm coefficients nls.control #...
02215e38ec2fc62bd31c1684177529dcc29f6d4af621320004e2e08ed30f0e76
R
6,613
168
library(SeuratDisk) library(Seurat) library(tidyverse) library(dplyr) library(patchwork) #E15.5 spatial plots #loading mouse facial transcriptomics and E15 spatial data from Pina et al cds <- readRDS("face_mouse_final.rds") cds1 <- readRDS("data/combined_HQ.rds") cds2 <- subset(cds,cells = rownames(cds@meta.data[cds$s...
41ffc908a44add586d48c824fb1dd6a1a21683949564d9da0a377f01fd711787
R
6,659
180
library(rhdf5) # Load Python and R functions for basic Wilcoxon Tests, DESeq2, and CocoA-Diff # and causarray, cinemaot require(reticulate) use_condaenv('renv') path_base = '/home/jinandmaya/' setwd(paste0(path_base, 'methods')) source('R_functions.R') path_base = '/home/jinandmaya/simu_nb/' setwd(path_base) library(...
3c9bdd9164ca1354cacca802a1a84f54285940f7a8d3b4b814df9f714b0980f1
R
6,676
209
# set LFC ----------------------------------------------------------------- #' @importFrom methods is .setFC <- function(input, nDEgenes, k) { # two groups if(k==2) { if (is.vector(input)) { ## vector if (length(input) == 1) { ## constant lfc = rep(input, nDEgenes) } else if (length(input) ...
0d4ee780913a4b5c23ccd83731e8dcd2dd4b078d02026b5ecd54034255c5a658
R
6,696
165
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, ...
7f20220ed362c06de786e6e53936702bd7c0c7ff7a20f963150558120094113d
R
6,723
144
context("Test calcNhoodDistance 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 covarianc...
be2a54ef00a4c52af1b8f77adf64df2e2991bf34413cf3f440b57689b8ed7136
R
6,750
174
##' PCA by non-linear iterative partial least squares ##' ##' Can be used for computing PCA on a numeric matrix using either the ##' NIPALS algorithm which is an iterative approach for estimating the ##' principal components extracting them one at a time. NIPALS can ##' handle a small amount of missing values. It is no...
1c87173688a3fa20259ed5b5efacfd277b0d1bc910e3b1197b4349088af46da4
R
6,800
207
# abs_power.r Plot power spectra for 5 stacks, ONE class (Larry) LINES = T # Solid line to show mean RIBBONS = F # Ribbon of +/- 1 SEM (can have both) NAME.PDF = F # [F] 'T' if concat two monkeys in SCATTER=2 X.int = 250 # [250] Spacing between tics on X axis if (!exists("OVERRIDE.OVERRIDE")) { AREA.OVE...
f4d1a43c475f2ec7f70b9c1428d75d60171c8aa84a373668d33cd27ab9a8f996
R
6,824
166
# On-Demand Seizures Facilitate Rapid Screening of Therapeutics for Epilepsy # Authors: Yuzhang Chen, Brian Litt, Flavia Vitale, Hajime Takano # DOI: https://doi.org/10.7554/eLife.101859 # Step 1: Import Libraries and Generate List of SubFolders library(ggplot2) library(lmerTest) library(dplyr) # KEY: Change to loca...
e3ef5e1f543527d11292095707827e721ed9793d6d300d4ef89a3aacf4d0eb01
R
6,886
142
setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/") library(tidyverse) source("src/scales.R") res <- read_csv("results/metrics_all_env.csv") %>% filter(Model %in% c("Linear", "ReLU")) %>% filter(Data %in% c("G", "S", "W", "GSW")) ref <- read_csv("processed/reference_sorted.csv", show_col_types = FALSE) y <- s...
2430741736b27b287e33e70768eb86f70ec39cd7530922c6f1df1bfedf32ddac
R
6,895
188
## This script imports two developmental references from the original publications, and prepares them for developmental mapping # Load packages ----------------------------------- rm(list = ls()) library(data.table) library(tidyverse) library(qs) library(Seurat) library(data.table) library(SeuratData) library(SeuratD...
72184dc1d196fb292730fe31186fef3e3c028ac0038058dd097cda448dd1d075
R
6,897
180
# 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...
1f861dba8d438305d347da796e2c3ff5012c5331d0981a4e6430a61adbc17c62
R
6,899
166
# On-Demand Seizures Facilitate Rapid Screening of Therapeutics for Epilepsy # Authors: Yuzhang Chen, Brian Litt, Flavia Vitale, Hajime Takano # DOI: https://doi.org/10.7554/eLife.101859 # Step 1: Import Libraries and Generate List of SubFolders library(ggplot2) library(lmerTest) library(dplyr) # KEY: Change to loca...
dab0cf44ff1091ee17d80da3351793e9daf226dc604e7be47cb96bf7ca8ea47a
R
6,939
186
############################################################################### # PAKETE LADEN ############################################################################### library(readxl) library(lmerTest) # für LMM library(ggpubr) # für Boxplots library(glmmTMB) # für Beta- (und andere GLMMs) # -> Optio...
b69cad0e00b240dae74e368f85c93747ae018c02d0e9ebefcdecd28d205b3667
R
6,946
188
setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/") library(tidyverse) library(tensorflow) tf$config$list_logical_devices() library(keras3) library(abind) source("src/scale2.R") ### Reproducibly select sub-model runs ---------------------------------------- seeds <- c(758069L, 929940L, 591511L, 882475L, 961222L, ...
bb43808817f3eb43b0ab6b66ed969dac0b313e6cc9e3a73548d58913ff80919f
R
6,973
176
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) %>% mutate(yNA = if_else(Set == "...
ac0d9796325510eb92529ef576291ef9a8011ae3d4fcf9938ead9dfb24c0bc54
R
7,018
256
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\...
1365663738b2857524f987ca7f786f2ac52465df79e5b365103f80e7ffeda43b
R
7,038
157
--- output: github_document --- <!-- README.md is generated from README.Rmd. Please edit that file --> ```{r, echo = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" ) ``` # `powsimR` <br/> Power analysis for bulk and <br/> single cell RNA-seq experiments <img src="vignettes/...
9ef245e94ea209a63fc8078543677218f7d5ce0a034611328a0e1d1a3e3fbff8
R
7,080
184
library(tidyverse) library(ggsignif) df<- read.table("7Networks_LH_Default_Par_3_MeanCurv_lh.Schaefer2018_200Parcels_7Networks_order_taxon.tsv", header = TRUE, sep = "\t" ) df$mri_d<-df$X7Networks_LH_Default_Par_3_MeanCurv_lh.Schaefer2018_200Parcels_7Networks_order new_df <- subset(df, select = c('X2665642',...
236396c56496fac51af8f232836a753895bba1317d8d715a7b04f7edbf25247f
R
7,083
178
#' extract the protein identifier from a fasta header #' #' the first set of non-whitespace characters on the row is assumed to be the protein ID. #' the leading '>' is not included (if present). #' #' this regex should be robust for all sorts of input, including those not following official standards. #' should be ">...
d0925bee70603c2ae21d18f2758aacd7477a87f3b2fd179c39d899aece5b3078
R
7,140
165
setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/") library(tidyverse) ref2 <- read_csv("processed/reference_sorted.csv", show_col_types = FALSE) y <- scale(ref2$GrainYield[ref2$Set == "Train"]) yc <- attr(y, "scaled:center") ys <- attr(y, "scaled:scale") rm(ref2, y); gc() ref <- read_csv("processed/reference_gene...
231cfa29362cf1559f7952a4a92ced7b2e4928723a2f9d1721bec215eff11687
R
7,163
111
# Step 4: GUI to count nuclei in a Visium spot ## spotspotcheck `spotspotcheck` is a graphical user interface (GUI) designed for: 1. Obtaining the nuclei count per Visium spot and saving it to a `.csv` file. 2. Performing quality check on the nuclei segmentations (from [Step2](http://research.libd.org/VistoSeg/ste...
b909cc47da6c806a4ca9c7d18a6c6cd6807b063c0eebd593fafb5d094f8a41a1
R
7,164
181
library(rhdf5) # Load Python and R functions for basic Wilcoxon Tests, DESeq2, and CocoA-Diff # and causarray, cinemaot require(reticulate) use_condaenv('renv') path_base = '/home/jinandmaya/' setwd(paste0(path_base, 'methods')) source('R_functions.R') path_base = '/home/jinandmaya/simu_poi/' setwd(paste0(path_base, '...
9db72c7c3349b6935ffa44b3fcffb48b7fb4bc64198889fdc3a4a6e89de2595a
R
7,170
155
library(dplyr) library(Seurat) library(ggplot2) ## Style plots # color palettes col_sample = c('#370617', '#e01e37', '#f6cacc', '#ffba08', '#ffa200', '#d4d700', '#55a630', '#8be8d7', '#2fb5c7', '#0377a8', '#002855', ...
6567df7739c773141956c000bb4c843eeeb5d06abd0ab76197f56df1f15d8c6a
R
7,184
258
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\\synthetic\\results\...
d0b366fdd3399149e03de9cbf8626e015afe81fd0a1e0f0a72d7ee1563326791
R
7,184
237
--- title: "Getting Started with the Epoch Package" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{vignette} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>", eval = TRUE, fig.align =...
c07cb24e1e59074c21047d6730cb494f8aa1aaafb5e065590d2355135cda02ad
R
7,207
206
--- title: "Fig 4 HFA/Theta Combined Plot" output: html_document date: "2025-02-20" --- ```{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) lib...
a22bd8d1f63fed82ed7c1bb9ad5dda9afa0bd772294c498929831a4d8e73ab6b
R
7,258
188
if(!require(devtools)) install.packages("devtools") devtools::install_github("kassambara/ggpubr") setTimeLimit(100000); setSessionTimeLimit(10000) library(ggplot2) library("cowplot") library("gridExtra") library(ggpubr) library(plyr) # load data data <- read.csv(file="//lexport/iss01.charpier/analyses/stephen.whitma...
fbb05c8caa10238b13d8a72b8fa6fd5f745de7e7f465cbd628bad12e1f1c1d93
R
7,273
190
# census mode function #' @importFrom stats density .dmode <- function(x, breaks="Sturges") { if (length(x) < 2) return (0); den <- stats::density(x, kernel=c("gaussian"), na.rm = T) ( den$x[den$y==max(den$y)] ) } # census estimate_t function .estimate_t <- function(relative_expr_matrix, ...
dc81c16494c6f05d4161e0a01898c24065032edec089e21ce5758baead363c10
R
7,277
198
#' Runs a comparative scWGCNA analysis #' #' This function runs a WGCNA analysis adapted for single cells. Based on single-cell or pseudocell data. #' @param scWGCNA.data The WGCNA data to use as reference for comparative analysis. Output from run.scWGCNA #' @param test.list List of Seurat objects. The samples to test...
20592f2ee0ee6ffc4131a3350e5325a7a2f8fe99dfcad3b2e4c2fc3e74395f74
R
7,278
158
##' Implements a Bayesian PCA missing value estimator. The script ##' is a port of the Matlab version provided by Shigeyuki OBA. See ##' also \url{http://ishiilab.jp/member/oba/tools/BPCAFill.html}. ##' BPCA combines an EM approach for PCA with a Bayesian model. In ##' standard PCA data far from the training set but...
e12c39c81535ad86d0d1fd98fb80021e04285906cf2f08e81ffd9ce72428d97c
R
7,288
223
require(parallel) require(optimParallel) source("~/Documents/yu_lab/kernels_in_GP/Kick_data/src/margh.fun.R") source("~/Documents/yu_lab/kernels_in_GP/Kick_data/src/margl.fun.R") ### N.B.: Optimization of the Gaussian and deep kernels should be done using ### the *training* phenotypic data to reduce information leak...
afc522927730b3d0df04abfe95181c8cabbc9aff14df9c1ac3d57313d2800181
R
7,333
159
context("Testing nhood grouping 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 covarianc...
5a2fa85d341a520fc1476004122dbefcfc58efdbc46ba9c01c2926935954c06d
R
7,361
179
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...
f1eeffacae76efb2e0d1ee73574dcc2f6d1ddf75dab7faafc8f31beae0863e57
R
7,393
199
library(Seurat) library(SeuratObject) library(DESeq2) library(ggplot2) library(scales) library(qs) library(dplyr) library(zebrafishRNASeq) #'####################################################################### # Load method functions ---- #'####################################################################### pa...
f0bbb9c88a0f3613561b1a3c194ec2142e1d48c00a0646fd2a3a0e150939c883
R
7,399
216
# PowerVsFreq_baseline.r (Seul Ah) # ---------------------------------------------------- # Plot LFPeffect as a function of frequency bands # Power vs. 1 variable (freq) rm(list=ls()) NEAR.OVERRIDE = 2 # [2] good value ALIGN.OVERRIDE = "" # [""] Other aligns cannot be normalized (w/o writing # much more c...
64d3ab9697eb8189b93eb4af93d46e04e79201bb825e7babc84a40056c487419
R
7,414
178
#install.packages("R.utils") #devtools::install_github("mrcieu/gwasglue",force = TRUE) #BiocManager::install("VariantAnnotation") #install.packages("devtools") #devtools::install_github("mrcieu/gwasglue", force = TRUE) #install.packages("remotes") #remotes::install_github("MRCIEU/TwoSampleMR") #引用包 li...
6b2fcecdc94bd83b5a97cf12c595aeb63491d6d97b5fdde319352145c05b0ab3
R
7,418
194
############################################################################### # PAKETE LADEN ############################################################################### library(readxl) library(lmerTest) # für LMM library(ggpubr) # für Boxplots library(glmmTMB) # für Beta- (und andere GLMMs) # -> Optio...
9bf724d1f45f03831eb50f8463ce90b6710b2374f6d35cce34997a0f00de5c52
R
7,422
222
setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/") library(tidyverse) library(abind) # For reproducibility: set.seed(840509) ### Load the hybrid marker matrix --------------------------------------------- # From Lopez-Cruz et al. (2023) X <- read_csv("../../genomes2fields_curated/data/data_g2f/GENO.csv", show_co...
35300c5cb32437a73da2f2d0e6101dab057d2aa8ff2c534e97b0b2feb327dd5b
R
7,470
176
#' Build a k-nearest neighbour graph #' #' This function is borrowed from the old buildKNNGraph function in scran. #' Instead of returning an igraph object it populates the graph and distance #' slots in a Milo object. If the input is a SingleCellExperiment object or #' a matrix then it will return a de novo Milo objec...
eeed29146d5b2c4b0a76cfe657731ad456aab9828485b6112252d2af2cc17e4d
R
7,481
220
--- title: "synapses_by_roi" output: html_document date: "2024-05-31" --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ## R Markdown This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <h...