sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
478d1a4c815e0f1691bdcc16c25e6a42021876d478861c209c117890845ea4b3
R
7,329
234
longitudinal_l2_scopes <- function() { c("id_session", "id") } longitudinal_l3_input_modes <- function() { c( "per_session", "pooled_sessions_subject_ev", "subject_rows", "3dlmer" ) } normalize_l3_input_mode <- function(x, default = "per_session") { allowed <- longitudinal_l3_input_modes() ...
400e7988960f7dc3c15033b53b4def3ee328579c09356b32772ee63d5fe661bd
R
7,337
218
# get_all_coef_df <- function(dir, pattern=".*rt_rs.*RT", emt_number=1, trend_match="trend") { # coef_files <- list.files(dir, pattern=pattern, full.names = TRUE) # all_coef <- lapply(coef_files, function(x) { # df <- readRDS(x) # data <- df$emtrends_list[[paste0("emt_", emt_number)]] # dupe_names <-...
a3ee80a993d49364f9b76cbba077f1df4a894d9ecd85b7cd722bb16caa005210
R
7,340
125
#!/usr/bin/env Rscript # This script is intended for the generation of test data required for the mrcepid-runassociationtesting test suite. # Load necessary modules library(data.table) library(tidyverse) # Make sure we get reproducible results set.seed(1234) # Now we generate a set of files: # 1. A base coviarate ...
9572acf709c504e3734719ec7e97831ed2a6d501940e5215ca36c674e0616bf8
R
7,362
257
library(jsonlite) library(lme4) library(lattice) library(lmerTest) library(MuMIn) library(performance) library(rstudioapi) library(xtable) library(emmeans) library(car) library(tibble) library(dplyr) library(ggplot2) # ---------------------------------------------------------------------- # Configuration and data loa...
f8fcd5234b16148e7ef6e2c753f2e2c42c1f24a3613eeafa6bcb17249cad5a6e
R
7,386
197
#' This function generates syntax for FSL Feat .fsf files for the EVs tab of a first-level fMRI analysis. #' It accepts a numeric design matrix whose colum names correspond to individual EVs in the model #' #' This allows you to generate a design matrix dynamically based on a numeric matrix that has been #' setup in R ...
7764cdbb53f6f19caaa7987549acf10e643eb36e76e06eb9938178a4db2d1ed0
R
7,392
203
--- output: pdf_document params: ncells: 50 seed: 1337 nullsim: TRUE --- ```{r} library(dplyr) library(spASE) set.seed(params$seed) expit <- function(x) { return(exp(x)/(1+exp(x))) } ``` ```{r} # Slide-seq data # puck 4 needs to be rotated and shifted load('pucks.3-4.spatial.RData') puck3.spatial <- puck3.sp...
5b6fe801db9b1a4c54dd5622448dfffc9f9d06821f18074d62119b2b0c9b8805
R
7,403
130
## ---------- Script ----------------- ## ## Purpose: perform differential analysis on mouse rTg4510 ONT and Iso-Seq targeted datasets using linear regression ## Transcript level separate analysis ## Gene level separate analysis ## ## Author: Szi Kay Leung (S.K.Leung@exeter.ac.uk) # https://hbctraining.github.io/DGE_wo...
d4f4b793a81c0d3d2ad6a58994118c541036cabd95b9e22e13b0bd34c41c5777
R
7,411
181
#!/usr/bin/R # -------------------------------------------------------- # Calculate composition differences using binomial emmeans # Run contrasts on 2-level categorical vars, plot heatmap # of effect sizes (log2 OR) and adjusted p-values # # Here, we compare region differences in major cell types # Updated 12/20/2021 ...
e055d624dd16680bed6fb52a01958ec7c02b6106e5a5ad007950102b9d451fe1
R
7,417
174
hardAssignDonorAges <- function(inputCDS){ colData(inputCDS)$Age = 0 colData(inputCDS)$Age =ifelse(colData(inputCDS)$Donor == "W134", 43, colData(inputCDS)$Age) colData(inputCDS)$Age =ifelse(colData(inputCDS)$Donor == "W135", 60, colData(inputCDS)$Age) colData(inputCDS)$Age =ifelse(colData(inputCDS)$Donor == "...
e6240649629b753929d302f821a45765e9780bf3e0f57ab3360b63437e4f3c0e
R
7,434
214
#!/usr/bin/R # ------------------------------------------------- # Plot stats on DEGs with shared/specific profiles: # Updated: 06/23/23 # ------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(bindir, 'multiRegion/load_metadata.R')) library(tidyr) library(C...
0f6b75311dae37c98f40e971997c40fae3b1d035398f9c81a026ad1383b5724a
R
7,452
234
--- title: "006_KO_gastruloid" author: "Nobuhiko Hamazaki" date: "7/27/2022" output: html_document --- ```{r} library(dplyr) library(Seurat) library(patchwork) library(ggplot2) library(stringr) library(RColorBrewer) library(tidyseurat) library(cowplot) library(viridis) library(ggthemes) set.seed(seed = 0) my_theme_f...
5445344032e7ee10b8a5703ba00a07a1cc579f429bb9139f07b00d5490ae886e
R
7,465
197
--- title: "Basic Guide for NosaAnalysis" author: "Julia Thüringer" date: '`r Sys.Date()`' output: html_document: default pdf_document: null vignette: > %\VignetteIndexEntry{Basic Guide for NosaAnalysis} %\VignetteEngine{knitr::rmarkdown} \usepackage[utf8]{inputenc} --- ### Introduction Because all settings...
56b38fc3e6ad79792027f52c42fd52151e645a84db0e45baa7aa27b480d0852c
R
7,470
179
library(Libra) data <- qs::qread("C:/SynologyDrive/Projects/scRNAseqR/results/sakshi_4/NSM-NS-NC-M/NSM-NS-NC-M.qs") # SeuratObject::DefaultAssay(data) <- "RNA" SeuratObject::DefaultAssay(data) <- "RNA" comp_data <- data[, data$orig.ident %in% c("NS", "NC")] comp_data <- comp_data[, comp_data$mapmycells_supercluster ...
4a909926eda977e303c16b5cd7a7e0b4da538f6a30b0f13dc2224f3df92b9baf
R
7,492
251
test_that("deconvolve_reglin recovers a continuous latent signal", { set.seed(1001) kernel <- c(0, 0.25, 0.5, 0.2, 0.05) n_time <- 80L n_latent <- n_time + length(kernel) - 1L latent <- as.numeric(stats::arima.sim(model = list(ar = 0.6), n = n_latent)) bold <- fmri.pipeline:::decon_convolution_matrix(n_time...
3e35764281e8fb5082f94097ca9ba796e20906e20980e65be899d339c66ca4f7
R
7,495
229
# This shiny app displays forecasts produced by the code in this repo # Work in progress, especially the data loading part is not very efficient library(shiny) library(ggplot2) library(cowplot) # Set the working directory to the root directory of the project setwd("../..") source("R/setup.R") source("R/shinyforecasts...
47d3992b065074e1101ad5e029608ca21d7e071fd856f6e8f70bd2eab80e5584
R
7,503
269
# Function ------------------------------------------------------------------- .sample_h <- function(x, size, replace = FALSE, prob = NULL, index = FALSE) { validObject(x) if (missing(size)) size <- nrow(x) # normal default does not work! rows_i <- sample.int(nrow(x@data), size = size, replace = replace, p...
806adca6f708d6303992f94f0f043162059993d85705f899add360a35c0ce22b
R
7,511
246
--- title: "Correlation MPA and SF, W, CI Ctrl NTI Naloxone" author: "Yaromir Kobikov <kobikov.yaromir@gmail.com>" date: "Date: `r format(Sys.time(), '%d/%m/%Y')`" output: word_document: default html_document: toc: true toc_float: collapsed: false editor_options: chunk_output_type: inline --- ```{...
7f1aed7acd89b492913b027bdacce808042a9db9c1588b87156c3ace44d32044
R
7,514
236
#!/usr/bin/R # -------------------------------------------------- # Second part of metabolic modules figures # - Enrichments for modules # - Module scores heatmap # - Boxplots vs. e4 # Updated 04/04/2022 # -------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') if (!exists...
c8714b4e1db642c5e1e9c6627f7f404f9a8b15493dd60a3b93839fe5bad3aeb1
R
7,522
173
#' @title Function to obtain LASSO estimates of a regression problem given summary statistics #' and a reference panel #' #' @details A function to find the minimum of \eqn{\beta} in #' \deqn{f(\beta)=\beta'R\beta - 2\beta'r + 2\lambda||\beta||_1} #' where #' \deqn{R=(1-s)X'X/n + sI} #' is a shrunken correlation ma...
8b3891b95bd4239c13663f98bed1509bbd313cc3603614fa97927f76e23438b0
R
7,525
180
#' sccomp_predict #' #' @description This function replicates counts from a real-world dataset. #' #' @references #' S. Mangiola, A.J. Roth-Schulze, M. Trussart, E. Zozaya-Valdés, M. Ma, Z. Gao, A.F. Rubin, T.P. Speed, H. Shim, & A.T. Papenfuss, sccomp: Robust differential composition and variability analysis for singl...
4b7366a2d0cfd54c7a615a81749ebc414e41367eec595f8fb0d0abcd06e7b3a9
R
7,528
211
--- title: "Ptgds analysis" output: html_document --- This vignette replicates our results for Figure 4 (\textit{Ptgds} analysis) ```{r} library(ggplot2) library(tidyr) library(GenomicRanges) library(rtracklayer) library(reshape2) library(motifmatchr) library(GenomicFeatures) library(BSgenome.Mmusculus.UCSC.mm10) lib...
af152611757d58ed89119ceb43de51a011eb02348a1bd53da4b12d701224838d
R
7,529
186
library(data.table) library(stringr) library(boot) library(DescTools) set.seed(1) prs_file <- c("../../PRS-CS_KoGES_target/score_sum_ukb_excluded_indiv.profile.reformat", "../../PRS-CS_KoGES_target/individual_phenotypes/score_sum_indiv.profile.BMI.reformat", "../../PRS-CS_KoGES_target/indiv...
d111bc473e2b1f9eed7deb61dcfe63794a5eadb8361ff62b99ad3c4953429812
R
7,550
237
#!/usr/bin/R # --------------------------------------------------- # Calculate enrichments for the final aggregated DEGs # vs. the final modules (+ save resources for plots). # Updated 03/18/2021 to add plots for each module # --------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'mu...
513a00eaa2b4edf476e32efaf653261289587fd5049adf554a5e6f0c564a2de7
R
7,562
213
#' Convert principal component decomposition or the like into a `hyperSpec` object #' #' Decomposition of the spectra matrix is a common procedure in chemometric #' data analysis. `scores` and `loadings` convert the result matrices #' into new `hyperSpec` objects. #' #' Multivariate data are frequently decomposed by me...
7af7a2621a26bdfac8138c185c55d3a9e765a55c7052b37417f64d16f51e7396
R
7,580
174
test_that("BibTeX file is read in correctly", { path <- "zotero_export.bib" name <- "zotero_export.bib" df1 <- load_multi_search(path, name, "bib") df2 <- load_search(path, "bib") # Check columns expect_true(all(c("author", "year", "journal", "doi", "title", "pages", "volume", "number", "abstract", "record...
9fa7c5c91c8c97dfe7fe2bbfacb7d730b92c0fee994a5dc5db1f502c8ccd7e0d
R
7,582
219
#!/usr/bin/env Rscript # Performs ROC curve analysis to determine optimal GQ threshold ###Set master parameters options(stringsAsFactors=F,scipen=1000) svtypes <- c("DEL","DUP","INS","INV","CPX","BND") ########################### ###GENERAL HELPER FUNCTIONS ########################### #Read data & compute median a...
9c77b191974e54f89cab57cc5942ba64c589c3b4278af231dfa93d2da3f5cb97
R
7,593
176
library(dplyr) setwd("F:\\RNA_20221101\\02_ModifiedGenome\\C_POEgeneSelection\\figures_tables\\02_POE基因位置分布") input=c("F:\\RNA_20221101\\02_ModifiedGenome\\C_POEgeneSelection\\figures_tables\\02_POE基因位置分布\\data\\") ##pig chromosome length chr_bed <- read.table(paste0(input,"pig_karyotype.txt"), header = 1) #...
68692c03d0777d3b9d039720f3e34c67fd49110bf6a78c68bc86a408d5bdaea6
R
7,598
251
#!/usr/bin/R # --------------------------------------------------- # Get the metadata enrichments for external datasets: # Updated 12/01/2023 # --------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') if (!exists("cellmeta")){ source(paste0(sbindir, 'load_metadata.R'))...
e08a7eb53bd14fb9a1c5e1dc9cb7f80809a9b75982421968c28b633d06c36dbf
R
7,625
317
# Function ------------------------------------------------------------------- #' Convert `hyperSpec` object into a data frame or matrix #' #' @description #' [as.data.frame()] returns `x@data` (as data.frame). #' #' [as.matrix()] returns the spectra matrix `x@data$spc` as matrix. #' #' @name as.data.frame #' @rdname ...
ffd420c40e2b084e103209715dbd33ae925fc185fedaa038bff4d1f158870179
R
7,625
223
library(Seurat) library(dplyr) library(ggplot2) library(limma) library(muscat) library(purrr) library(scater) ########################################################################################################## # MCT setwd("G:/PFC_429_final_Spring2021/Data") pbmc=readRDS("Exc_merge_40_perc...
09c31768b68b13df443d7b8f9baf6035a6fec59036d103c77ae435175edc401a
R
7,652
184
#' --- #' title: "Extraction of Barcodes and gene fragments" #' author: "Tomas Bjorklund" #' output: #' pdf_document: #' highlight: tango #' geometry: margin=0.7in #' --- #' This workflow extracts barcodes and the gene fragments synthesized with the CustomArray using bbmap2. The fragments are then suitable for a...
48df3fde06877f163554f726fbc76e1c431b4874eb8bba43aa4a37aced1980d4
R
7,652
241
#!/usr/bin/R # ----------------------------------------------- # Plot some example genes with regional patterns: # Updated 06/21/2023 # ----------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') if (!exists("cellmeta")){ source(paste0(sbindir, 'load_metadata.R')) } source(p...
1cd53d517eb645ecbc10dc8048f976868ebdc124ea10e140c0bd8dc1c06916d5
R
7,661
200
--- title: "Hippocampus-V2 variants" output: html_document: df_print: paged --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` Here we make some plots of the C>U variants found in the hippocampus sample. For obtaining these variants we have: In each replicate: - Kept only variants with FDR...
1859a9cbefa9570ade0ed2d13d1ea7afad046859f58559c8cdf785347ad05710
R
7,664
238
#' @name DEPRECATED-read.txt.Shimadzu #' @concept moved to hySpc.read.txt #' #' @title (DEPRECATED) #' Read Shimadzu GCxGC-qMS - spectra files (`.txt`) #' #' @description #' #' These data input functions are **deprecated** and they will be removed in #' the next release of \pkg{hyperspec} package. #' Now functio...
e39fdc264815fa9f12768ecb22da1150284f1d8bf09f9b100d2abba2a2936c2c
R
7,690
150
## implemented and merged with sample_analysis NSM.data <- Seurat::Read10X(data.dir = "C:/SynologyDrive/Projects/scRNAseqR/data/samples/sakshi NGN2 microglia/NSM/filtered_feature_bc_matrix") M.data <- Seurat::Read10X(data.dir = "C:/SynologyDrive/Projects/scRNAseqR/data/samples/sakshi NGN2 microglia/M/filtered_feature...
be92837cf51138466e373f5f19e0480112c1fb8d7adc80f35c960a5f2a62ece4
R
7,697
215
library(lmerTest) # library(sjPlot) library(glmmTMB) library(ggplot2) library(dplyr) library(ggeffects) #ayestestR, parameters, pROC, sjstats, epiDisplay library(effects) library(readr) library(ggChernoff) library(merTools) library(lattice) # library(epiR) # library(epicalc) # library(pROC) # library(lattice) library(...
ed5d1033f35aaa24a3685ce74f07026179c17f8cdd7a5e67493d19e9f3e11c92
R
7,711
198
# Load the required libraries library(ggplot2) library(dplyr) # Read the CSV file data <- read.csv("tsnrvals.csv") data_stan <- read.csv("tsnrvals.csv") # Read the file containing the list of subjects for the new flip angle new_flip_angle_subs <- read.csv("newflip.csv", header = TRUE) # Create a new column in data i...
b418f12fd847a73d522b1c3f44c5e105ac1edd900b3e48550bc9e064149dc61f
R
7,721
205
#!/usr/bin/env Rscript # Talkowski SV pipeline downstream analysis helper script # Identify variants with unstable frequencies before/after minGQ ### Set global parameters options(stringsAsFactors=F, scipen=10) ### Import pre-minGQ frequency data load.preMinGQ.freqs.PCRMINUS_only <- function(pre.freqs.PCRMINUS.i...
e13f404219d41347b34e95ea034ed6bceffae9e90493683cb64eb367488478b6
R
7,721
262
--- title: "dartseq replicates of mice hippocampus" output: html_document: self_contained: false --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` In this document we show the variant count per sample, and the variant relationship between dart-seq replicates of mice hippocampus. #### WT, ...
c2b945df98fdc83196dfe4e2d03ff0c363a66573e5fd25d3dfafa64e173790c4
R
7,750
133
#functions for processing data after RCTD is fit to the data # Collects RCTD results gather_results <- function(RCTD, results) { cell_type_names = RCTD@cell_type_info$renorm[[2]] barcodes <- colnames(RCTD@spatialRNA@counts) N <- length(results) weights = Matrix(0, nrow = N, ncol = length(cell_type_names)) we...
a800ffd691dda86ce07661723a00d584da371f45e8a6502534e0ef8640e48760
R
7,758
208
######################## ######### Input ######## ######################## # *obj: Refers to Seurat object # *gene_list: A list with multiple gene sets to run GSVA algorithm on # *split_loc: Boolean which refers whether the algorithm will run on 2 levels of pseudo-bulking # ie (pseudo-bulking cells from the same donor...
21a0502aa88a5787917001e2fcd4a34c45e89eaa34e115c7548c943f1e8dd112
R
7,772
198
# ************ # 2d-roundtwo.r # Another round of integrating data, following removal of contaminating cell clusters source("Analysis/util.r") library(Seurat) library(data.table) library(magrittr) library(dplyr) library(ggplot2) # -------------- Removal of contaming subclusters ----------------- #re <- readRDS('Result...
b14cb0fca324f51aca094b2c5a0156ffef411effef434ac224eccd343a9d9517
R
7,779
211
is_l2_passthrough_estimable <- function(dmat, cmat, tol = sqrt(.Machine$double.eps)) { if (checkmate::test_data_frame(dmat)) dmat <- as.matrix(dmat) if (checkmate::test_data_frame(cmat)) cmat <- as.matrix(cmat) if (!is.null(cmat) && !is.matrix(cmat)) { cmat <- matrix(as.numeric(cmat), nrow = 1L) } is.mat...
6bf285ea4b23bf0db38dfbd2fb6e3545073db208febe113186559899cff2214d
R
7,784
198
require(arrow) require(plyr) require(dplyr) require(stringr) require(tidyr) require(data.table) phenotype_suffix = snakemake@params[["phenotype_suffix"]] #TODO delete this later code_dir = snakemake@params[["code_dir"]] out_path = snakemake@output[["out_path"]] query_phenotypes = snakemake@params[["phenotypes"]] corr...
ef2bcc76b01c46c2f92a9238d518522fd9a461641e8d5e9fd887f880ffe489d3
R
7,795
180
#relationship between methylation and expression of tissues-specific gene library(dplyr) library(ggplot2) library(magrittr) library(ggtext) library(ggpubr) dataExp <- read.csv("F:\\RNA\\RawTables\\OriginalRef\\GeneCountMatrix.tpmUnit.csv", header=T, row.names=1) %>% select(., contains("70")) feature <- c("...
a286c8c8b9219038f90b3a6045e4bc1413dedbf0a065470d36d6ee18f616c739
R
7,805
205
library(tibble) #### Phenotype Names #### monti_staar_name_dict = c('new_phenotypes' = '_new_phenotypes', 'all_phenotypes' = '_all_phenotypes', 'training_phenotypes' = '_training_phenotypes') phenotype_renamer = c('WHR Body mass index BMI corrected' = 'WHR', ...
e7bd197c925d9e98a0a13ec96d4dee00aee4db36a8c58d9157255613ee70793f
R
7,805
228
--- title: "005_LDN" author: "Nobuhiko Hamazaki" date: "7/15/2022" output: html_document --- ```{r} library(dplyr) library(Seurat) library(patchwork) library(ggplot2) library(stringr) library(RColorBrewer) library(tidyseurat) library(cowplot) library(Signac) library(viridis) library(ggthemes) library(networkD3) set.s...
1ed52817276ac82397f47588572efbe3ee9ab6d879a9a7675f142638a51be19d
R
7,809
223
#!/usr/bin/R # -------------------------------------------------------------- # Nebula as in minimal example, but using the precomp. matrices: # Updated: 10/31/23 to add interaction # -------------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(sbindir...
3e389c1ca9fdaec9dd861d0a0bca4b97cad804ccf6aa5b1f20335b7753f410bc
R
7,812
308
# Function ------------------------------------------------------------------- #' Get index #' #' `.getindex()` does the actual work of looking up the index for `wl2i()`, #' `.extract()` and `.replace()`. #' #' @param x `hyperSpec` object. #' @param wavelength Wavelength values. #' @param extrapolate (logical): #' -...
baeb9a148fe594906165fed4892c8a6732eb5f6f50d123b702b957681a321fe4
R
7,822
245
#!/usr/bin/R # ----------------------- # Nebula minimal example: # ----------------------- library(cbrbase) set_proj('DEVTRAJ') source(paste0(bindir, 'multiRegion/load_metadata.R')) library(tidyr) library(Matrix) # For nebula: library(nebula) library(DESeq2) library(RUVSeq) library(qvalue) # For plotting library(gg...
6383704eca7c0f2ea0e0c838d0c0036090459d9fdb5835c8d8a6e78e15322b94
R
7,832
275
#### Projection to latent structures #### ## -------------------------------------- setMethod("PLS", "ANY", function(x, y, ncomp = 3, method = c("nipals", "simpls", "kernel1", "kernel2"), center = TRUE, scale = FALSE, bags = NULL, verbose = getCardinalVerbose(), chunkopts = list(), BPPARAM = getCardinalBPPA...
293c2bec5a1039233181ba0bd28a9390d00c85336c3a922aaa03537ebf609daa
R
7,837
245
#load the packages library(edgeR) library(DESeq2) library(limma) library(org.Hs.eg.db) library(tximport) library(csaw) library(readr) library(ggplot2) library(ggrepel) library(WGCNA) library(ggpubr) library(bestNormalize) library(ComplexHeatmap) library(reshape2) library(tidyverse) library(caret) library(MASS) library(...
7db21e75ce3995191dfbadb3677c00c7e973ed3d4019e688850843ecbf75aa84
R
7,850
197
require(arrow) require(plyr) require(dplyr) require(stringr) require(tidyr) require(ggplot2) require(data.table) phenotype_suffix = snakemake@params[["phenotype_suffix"]] #TODO delete this later masks = snakemake@params[["masks"]] code_dir = snakemake@params[["code_dir"]] out_path = snakemake@output[["out_path"]] qu...
2300328c07f552f4bbd08c821265d2cef8c83f6dae1591d78a1b22db3b512cb2
R
7,869
239
# Preprocessing and QC of DS2 raw data # input : # data_raw/02_DS2_raw_ssce.Rdata # output: # data/02_DS2_DblFinder.Rdata : computed scDblFinder doublet detection results # data/02_DS2.ssce.Rdata : QC filtered, logNormalized dataset # data/02_DS2.ssce.MKNN40.Rdata : igraph k=40 MKNN graph # data/...
62caad5eaf0faa518d6f24f563bca3f4ecfd261f1fbe660fca343d23e7f8e612
R
7,875
230
#!/usr/bin/R # -------------------------------------- # Comparison of published with own DEGs: # - regional DEGs in this analysis # Updated: 07/27/23 # -------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(bindir, 'multiRegion/load_metadata.R')) library(tidyr) library...
23f8b2a8aeb8d292b1be14edd51241c98634dc8709b17ea994291602ae37f4bd
R
7,892
230
library(Seurat) library(dplyr) library(ggplot2) library(limma) library(muscat) library(purrr) library(scater) ########################################################################################################## # MCT setwd("G:/PFC_429_final_Spring2021/Data") pbmc=readRDS("Exc_merge_40_percent_fi...
19e734f2dd878165f0ced807d7d850747b449ac417dbc43367ac412337b1badc
R
7,893
170
#' Identify the last valid volume acquired in a given run. #' Subjects often exhibit head movement after run ends (MATLAB closes), but scan hasn't stopped #' This occurs because the MB raw transfer of the prior run is occurring, but does not finish before the current run #' Thus, truncate mr files to be 12 seconds afte...
6d58e903337530b2bf6e78c42f0729b86fa8f81cd94ad82d420f478f34c0a98b
R
7,902
239
#' Sets Precomputed Probabiliites as Global Variable #' #' Given a matrix, \code{Q_mat}, or log P(y|x), under the Poisson-Lognormal model. #' Sets this as a global variable for fast computations in the future. #' #' @param Q_mat_loc Matrix of precomputed probabiliites, as previously computed by \code{\link{get_Q_mat}} ...
864e30b3ae01a3ea3d32f0e60531cea7a181e9d5e91a6240dabb20f6e6c085ed
R
7,943
169
#' Generate a ggplot2 heatmap with row and column dendrograms #' #' @param dataMatrix A data.frame containing the input data. #' @param orderCol Reorder the columns (default=T) #' @param orderRow Reorder the rows (default=T) #' @param dendroLineSize Size of the dendrogram lines (default=0.5) #' @param fontsize Font siz...
7ba038aae3950838256764b6a6630e97c377a008a41d22f64779ca54a114f216
R
7,955
212
library(tidyr) library(ggplot2) library(glmnet) library(ROCR) library(data.table) library(monocle3) library(gridExtra) library(RColorBrewer) # Get shared functions between this and runRegressionModel.R source("./utilityFunctions.R") source("/net/trapnell/vol1/home/readdf/trapLabDir/sharedProjectCode/utility/singleC...
84b3ec050d49d1d01a59275182233ff0ffb7f77f920d9dea30ac2d25456f000a
R
7,957
210
#!/usr/bin/R # --------------------------------------------------------------- # Score cells in the entorhinal cortex using the consistent DEGs: # Updated: 12/06/2021 # --------------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(sbindir, 'load_metada...
04d2bf7a3e265e79bed94ed76ea366e24e1bb6b3b504216065c487dcdca43c02
R
7,978
198
#!/usr/bin/R # -------------------------------------------------- # Aggregate the DE results across different methods: # Methods: Nebula, MAST, Wilcoxon (cell + ind-level) # Updated: 11/15/23 # -------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(bindir, '...
665869137b699b77cf81c15701413e7924e92141c04e437a1ae9d0277e877fc0
R
7,980
251
# Get functions library(monocle3) source("/net/trapnell/vol1/home/readdf/trapLabDir/sharedProjectCode/utility/singleCellUtilFuncs.R") # modStatus <- loadMonoclePackages() library(tidyr) library(ggplot2) # Note: Need bedtools loaded for this! bedtools/2.29.2 library(cicero) library("optparse") # Get the passed paramet...
3d1edd8b90c0e0785c9d60317d25455d222996ee4a3c4cb9b479b8ed0b00dba1
R
7,981
186
--- title: "Penn Machine Learning Benchmarks" --- Penn Machine Learning Benchmarks (PMLB) is a large collection of curated benchmark datasets for evaluating and comparing supervised machine learning algorithms. These datasets cover a broad range of applications including binary/multi-class classification and regressi...
91784d9e75f537efbd59ae408fc1bd325ecfb2f4546e7d6b7e27b1eefb6ee118
R
8,009
220
#!/usr/bin/R # ------------------------------------------ # Load metadata for the multiregion project: # ------------------------------------------ library(cbrbase) library(RColorBrewer) library(tidyr) set_proj('DEVTRAJ') # Arguments: args = commandArgs() if (length(args) > 0){ project = args[1] } else { proj...
1c048a3bc61ca9673271a14b48420b9fd89938a9e486af1f330c6f13c397a92e
R
8,012
280
#### SpectraArrays #### ## -------------------- # Similar to Assays class from SummarizedExperiment # but allows 1-dimensional array and list elements # and requires spectra to have unique array names .valid_SpectraArrays <- function(object) { errors <- NULL arrays <- try(as(object, "SimpleList"), silent=TRUE) if...
0fcfd7911189f9eaf1eaf7a2f4ba5d6ff17ce0183d7452da2cf054337f2ab988
R
8,020
214
#!/usr/bin/R # --------------------------------------------- # Functions to load data at a pseudobulk level: # Averaged at level of subtype + individual + region # Updated 12/01/21 # --------------------------------------------- library(cbrbase) library(Matrix) set_proj('DEVTRAJ', 'multiRegion') if (!exists("cellmeta")...
b1c458c254708116ecf5b289f605f00dc7b77bf69d955425b4e3e04f3492076e
R
8,027
275
#!/usr/bin/R # ---------------------------------------------------------- # Calculate the cross-ct module correlations and thresholds: # Updated 11/30/2021 # ---------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') if (!exists("cellmeta")){ source(paste0(sbindir...
8515ad43075b7b4a1e78b54b8fd8a9df0fa54fcafb1c6018ad7a706cdef98124
R
8,030
178
#' R6 class for running 3dFWHMx on a group of input files using a scheduler/cluster #' #' @importFrom R6 R6Class #' @export afni_3dfwhmx_list <- R6::R6Class("afni_3dfwhmx_list", private = list( fwhmx_batch = NULL, # batch object wall_time = "10:00:00", # 10 hours default for all jobs fwhmx_objs = list(), ...
e0b0ab972ab054f24abac56905969146db278b03414a1b5edbab08b099e1094b
R
8,035
203
wd <- "~/projects/chimp_human_opnmf/" setwd(wd) # load in libraries needed for script # # need to install pacman if not already installed if (!require("pacman")) install.packages("pacman") pacman::p_load(fs, ggplot2, dplyr, tidyr, reshape2, readr, broom, tibble, MASS, sfsmisc, cocor, oro.nifti, neuroba...
7f62e6648cb2fa90b19f7e59a7fe1c5e09a9427148cf964e876537655c605a8e
R
8,048
217
--- title: "01_data_cleaning" author: "Veronica Mandelli" date: "2/3/2022" output: html_document --- # set paths ```{r} work_dir = "..." # main folder codepath = file.path(work_dir,"code") datapath = file.path(work_dir,"results","data_wrangling_output") # path of data already extracted from NDA database resultpath = f...
0b5412be2c05a596d7ae8ce912e4df9b5fdca830dbcf572ced362924f931fb99
R
8,052
228
#!/usr/bin/R # --------------------------------------------------------- # Replot the DEG enrichment table from the modules package: # Updated 11/27/2021 # --------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') if (!exists("cellmeta")){ source(paste0(sbindir, '...
27dd52af564b23d5464022f45b4cb461d96e7cff8ef852db4311947a0d2bae68
R
8,067
305
--- title: "Correlation MPA and SF, W, CI" author: "Yaromir Kobikov <kobikov.yaromir@gmail.com>" date: "Date: `r format(Sys.time(), '%d/%m/%Y')`" output: word_document: default html_document: toc: true toc_float: collapsed: false editor_options: chunk_output_type: inline --- ```{r setup, include=F...
010295162d6297ea3d002cf2383161dafdd268f89163c25bc26687eefcf539f2
R
8,073
171
Auc_Analyser = setRefClass( "Auc_Analyser", contains = "Analyser", methods = list(initialize = function() { callSuper( description = "For each time point (stimulus) and sample, the time of the maximum value is found within a PeakSearchWindow in order to subsequently calculate the area unde...
fd98cee88c21aecbedf12f745802fc9461e3251df9dc9aad7d4aa496736381b1
R
8,090
155
## ---------- Script ----------------- ## ## Purpose: perform differential analysis on mouse rTg4510 ONT targeted datasets using linear regression ## Transcript level - Iso-Seq, RNA-Seq (hybrid, already aligned to Iso-Seq) ## Gene level - Iso-Seq, RNA-Seq ## 1/ run DESeq2 (Wald and LRT) ## 2/ annotate results using cla...
7a5c3ba18489b6208548d244cba2b872d3d8c9f6571d3b744179ca448b05d6ab
R
8,094
252
#### Spectral binning #### ## -------------------------- # MSImagingExperiment setMethod("bin", "MSImagingExperiment", function(x, ref, spectra = "intensity", index = "mz", method = c("sum", "mean", "max", "min", "linear", "cubic", "gaussian", "lanczos"), resolution = NA, tolerance = NA, units = c("ppm", "...
7423314e4d4df6b14432f47901c365d5a5436b92ba0ed672c04735ca40f03ac6
R
8,099
180
get_means_sds <- function(cell_type, gene, de_results_list, params_to_test) { de_results <- de_results_list[[1]] ct_ind <- which(colnames(de_results$gene_fits$mean_val) == cell_type) L <- dim(de_results$gene_fits$s_mat)[2] / dim(de_results$gene_fits$mean_val)[2] ct_ind <- L*(ct_ind - 1) + params_to_test means...
f6aecbeb7388dcc31d356e94574720bd852c4de935d1a5ce69ccdcd832db54bf
R
8,126
162
hardAssignAnatomicalSites <- function(inputCDS){ colData(inputCDS)$Anatomical_Site = "Not_Specified" colData(inputCDS)$Anatomical_Site = ifelse(grepl("Apex", colData(inputCDS)$sample), "Apex", colData(inputCDS)$Anatomical_Site) colData(inputCDS)$Anatomical_Site = ifelse(grepl("Septum", colData(inpu...
e4ad8def51481284555ad315cdb07827ff6c9ba23a8db68a423306a994cbd86d
R
8,127
248
fsl_do_convolve_reference <- function(input, kernel, phase = 0L, renorm = TRUE) { n_input <- length(input) n_kernel <- length(kernel) output <- rep(0, n_input) for (t in seq.int(0L, n_input - 1L)) { kernel_norm <- 0 i_start <- max(0L, 1L + t + phase - n_input) i_end <- min(n_kernel, t + phase + 1L)...
0806a187909b8795279fd94a15a9e6def6d381fcbe28d7c6cfc449b8f403e363
R
8,139
190
#' archstabms__window_library_design #' #' Saturation combinatorial mutagenesis library design. #' #' @param fitness_abundance_file path to abundance fitness data (required) #' @param pdb_file path to PDB file (required) #' @param pdb_chain_query query chain id (default:A) #' @param pdb_chain_target target chain id (d...
cfe9bbbea4d376bce806853d42aded8eeb0a14aba776957796c3d9926916ab2b
R
8,171
189
library(data.table) library(dplyr) library(survival) library(survminer) library(broom) source("00_read_prs.R") dir_out.coxph.tab <- "./coxph_PRS_table/" dir.create(file.path(dir_out.coxph.tab), showWarnings = FALSE) ######### file.df_merged <- "dataframe.coxph_survival_input.rds" if (file.exists(file.df_merged)){ ...
590f0ecb07a1858dcf990f75c94804368efdd83d340bf5ab30e043b4020ef90b
R
8,181
212
--- title: "Bin1 Integration" author: "Szi Kay Leung" date: "`r Sys.Date()`" output: html_document: toc: true toc_float: true code_folding: hide --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) # libraries suppressMessages(library("ggrepel")) # output directory output <- "/gpfs/mrc0...
3ab3fa4efc534fd714158e028d3cf06303286cb9b13efe7bdfa3923a35baf4e1
R
8,190
228
library(tidyr) library(ggplot2) library(glmnet) library("optparse") # Get the passed parameters option_list = list( make_option(c("-p", "--pValFIMOcutoff"), type="numeric", default=1e-5, help="Max FIMO p value to retain match", metavar="character"), make_option(c("-f", "--feature...
bcd6550b51f954678d0cb4039dfa0962220029c090d77624d33e655b1c3b3434
R
8,203
238
# Get functions library(monocle3) source("/net/trapnell/vol1/home/readdf/trapLabDir/sharedProjectCode/utility/singleCellUtilFuncs.R") # modStatus <- loadMonoclePackages() library(tidyr) library(ggplot2) # Note: Need bedtools loaded for this! bedtools/2.29.2 library(cicero) library("optparse") # Get the passed paramet...
4f0c5967e98ffdf1c60a131df00288a14062190c037b319b21a84a34331780c4
R
8,207
238
# Get functions library(monocle3) source("/net/trapnell/vol1/home/readdf/trapLabDir/sharedProjectCode/utility/singleCellUtilFuncs.R") # modStatus <- loadMonoclePackages() library(tidyr) library(ggplot2) # Note: Need bedtools loaded for this! bedtools/2.29.2 library(cicero) library("optparse") # Get the passed paramet...
c4267490e2e80c678b6349a4c3153fbe8af872da6e3ff977a17bb5ece523639a
R
8,217
180
#' Populates parcel-wise statistics from an atlas or set of clusters back into NIfTIs in the original space #' #' @param atlas_nifti The filename of the NIfTI image containing atlas values to match against \code{stat_dt} #' @param stat_dt a \code{data.table} object containing the statistics to write to parcels in the ...
50bf02f6369ef5daa024f1eccd5ce4893d11e763bb3e1a9605f4032654eaf44c
R
8,243
200
--- title: "1-4xLPS_MicrogliaMorphology" author: "Jenn Kim" date: "06/11/2023" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` # load packages and set seed ```{r} library(MicrogliaMorphologyR) library(factoextra) library(ppclust) set.seed(1) ``` # read in data ```{r} dat...
77e4ff4c585259bec90a94d502f9cb9eaa68ca212444377dd9386ea6405b548e
R
8,264
213
# Relative phase data and analyses library(ggplot2) library(ggpubr) library(bpnreg) library(openxlsx) library(emmeans) # Read in experimental data dat = data.table::fread("your path/All_Hand_Position_Data.csv") dat2 = dat[!dat$id %in% c('S010', 'S011','S012', 'S018', 'S019'),] # Removing subjects who did ...
827e15655b3844d6614363f74165035247945d6314340cd36f84eb86962245b6
R
8,268
154
#' archstabms__plot_validation_scatter #' #' Plot correlation with validation data. #' #' @param input_dt data.table with model free energy estimates (required) #' @param lit_inpath path to literature free energies (required) #' @param report_outpath output path for scatterplots (required) #' @param highlight_colour c...
f8b216de69b645a4451d7ada1514a5772fc8affbff5dd8d994b53fde65bd1578
R
8,276
215
#!/usr/bin/env Rscript # Talkowski SV pipeline downstream analysis helper script # Identify variants with unstable frequencies before/after minGQ ### Set global parameters options(stringsAsFactors=F, scipen=10) ### Import pre-minGQ frequency data load.preMinGQ.freqs <- function(pre.freqs.PCRPLUS.in, pre.freqs.PCR...
d0278ddb47e2f1caa6a81d709810d695e2f2751b7a071b9fc7a468f2d3b39712
R
8,303
180
#' spacexr: an R package for assigning cell types and cell type specific differential expression to spatial transcriptomics data. #' #' @section Running RCTD: #' #' To get started, create a \code{\linkS4class{SpatialRNA}} object (called \code{puck} here) for the #' spatial transcriptomics data and a \code{\linkS4class{...
9522cfb024a870dcf61e98fb40a4ab3111c28f4ae512d11e3a52cfd991ffb1d8
R
8,336
181
#' This function reads an SPM.mat file and generate contrasts based on the design matrix specification #' #' @param output_dir location for SPM outputs and scripts for estimating contrasts. Must contain SPM.mat already #' @param condition_contrasts see generate_spm_mat #' @param unit_contrasts see generate_spm_mat #' @...
142ef2254cc9ee79f2179b3de178dcbe4791a094a6b72f8edd35c9a3d6bf3c01
R
8,339
165
library(dplyr) library(pbapply) library(data.table) library(plyr) library(broom) Mathys_DA <- read.table(file = "Mathys_DA_path.csv", sep = ",", header = TRUE) Mathys_DA$CD83_status <- ifelse(test = Mathys_DA$DA4 > 0, yes = "CD83_pos", no = "CD83_neg") Fujita_DA <- read.table(file = "Fujita_DA_path.csv", sep = ",", ...
92982169153418a7230068860ed6808a6af699790ff28098336c684a2ad794ed
R
8,341
207
wd <- "~/projects/chimp_human_opnmf/" setwd(wd) # load in libraries needed for script # # need to install pacman if not already installed if (!require("pacman")) install.packages("pacman") pacman::p_load(fs, ggplot2, dplyr, tidyr, reshape2, readr, broom, tibble, MASS, sfsmisc, cocor, oro.nifti, neuroba...
2130de7cdd166f12b0d3fb7e99653d741406292d0c21de70b359e6f7237ca441
R
8,343
207
wd <- "~/projects/chimp_human_opnmf/" setwd(wd) # load in libraries needed for script # # need to install pacman if not already installed if (!require("pacman")) install.packages("pacman") pacman::p_load(fs, ggplot2, dplyr, tidyr, reshape2, readr, broom, tibble, MASS, sfsmisc, cocor, oro.nifti, neuroba...
c07831a19c9c17e1e8a2404983de21db32f38767e7d44c908ac63c2bc01d1ce5
R
8,355
223
library(ggplot2) library(dplyr) library("optparse") library(stringr) library(tidyr) library(tidyverse) print("Libraries loaded, starting now") monocle_theme_opts <- function() { theme(strip.background = element_rect(colour = 'white', fill = 'white')) + theme(panel.border = element_blank()) + ...
9bb30107d6da095a5ca3f4e5d905e836f0d6dc3a543ffcac31cf62efd7fa4de2
R
8,369
188
validate.lassosum.pipeline <- function(ls.pipeline, test.bfile=NULL, keep=NULL, remove=NULL, pheno=NULL, covar=NULL, validate.function=function(x, y) cor(x, y, use="complete"), ...
66d6a210083212ae17c1007291e1524fc2eb9fafd688dba17227bec5e6c86463
R
8,371
223
library(testthat) test_that("afni_3dlmer_setup builds 3dLMEr tables from refit model covariates", { tmp_dir <- tempfile("afni_3dlmer_setup_") dir.create(tmp_dir, recursive = TRUE) mask_file <- file.path(tmp_dir, "mask.nii.gz") file.create(mask_file) harvested <- list( l3_model1 = list( contrast1 ...
07d93c277864a001454c73c03fddb8207ee12aba47525c9c7c66ee4c1ef807e6
R
8,394
168
library(ggplot2) library(dplyr) library(readr) library(stringr) library(viridis) library(tidyr) library(ggrepel) options(stringsAsFactors=FALSE) # 9-13-21 David: Adding command line parser so I can specify the hyperparameter set used and use that to define input files/output names library(optparse) # Get the passed p...
49d3522c7299a97b36bcc49a15f1633bfc3edf4f747d78e62c77b38532b2c5f2
R
8,400
284
# For the specified k, for pairs of cognitive and network reconfiguration variables, # conduct bivariate normality tests, plot scatterplots, and plot QQ plots. # Output: # binormtest_p.csv Bivariate normality test p-values for variable pairs. # binormtest_pthres.csv Bivariate normality test p-values for significant la...