sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
17k
content
stringlengths
1
200k
2f876153e8b85c60250596620760f2c638984dab29f98052ac51e208e41ca45e
R
14,198
273
--- output: rmarkdown::github_document: html_preview: true toc: true --- ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, fig.path = "images/customlimma-", comment = "#>" ) ``` ```{r setup, include = FALSE} devtools::load_all() # ! change to some temporary working directory on your co...
6e3c7bb2b0341688599ebb9ce7ff4bfde6fe91ee6b6965a49ec8d07296632269
R
14,223
320
library(Seurat) library(SeuratDisk) # new, for h5Seurat objects library(dplyr) library(data.table) library(Matrix) require(SeqArray) source('../../R/scTWAS_IRLS.R') gene_info <- fread('../Onek1k/1k1k_gene_GRCh37.txt') suppressMessages(library("optparse")) option_list = list( make_option("--run_subtype", action="sto...
c1156f8fb9a1a3121580c7285528be53411449699b6e0b849a80bcd96ab3fa17
R
14,235
285
context("Testing testNhoods 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(BiocParallel) set.seed(42) r.n <- 1000 n.dim <- 50 block1.cells <- 500 # select a set of eigen values...
5ed970c5e4a84892e8dfe0a33f6309307dfb12a9687e11682c8353e3325f01a4
R
14,279
431
# ==================================================== # CALCULATING PLASMA PROTEOMIC ORGAN AGE GAPS # ==================================================== # MODEL DEVELOPMENT (by Oh et al. 2023; https://doi.org/10.1038/s41586-023-06802-1): # - Bootstrapped LASSO regression models trained in an independent cohort (K...
07c496635732a953df86304712aa2bcdbd291f32bfbe40f2ad9ed267a6451207
R
14,325
300
# Load packages ----------------------------------- rm(list = ls()) library(data.table) library(tidyverse) library(crayon) library(ape) library(readxl) library(qs) library(cowplot) library(Seurat) library(ggpubr) library(future) library(SingleCellExperiment) library(SingleR) library(celldex) # Organize environment an...
6214b844a449499724bcdecaeb19be3124956c4d4dd0be9b9a6cb05dcd02d3df
R
14,478
353
#' Runs a semi-automatic, iterative scWGCNA analysis #' #' This function runs our semi-automatic single-cell WGCNA analysis. It runs in an iterative way. Based on single-cell or pseudocell data. #' @param p.cells Seurat object. The expression data used to run the co-expression analysis. Can be pseudocell or single-cel...
c27d1350f5439ff7590d427a113c5c9dc318674a983838bf2c95940d5d5a8c14
R
14,521
423
# ReadAll.r Plot power spectra for classes. # In correlation, 'flip' irrelevant to LIP-LIP and PRR-PRR, but matters in # a straightforward way for cross. # Crossx2 is trickier; have to do it in Select CRITERION_Z = 0 # [0] Remove if greater than (3?) SCALE = F # [T] Everyone gets equal weight REMOVE_POWER_OUTLIE...
12576010af4a50340f4827f4f74cc93cb40e70a69955ac05de31eb53257003b1
R
14,537
453
--- title: "Calculate Theta Correlations" output: html_document date: "2025-01-13" --- ```{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) libr...
297561cd66e4464a1353bf31065cba6db362288d4dd4165652489dfc55055209
R
14,592
255
### If running the sensitivity and specificity analysis separately, uncomment the lines below after changing to the right directory # source("Driver.R") # source("ComputeStatsNew.R") # source("Constants.R") # source("Utilities.R") computeSensSpec = function(version = 2, relaxed = FALSE, safe = TRUE, skipEpistasis = TR...
4b19156db9894298b255620dc5efd9f4ce75e49fd9e10187f329dd57f2e0d6b4
R
14,627
538
--- title: "Coherence ~ Region Models (IMCOH)" output: html_document date: "2024-10-23" --- ```{r setup, include=FALSE} knitr::opts_chunk$set( echo = FALSE, # don't print the code chunk warning = FALSE, # don't print warnings message = FALSE, # don't print messages fig.width = 8, # set default width of fig...
a42f1a50c6f2a8f4edcc0b3589037a6a0e5d8a0a8ae480ccb210023ec53254db
R
14,641
302
# ------------- Figure S4 -------------- #----Figure S4A---- groupSize <- as.numeric(table(cellchat@idents)) par(mfrow = c(1,2), xpd=TRUE) #CM2 celltype_col <- c('#f1b38a', '#f0db69', '#a2c246', '#f5cee0', '#b6d2b7','#cbd2e5','#ad98c3','#be95db','#53A85F','#E5D2DD', '#F1BB72', '#F3B1A0',"#d6d5b7",'#D6E7A3',"#0073C...
4e2ac4c2771c7ff824efc651fd0f1d439a6cd819504753c35af6c28121d68453
R
14,699
336
library(Maaslin2) library(funrar) library(dplyr) library(ggplot2) library(cowplot) library(plyr) library(circlize) library(here) library(stringr) here::i_am("src/PFF/PFF_PWY_Maaslin2.R") ## PFF Jejunum --- input_data <- read.delim("data/PFF/PFF_Microbiome/starting_files/picrust2_output_min10000_no_tax_PFF_ASV_table.q...
266363e21c59c2d1bd36c002f1459ff623773afde46740f6b9256d5799c50d14
R
14,700
450
# Create a dummy Epoch object for testing set.seed(1) row_num <- 10 col_num <- 100 dummy_data <- matrix(rnorm(row_num*col_num), nrow = row_num, dimnames = list(paste0("Elec", seq_len(row_num)), NULL)) expected_times <- seq(0, by = 0.1, length.out = col_num) dummy_epoch <- Epoch(dummy_data, time = expected_times) test_...
72270c9c323ea587e6be385876a191e58ff1007128742cd3b134fce78f02ce3d
R
14,784
331
library(ggplot2) library(vegan) library(dplyr) library(rlang) library(cowplot) library(viridis) library(Microbiome.Biogeography) metadata <- read.table("../starting_files/PFF_Mapping.tsv",header=TRUE) counts <- read.table("../starting_files/PFF_ASV_table_Silva_v138_1.tsv", header = TRUE, row.names=1) ## Store taxonom...
c932e6d02634aa160f7411dccae796b77651fad1fa41744a78592d05b31b1c3e
R
14,822
299
context("Testing post-hoc DGE function") library(miloR) ### Set up a mock data set using simulated data library(SingleCellExperiment) library(scran) library(scater) library(irlba) library(MASS) library(mvtnorm) set.seed(42) r.n <- 1000 n.dim <- 50 block1.cells <- 500 # select a set of eigen values for the covariance ...
438e631056f74d45c07fe099988d2c481a4d0af7bfe90e8d9e0e199e9ab4fe8e
R
14,840
409
##' Vector with current valid PCA methods ##' @title List PCA methods ##' @param which the type of methods to get. E.g. only get the PCA ##' methods based on the classical model where the fitted data is a ##' direct multiplication of scores and loadings. ##' @return A character vector with the current methods for doi...
86106f6d0272e98a1dd62079857a3e685e445572d8fba9156d76512987619645
R
14,979
441
--- title: "Hemisphere x Long-Axis Interaction" output: html_notebook --- Version 1.0, July 2025, SA This script plots hippocampal connectivity with neocortical clusters identified by a significant hemisphere x long-axis interaction. Input: Hippo_AxisxHem_F_betas.txt Output: Plots in Fig S3C # Packages and functi...
7956118e9e9cf33e51d9c0df1587e92e5483c8689d967b8b3f9a62b94d8ccfe4
R
14,982
504
#' Install and manage Seurat datasets #' #' @section Package options: #' #' SeuratData uses the following options to control behaviour, users can configure #' these with \code{\link[base]{options}}: #' #' \itemize{ #' \item `SeuratData.repo.use`: Set the location where the SeuratData datasets #' are stored. Users g...
0c5718fb3b32aa14aa29ece98648c9c40b6677df97ee883edd1276ccf8622d37
R
15,003
490
--- title: "All ROI HFA Ghost Attack" output: html_document date: "2024-10-29" --- ```{r setup, include=FALSE} ## libraries ## library(tidyverse) library(ggplot2) library(lmerTest) library(doParallel) library(parallel) library(foreach) library(here) library(fs) library(lmtest) library(blme) library(scales) library(ggt...
104acd51e43ccf5db771eefbf3cbb7db3a0fe591b5b9df9f52f86920995a4240
R
15,029
516
--- title: "MMN amplitude" output: html_document --- ```{r echo = FALSE} # clear old outputs if(dir.exists(file.path("../output/mmn_amp"))) { unlink("../output/mmn_amp", recursive = TRUE) } output_dir <- file.path("../output/mmn_amp") dir.create(output_dir) nice_tables_file <- paste0(output_dir, "/nice_tables....
cfdf8e2e3737a1c6788d39d8a7f9f3628bd46df8e9e731ebe18cef7de8d032a9
R
15,041
356
context("Test spatialFDR function") library(miloR) ### Set up a mock data set using simulated data library(SingleCellExperiment) library(scran) library(scater) library(irlba) library(MASS) library(mvtnorm) set.seed(42) r.n <- 1000 n.dim <- 50 block1.cells <- 500 # select a set of eigen values for the covariance matri...
3a5565a47b85ad63327d7e15b7cb7aa319729c8c2aead2225524f9d7cf71ec7b
R
15,104
325
#' Identify post-hoc neighbourhood marker genes #' #' This function will perform differential gene expression analysis on #' differentially abundant neighbourhoods, by first aggregating adjacent and #' concordantly DA neighbourhoods, then comparing cells \emph{between} these #' aggregated groups. For differential gene ...
edf85764f4240dbcb949388684798aa53ae4944fed8463c45aaacc43b235095d
R
15,156
249
# NicheAnalysis function takes in the location of the annotated seurat object, the minimum and maximum number of niches # and builds niche assay for all the values of niche numbers between min and max, and the given number of neighbors for # the same, and saves the seurat object appropriately. NicheAnalysis <- functi...
4ce2139356d8130f0d2ad98256f7661187d8f00b0bccb6e340cd352f6b89c1f8
R
15,210
419
#Deconvolution Functions #install these packages if necessary... if (!require("quadprog")) { install.packages("quadprog", dependencies = TRUE, repos="http://cran.r-project.org") } if (!require("reshape")) { install.packages("reshape", dependencies = TRUE, repos="http://cran.r-project.org") } if (!require("e1071"))...
b5d154f1e95706d8232f3cdd9ca5691268c118403a5b39282ac90aab28e7e094
R
15,294
456
# power2.r Plot power spectra for 5 stacks, > 1 class # Overlay two classes # For grant # Split: 3 & 5: '1' is purple (2 & 4 are orange) # 12: '8' is purple (4 is orange) LINES = T # Solid line to show mean RIBBONS = T # Ribbon of +/- 1 SEM (can have both) SECOND_CLASS_RIBBONS = (CLASS.OVERRIDE==...
521e3aec280f60f769efc250c77009218593f7c474927cc729c2c5c2858c5c71
R
15,387
409
--- title: "Quantifying the error associated with estimating cellular composition from DNA methylation profiles" author: name: Eilis Hannon affiliation: University of Exeter email: E.J.Hannon@exeter.ac.uk package: CETYGO bibliography: cetygo.bib abstract: > A tutorial on calculating the CETYGO scor...
df537b030b3639c27fd71e58d78c9febea9aea3f178c47f4490d200043302ba7
R
15,433
231
--- output: github_document: html_preview: true toc: false --- <!-- README.md is generated from README.Rmd using devtools::build_readme() --> <!-- ![MS-DAP logo](doc/logo/msdap_logo_small.png) --> <img align="left" alt="MS-DAP logo" hspace="20" vspace="10" src="doc/logo/msdap_logo_small.png"> &nbsp; Th...
b6d5d773f555cdb663c266ef4e09e2723ef41eaa3febd81204d6510bdcb9f77e
R
15,449
320
# Setup ----------------------------------------------------------------- #' @name Setup #' @aliases Setup #' @title Setup options for RNA-seq count simulations #' @description This function generates the settings needed for \code{\link{simulateDE}}. #' Firstly a set of differential expressed gene IDs with #' associat...
34704f556325811813c3063b5928ca0904675312e719a45dd35a76dab2157e68
R
15,591
353
suppressMessages(library('plink2R')) suppressMessages(library("optparse")) option_list = list( make_option("--sumstats", action="store", default=NA, type='character', help="Path to summary statistics (must have SNP and Z column headers) [required]"), make_option("--out", action="store", default=NA, t...
c213579b7e373372279be2ab42c8c9a1241ca43681b405c96f6cf5a77df5ef15
R
15,610
311
### original code from this commit: https://github.com/statOmics/MSqRobSum/commit/2875dcde1f89578685ed0a3316d6f66fa510b732 ### here adapted to get optimal multiprocessing for vastly reduced computation times & compatibility with latest dplyr ### FRANK: removed all documentation/examples/"additional functions we don'...
338972726b77f6ba81805800a1a5f97021c09d50346cd7cdc4a878445962530d
R
15,660
230
--- output: github_document: html_preview: true toc: false --- # About Docker The MS-DAP R package depends on many other tools / code libraries, so in order to work with MS-DAP one needs to install all these dependencies as well as the R programming language and RStudio (ref; MS-DAP R package install guide)...
9c3805b73deb682bdf4cbe674b65356c439f6a8f0d5ec7939b7d56f59d905d3d
R
15,816
307
## This function executes the neutral algorithm, which identifies variants that should be considered as neutral ## If safe = FALSE, existing conversion files for mapping version 1 to version 2 are used directly (no checks!) ## The last option is only used for naming the (intermediate) output files, and should not norma...
c032f2c76d3ba37466cb9c5c3ef9eb93b1ab98b69edbf5828a7875e34e5df0e0
R
15,870
337
library(Seurat) library(tidyverse) library(glue) library(SeuratWrappers) library(ggpubr) library(SingleCellExperiment) library(scDblFinder) library(SoupX) library(qs) source('~/Projects/General-Codes/Resources/Plotting_helper_functions.R') source('/home/cao385/Projects/General-Codes/Resources/single_cell_preprocessing...
14009efed5590b523179e12687a930254314fbb76594aafba0468aa40ac09d7d
R
15,982
422
--- title: "Example Regional Differences based on Coherence ~ Region Analyses" output: html_document date: "2024-11-19" --- ```{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 ...
ae507c152daebfeb6c9700aba53011c35c017666022e6760b144945f26966264
R
16,284
567
--- title: "Coherence ~ Region Models (PPC & PLV)" output: html_document date: "2024-10-23" --- ```{r setup, include=FALSE} knitr::opts_chunk$set( echo = FALSE, # don't print the code chunk warning = FALSE, # don't print warnings message = FALSE, # don't print messages fig.width = 8, # set default width of...
38aa900e3d89635b15b281515acd70dcc81b6fbee6855b511952e84b1070dbfc
R
16,382
438
# doPower.r # Cannot run simultaneous analyses if SPLIT_SACCADE ! ########################################################################### # Set basic parameters (override if DoAll) # ############################################ AREA = "PRR" MONK = "tyr" # zen, tyr, both (don't use both: R calls will merge monks...
71883d58c37b27eecacdd375c6f4dd2828e5b5685f4bf29755400ebd03cf3432
R
16,415
350
library(biomaRt) library(gprofiler2) # g:Convert for robust, cross-namespace symbol -> Ensembl ID library(dplyr) library(readr) library(stringr) library(purrr) # biomaRt pulls in AnnotationDbi, whose select()/etc. mask dplyr verbs. # Force dplyr versions so the pipeline doesn't break mid-run. select <- dplyr::sele...
b933b1c3c9c272f5e33b160da37eb3398bb82d7b6df4f862ac761a01a5d94c83
R
16,472
344
library(Seurat) library(tidyverse) library(harmony) library(SeuratWrappers) library(patchwork) #load full processed human data cds2<- readRDS("data/cds2.rds") #create an ensembl gene annotation table linking mouse and human genes require(biomaRt) human <- useMart("ensembl", dataset = "hsapiens_gene_ensembl", host = "ht...
d07b24147dedefc153512c0dd9e9122101b81e777556f2385bf48b7cb4e23258
R
16,526
311
--- title: "Mixed effect models for Milo DA testing" author: "Mike Morgan" date: "14/03/2023" output: BiocStyle::html_document: toc_float: true BiocStyle::pdf_document: default package: miloR vignette: | %\VignetteIndexEntry{Mixed effect models for Milo DA testing} %\VignetteEngine{knitr::rmarkdown} %\Vig...
fc15f7dad2e563212311a4be20e07ef575cf3b378b32d0ca01a50f2ffa5615c5
R
16,594
377
#' Parse HGNC gene identifier lookup table that was downloaded from genenames.org #' #' download link: https://www.genenames.org/download/statistics-and-files/ #' table: "Complete dataset download links" -->> "Complete HGNC approved dataset text json" -->> download the "TXT" table #' filename is typically something li...
3d00c89560ead02daf11ae598ae24cbf7467dcdefc373009428fad33d5ee65bc
R
16,653
336
#' Normalize a numerical matrix by the Variation Within, Mode Between (VWMB) algorithm #' #' @description #' The normalization algorithm consists of two consecutive steps: #' 1) samples are scaled within each group to minimize the overall `metric_within` among replicates #' 2) summarize all samples per group by respec...
f354226731485ff7292fa2a7b27a78d8a3f0e2b2fe7ace10de2adc2d1177d4dd
R
16,862
479
--- title: "Rat cocultures " output: html_document author: "Daeun Jeong" date: "2025-08-07" --- ```{r preparation environment, message=FALSE, warning=FALSE} # Load packages ----------------------------------- library(dplyr) library(qs) library(Seurat) library(ggplot2) library(patchwork) library(SeuratObject) library...
d9b9eb2fd444fff7aa1876a0f06ee195f1b6ac4e30566a6ed1d418538943d74c
R
16,958
296
## ----knitr_init, echo=FALSE, results="asis", cache=FALSE---------------------- library(knitr) library(rmdformats) ## Global options options(max.print = "75") opts_chunk$set(echo = FALSE, cache = FALSE, prompt = FALSE, tidy = FALSE, comment = NA, ...
9da1e8122b399959af9424e95c066264e144ba204a4daf05ab1e93ba24dbbe86
R
16,991
319
#' global.R # Copyright (C) Carlos Biagi Jr # # Tis is a free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation; either version 3 of the License, or (at your option) any later # version. # # This software is distributed...
f428eb0598d1320a5450b92e60b8e8a720da5799423869f523b0e6e3cdbad22f
R
17,133
334
library(Seurat) library(tidyverse) library(harmony) library(patchwork) #subset E11 matching TW E11 data cds <- readRDS("data/cds.rds") Idents(cds) <- "stage" E11 <- subset(cds, idents = "E11") Idents(E11) <- "cell_type" #subset E11 mesenchyme and transfer subtype annotation from TW mes <- subset(E11, idents = "mesenchy...
6fd2f04a7f79e655d2f5f49085e0eb3c359b3230ed49a7d20a5c2cbe8c0a57a2
R
17,135
297
#' Summarize DEA and/or differential detection results in a dataset into a table with a single statistic per gene #' #' @description #' #' In most cases, you probably want to use the `export_stats_genesummary()` function instead. #' That is a wrapper function that uses this function but also adds additional functional...
31d34749be3ad2b7b3aa735777861058da3928924d8bade508cfa4dbe5bfc3a6
R
17,162
399
suppressMessages(library('plink2R')) suppressMessages(library("optparse")) option_list = list( make_option("--sumstats", action="store", default=NA, type='character', help="Path to summary statistics (must have SNP and Z column headers) [required]"), make_option("--out", action="store", default=NA, t...
a2e6ab68d110dd3f3fbeb1873a193b6c775c06b5d54d27a652c6a8075bff9ddf
R
17,175
466
## Make a taxa summary plot -- generate_L6_taxa_plots <- function(path_to_csv, titlestring,greppattern, fillvector){ #L2_lum<-readRDS("Long_Term/taxa_barplots/LuminalColon_level-6.RDS") #taxa <- gsub(".*g__","",taxa) #cols<-assign_cols titlestring<-c(titlestring) L2_lum<-read.csv(path_to_csv,header=TRUE,row.n...
8aca77e649ce89922e47237749c72a5eeb31443173a6751938013a86b9b094e7
R
17,230
505
--- title: "Identification of transcriptional programs differentially regulated between canonical ZFTA-Cluster and ZFTA-Cluster 3 tumors" author: "Sara Danielli" output: html_document: toc: yes df_print: paged --- ```{r, setup, include = FALSE} library(knitr) opts_chunk$set( echo = TRUE, cache = TRUE, warn...
43ced6e64fd93202ab184a44fb4afa0a7c9c89801f6e3f8a445360237ad2d96a
R
17,301
243
gradeMutations = function(LoF = TRUE, NON_DATABASE_DIRECTORY = NULL) { ## Prepare the master variant table, compute genes and mutations, and conduct a basic consistency check Tab0 = read_csv(paste0("Stats_WHO" , ifelse(LoF, "_withLoFs", ""), ".csv"), guess_max = Inf, show_col_types = FALSE) Tab1 = read_csv(paste...
cee23e4678c0a3fd5270445e76a9e9028276c45faaa14262fc3be51fc63e308e
R
17,484
340
rm(list = ls()) library(DESeq2) library(pheatmap) library(RColorBrewer) library(org.Mm.eg.db) library(ggplot2) library(dplyr) library(tidyr) library(UpSetR) library(tibble) library(gridExtra) library(poolr) library(reshape2) library(WGCNA) library(PMCMRplus) library(readr) library("tidyr") library(ggplot2) library(tidy...
52d3fab49208df2c247e7a074969eecf5378a3c82096c2cd93bc17f67f55d38e
R
17,495
516
# power.r Plot power spectra for 5 stacks, ONE class (Larry) # And scatter plot LINES = T # Solid line to show mean RIBBONS = T # Ribbon of +/- 1 SEM (can have both) PRINT.MEANS = F # Won't work for other alignments! PRINT.DIVERGE = T PRINT_DATA_FOR_FIGURE = F StimAt = c(495, 520) # Contaminated range ...
eb0a09802bd24fda0113e99ed66d951bee470ea4d49733670160a2866e591240
R
17,580
393
--- title: "Perturb-seq analysis (R)" output: md_document: variant: markdown_github+tex_math_dollars date: "`r format(Sys.time(), '%d %B, %Y')`" --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` # Perturb-seq Tutorial (R) This tutorial uses an excitatory-neuron subset from [Jin et al. (202...
36b928ca47f69adcf10295a957a260224b950771a77eda18c8cbdf72e531e1d9
R
17,646
270
#' Import a label-free DDA proteomics dataset from a ProteomeDiscoverer PSM result file #' #' @description #' ProteomeDiscoverer workflow must include Percolator so MS-DAP can parse peptide confidence scores. #' #' Example ProteomeDiscoverer workflow: #' - Processing Step: PWF_QE_Precursor_Quan_and_LFQ_SequestHT_Perco...
fab9f921ce9fafff7b5627e1fdefae3360fb6cfc3b3d7381ca2be0e74a96b504
R
17,705
477
# PowerVsFreq.r (Seul Ah) # ---------------------------------------------------- # Plot LFPeffect as a function of frequency bands # Power vs. 1 variable (freq) rm(list=ls()) NORMALIZE.OVERRIDE = F # [T] usually, but [F] for raw power (1/f) plots SCALE.OVERRIDE = F # [T] Everyone gets equal weight (F for raw pow...
db28b555e4a4eb97aaa0f2c3b6096921a858e95a06e225bd0605915bcebb3d27
R
17,707
290
#' THIS FUNCTION SHOULD ONLY BE USED FOR LEGACY FRAGPIPE DATASETS THAT PRODUCED 'mbr_ion.tsv' OUTPUT FILES (e.g. FragPipe v15) #' #' To generate output files that we here require in MS-DAP, configure FragPipe as follows: #' - assign Experiment IDs in the workflow tab (you may simply set these all to 1) #' - enable Ion...
6002189aa4e51426a0c41573ae16d57412f0319ef627cffc35f897fd49b4ab53
R
17,735
447
Sys.setenv('R_MAX_VSIZE'=64000000000) library(tidyverse) library(cowplot) library(Matrix.utils) library(edgeR) library(Matrix) library(reshape2) library(S4Vectors) library(SingleCellExperiment) library(pheatmap) library(apeglm) library(png) library(DESeq2) library(RColorBrewer) library(data.table) library(scater) libra...
e29981dcbc87c716b31e087ade397b1129fd900dad876dd0c7a3b667343c860f
R
17,748
414
#' Plots the gene / module WGCNA tree, or trees #' #' This function will help us plot the gene / module WGCNA tree. #' @param scWGCNA.data scWGCNA.data. An scWGCNA.data object, as calculated by run.scWGCNA(). #' @param tree numeric. Which of all the trees in the iterations should be plotted? #' @return Plots the las...
a41614a1c0038f165c1209fb3ae4ca0638b24cc0d5b2f8cfcc91df737c160169
R
17,807
502
--- title: "Average Theta & HFA Profiles" output: html_document date: "2024-05-20" --- ```{r setup, include=FALSE} knitr::opts_chunk$set( echo = FALSE, # don't print the code chunk warning = FALSE, # don't print warnings message = FALSE, # don't print messages fig.width = 5, # set default width of figures ...
c0130cfb16064872c4213c3878f43de3f14de4283ce2f14e76c682bc169e5eea
R
17,874
359
rm(list = ls()) library(data.table) library(tidyverse) library(readxl) library(crayon) base_dir <- "/n/scratch/users/s/sad167/EPN/scRNAseq" resources_dir <- file.path(base_dir, 'scripts/resources') source(file.path(resources_dir, "single_cell_preprocessing_helper_functions_CBJr.R")) analysis_dir <- file.path(base_...
f385f5e6ee2059a8854e727562c5a0002c5099f0535a2bb7b1d22b22d6f7b02f
R
17,932
349
library(dplyr) library(ncdf4) library(ggplot2) library(dichromat) library(scales) library(RColorBrewer) library(maps) library(patchwork) library(raster) library(sf) library(readr) library(terra) library(tidyverse) ########################## #Loading environmental data ########################### sites<-read.csv("Data...
a41f6a199bfc6aac4fa91a64f5f668abbb14d724be32351bf79d5c9576d3eb32
R
17,965
549
--- title: "Differential Connectivity (Coherence ~ Region) Tables" output: html_document date: "2024-12-04" --- ```{r setup, include=FALSE} knitr::opts_chunk$set( echo = FALSE, # don't print the code chunk warning = FALSE, # don't print warnings message = FALSE, # don't print messages fig.width = 8, # set d...
cfa894996dfb6b9ea65c141445f50e16d2a6f3d7033d4545b83b48e5ba5eb320
R
18,084
498
# VsFreq.r # If 'SUBTRACT.BASE' is true, then save the base (target align) and # subtract it from cue align. LO_FREQ = 18 # [18, 16, 12, 8] (short intvl: 18?) HI_FREQ = 100 # [100,100,50] (movement period:120) LO_NOTCH = 57 # [56-7] if SUBTRACT.BASE: 56 if 200 ms: 46 HI_NOTCH = 62 # [64-2] if ...
e7f9012e2b50a7b6ecc7ee3b9325d1facaa2d5a9d89ce3be77586fa31bb2b38c
R
19,114
323
#' Import a label-free proteomics dataset from MaxQuant #' #' @param path the directory that contains the search results (typically the 'txt' filter that contains files 'proteinGroups.txt' and 'evidence.txt') #' @param collapse_peptide_by if multiple data points are available for a peptide in a sample, at what level s...
a625b3440dae3b91d1e83ff06c979766256dc5594b825ec6c1154284dd1b6848
R
19,417
462
#' Test if the dataset contains DIA data, simply testing if the acquisition_mode equals "dia" (case insensitive) #' #' @param dataset dataset to test #' @export is_dia_dataset = function(dataset) { if(length(dataset$acquisition_mode) != 1) { append_log("'acquisition_mode' attribute missing from dataset", type = ...
2b4338d6b728676cc2e243fbfe2bb2fa57ffc5a1c0b02b3877a3a508079806ee
R
19,431
533
--- title: "Create Sig Theta Coherence CSV" output: html_document date: "2024-09-20" --- ```{r setup, include=FALSE} knitr::opts_chunk$set( echo = FALSE, # don't print the code chunk warning = FALSE, # don't print warnings message = FALSE, # don't print messages fig.width = 8, # set default width of figure...
d03b09dfa10f7ecc83797a8c660ff013f01e6b49487aeca30f2f4ae6ce861151
R
19,546
537
# IMPUTATION WRAPPER ------------------------------------------------------ .impute.calc <- function(Imputation, countData, spikeData, batchData, clustNumber, Lengths, ...
122e7906ed53bf2327b16fa1cd1ad983d0a85bf9beab5de480c9b4d41b1f3ec0
R
19,565
576
######################################################################## # # Load the Python package # ######################################################################## # require(reticulate) # # create a new environment # virtualenv_create("py") # virtualenv_install("py", c("numba", "pandas", "numpy", "scipy",...
54d3a74e6871303b9162a6a5cd429fbffbb166ea9ee4b2507f7d04bb4a2fc677
R
19,565
497
--- title: "Figure 1 Behavioral Data" output: html_document date: "2024-10-14" --- ```{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 ...
a073b52fca35b57e2cab48806af97c965d8484b8adb7fec007f6243fb3f8bbb2
R
19,590
320
#' returns all normalization algorithms integrated with MS-DAP #' #' @description #' #' median: scale each sample such that median abundance values are the same for all samples in the dataset. #' #' loess: Loess normalization as implemented in the limma R package (PMID:25605792) <https://bioconductor.org/packages/rele...
07f37ebf87fe9197c72e7ec879f8dbfe5ea0be788d80bcd855817ddffcecefca
R
19,653
506
## Make a taxa summary plot -- generate_L6_taxa_plots <- function(path_to_csv, titlestring,greppattern, fillvector){ #L2_lum<-readRDS("Long_Term/taxa_barplots/LuminalColon_level-6.RDS") #taxa <- gsub(".*g__","",taxa) #cols<-assign_cols titlestring<-c(titlestring) L2_lum<-read.csv(here(path_to_csv),header=TRUE...
bb354b0252630cdea35f2ab90c2c6c6206ae4bcb05116588e32fb73afa8ae6cb
R
19,765
956
# ---- libs ---- suppressPackageStartupMessages({ library("readr") library("dplyr") library("tidyr") library("forcats") library("purrr") library("furrr") library("lubridate") # way to handle dates better than default R way library("tictoc") # measure time elapsed in calcs library("ggplot2") l...
014927f723df2e0b5fca50c6cffa23789b5b2c05830ef784bacd8160c73ded19
R
20,037
759
library(tidyverse) library(synExtra) library(data.table) library(powerjoin) library(here) library(qs) synapser::synLogin() syn <- synDownloader("~/data", .cache = TRUE) rosmap_quant_clinical <- syn("syn44335073") %>% read_csv() # Use all ROSMAP patient data from PCC region rosmap_quant_clinical_filtered <- rosmap_...
0f5cc6ddbbd384ff17e8385261454b498534dea865b8900ad3a1b53c0612db27
R
20,058
356
#' volcano plot for DEA results, split into 4 panels; with/without labels and with/without thresholding foldchange-outliers #' #' If there are multiple contrasts in your DEA results you should either use the 'wrapper function' plot_volcano_allcontrast(), OR, first subset the DEA result table for 1 contrast before call...
3f2de775ef21c2a43bf403d51e7ae9c155f018cbac308bf4e54932199fd7c84a
R
20,170
539
--- title: "Coculture - rat cell types" output: html_document author: "Daeun Jeong" date: "2025-05-01" --- ```{r, setup, include = FALSE} library(knitr) opts_chunk$set( echo = TRUE, cache = TRUE, warning = FALSE, comment = FALSE) ``` ```{r preparation environment, message=FALSE, warning=FALSE} # Load packages ---...
b38ee92a52c72dfe7c2dd41796e2df17ffe6a0c1804ec6ceea6cae7ad6c42d2a
R
20,307
351
library(Seurat) library(ShinyCell2) library(stringr) library(grid) library(scales) library(scCustomize) library(SeuratDisk) # Code to generate Shiny App setwd("/scr1/users/manchela/Data") seu <- readRDS("human_face_no-neuro_clustering_cellrangerARC-raw_emptyDrops_singlets_finalannot_27Mar.rds") seu$subtype_reduced[w...
797ce6f67ea20cc77330a455691bc9fca1014591e15f4490758cea9d17f29c1f
R
20,375
750
# ---- libs ---- suppressPackageStartupMessages({ library("readr") library("dplyr") library("tidyr") library("forcats") library("lubridate") # way to handle dates better than default R way library("stringr") library("ggplot2") library("ggthemes") library("ggrepel") library("knitr") library(...
b45b5cb018474ea9026d09ed16ae6572feb8537281b1cbef6c8150eb3b4dae8f
R
20,587
754
library(tidyverse) library(synExtra) library(data.table) library(powerjoin) library(here) library(qs) synapser::synLogin() syn <- synDownloader("~/data", .cache = TRUE) # fnROSMAP <- DRIAD::wrangleROSMAP("~/data") rosmap_tdp43_classification <- syn("syn44277761") %>% read_csv() # > rosmap_tdp43_classification %>%...
2d12fdbf453bfc941f0bf543d716e40c1f8c513807bab4aaea75a8fcdb22f428
R
20,855
719
--- title: "Theta Ghost Attack" output: html_document date: "2024-10-30" --- ```{r setup, include=FALSE} ## libraries ## library(tidyverse) library(ggplot2) library(lmerTest) library(doParallel) library(parallel) library(foreach) library(here) library(fs) library(lmtest) library(blme) library(scales) library(ggthemr) ...
473f80ec51e553641b76280731a80a6e1a1087251aae900800a126091a83c6cd
R
21,274
384
library(ggplot2) library(tibble) library(tidyr) library(tidyverse) library(plyr) library(dplyr) library(vegan) library(glmmTMB) library(arm) library(nnet) library(gamlss) ###################################################### #Summarising assemblages to symbiont genera, Figure S4 #####################################...
94ad15bfe961f1477fc83cdff41f5e30753fadafa9a21a9a7079bd0a465b3f56
R
21,307
556
# TODO # change behaviour of minus mean values ? # Simulate DE between 2 groups (DE of mean) ------------------------------- #' @importFrom stats model.matrix rbinom .simRNAseq.2grp <- function(simOptions, n1, n2, verbose) { set.seed(simOptions$DESetup$sim.seed) if(is.null(simOptions$DESetup$bLFC)) { ...
37a45c43ed2b3c4d6d758f6ce60142fed6408c9be3c0be3c16b12e24bfe0de03
R
21,317
455
library(Maaslin2) library(funrar) library(dplyr) library(ggplot2) library(cowplot) library(plyr) setwd("C:/Users/Jacobs Laboratory/Documents/JCYang/SLC_GitHub/slcproject/PFF_Microbiome/differential_taxa/") ### Note: First remove "#Constructed from biom file row" ### Run Maaslin2 and get table of relative abundances ru...
adb496174fac416de7af3d1219747379de9ba4cb6235ce853124e40ab474b507
R
21,332
834
# ============================================================= # ASSOCIATIONS OF INDIVIDUAL SOMASCAN 11K PLASMA PROTEINS WITH ALL-CAUSE MORTALITY # ============================================================= # COHORT: # Lothian Birth Cohort 1936 # COX MODELS: # Models are fitted separately for each protein. #...
1697ec473c2b61588b8cf73043e967fd8acc39180ad7628c403d4b4361b56257
R
21,404
624
--- title: "EP1NS_hiNs" output: html_document author: "Daeun Jeong" date: "2025-7-15" --- ```{r preparation environment, message=FALSE, warning=FALSE} # Load packages ----------------------------------- library(dplyr) library(Seurat) library(ggplot2) library(patchwork) library(SeuratObject) library(data.table) librar...
f8d7abd503cfef43be2a90851ef71754181054ee513fbeeb7a9a86e3e403a20f
R
21,437
481
####################################################################################################################################################################### #######################################################################################################################################################...
b89ed71b861869c97e847ffa2864b716a61b234ca2cec131dde1832ce37a6893
R
21,614
458
--- title: "Differential abundance testing with Milo - Mouse gastrulation example" author: - Emma Dann - Mike Morgan output: BiocStyle::html_document: toc_float: true BiocStyle::pdf_document: default package: miloR vignette: | %\VignetteIndexEntry{Differential abundance testing with Milo - Mouse gastrulat...
805c8916fc3c4a1bdfdbd38858949d4d3d291a97e5f69fc2cb398661e2c92dda
R
21,644
335
library(conflicted) library(haven) library(igraph) library(magrittr) conflicts_prefer(magrittr::extract) conflicts_prefer(magrittr::set_names) library(tidyverse) conflicts_prefer(dplyr::filter) ## This function executes the complete analysis of the dataset required to create version 2 of the WHO catalogue. ## If fast ...
c41aa58e3a6e45189dcfd40fbea384621c413d72cdf55de49b76ff2ccc3c6127
R
21,914
419
#spls analysis # Bioconductor install if (!requireNamespace("BiocManager", quietly = TRUE)){ install.packages("BiocManager") } # Install BiocParallel BiocManager::install("BiocParallel") BiocManager::install(update = TRUE) # over GitHub install.packages("devtools") # restart no devtools::install_github("mixOmics...
dfdc6d300a837f33352850f619d60d8dfe778e27d6fd2db3737f57f6467402af
R
22,114
503
--- title: "Normative Gameplay on the Pacman Task from Clinical/Nonclincal Set" output: html_document --- ```{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 d...
b3aa3cbe1591f0e62943c4a1abb224efd9c96f5e5de3cb541f2cea3cfe1a39c6
R
22,230
293
#' Quickstart for analyses in this pipeline #' #' all-in-one function that covers the vast majority of use-cases of analyzing a dataset imported into MS-DAP. #' (assuming you already loaded peptide data, sample metadata and fasta files using MS-DAP import functions). #' #' @section Filtering: #' #' Peptide filter crit...
cffde0016aa6b0bef51e37843eda4e9cf576d0e32449e365e8786a3a932dd8ff
R
22,518
450
################### ################### ################### ################### ################### ################### #Run this script for sensitivity analyses to reproduce Section S3.2 (Sex-Stratified Analyses) ################### ################### ################### ################### ################### ######...
16c21b579b1a1b69e48fb655f0807f050e80176dd41a36bce10d1bd51e1b5035
R
22,603
695
# power8.r Plot power spectra for 5 stacks, 8 class # Should have scale turned OFF for these! ALIGN_ON_STACK = 0 # 0 or stack number [-1]: align each stack MIMIC.ALIGN_ON_STACK = 0 # [>0]: rm class 1+5 in this stk [-1]: all stks # Values of -1 only work for FREQ_PLOT ALIGN_ON_UNIT = 0 # 0:ignore 1:align...
4a0695392b6bbe480e2b72f178f3aaf6bbd7436712d547fd0e22612f7bb13fac
R
22,618
491
--- title: "DEGs of scRNAseq results of mono- vs. co-culture" author: "Sara Danielli" output: html_document: toc: yes df_print: paged html_notebook: toc: yes toc_float: yes --- ```{r, setup, include = FALSE} library(knitr) opts_chunk$set( echo = TRUE, cache = TRUE, warning = FALSE, comment = FALS...
bd814616a49228d3544184df40a7cbbd0c4aa1282ed8d0ad1298f7a6fb2cf5e4
R
22,712
478
#' append file to path, then call file_check() for validation of the file. Does not validate illegal characters in the path #' #' returns a (potentially cleaned) file path #' #' @param path a directory on this computer. eg; "C:/temp" on windows or "/home/user1" on unix #' @param file filename that should be appended t...
bde86f753225f4b41ba8dc3720a3574c6d80922eed7d9c103044d5fd8c41916f
R
22,892
520
library(ggplot2) ## Make a bar graph to summarize proportion of clusters/programs/etc in each sample ## @para: x, x-axis data ## @para: y, y-axis data ## @para: x_order: order of x-axis variables ## @para: y_order: order of y-axis variables ## @para: col_names: column names for df for plotting ## @para: x_var: name of...
53d8aa9ac52489b11d15f92f18bda5c920f7a4702c37abac76bde29ee057d37f
R
22,926
515
################### ################### ################### ################### #Visualization ################### ################### ################### ################### bluegreen <- c("#261861", "#016DAB", "#03ABB1", "#6FCFB6") ################### #Main Paper Plots ################### #Figure 1: Standardized ...
4dfa0304928f88a7efb7215e7674c74565efcc08218d439d2c1024682138cc66
R
23,179
523
rm(list = ls()) library(DESeq2) library(pheatmap) library(RColorBrewer) library(org.Mm.eg.db) library(ggplot2) library(dplyr) library(tidyr) library(UpSetR) library(tibble) library(gridExtra) library(poolr) library(reshape2) library(WGCNA) library(PMCMRplus) library(readr) library("tidyr") library(ggplot2) library(tidy...
7f85a034927707a8b248a440b8fa8e421e3b3abe5854bec7a27ee5789547eef2
R
23,314
666
## PD library in flies paper ################################ ################################ # This file contains the functions needed to extract the sleep features used in Kaempf et al 2026 # The functions are organized in sections, which start with the header ## -- library(data.table) library(behavr) library(scopr...
afbfdebf52e54cf3c042ccfdda29bd591f751d99cf3591c15ced5420748cdb69
R
23,476
846
# ---- libs ---- library("arrow") # parquet files library("binom") # wilson confidence intervals for binomial counts library("foreach") # flexible looping and return amalgamation library("episensr") # misclassification error contingency table adjustments # library("simdata") # NORTA method to get correlat...
f78193058aaed61e93863a9a08e437b6f2d8162463f2cce0a199605a7acaac96
R
23,593
964
--- title: "Analyze Theta CCF" output: html_document date: "2025-02-04" --- ```{r setup, include=FALSE} ## libraries ## library(tidyverse) library(ggplot2) library(lmerTest) library(doParallel) library(parallel) library(foreach) library(here) library(fs) library(lmtest) library(scales) library(ggthemr) library(RColorB...