sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
032e792d55d02ff87573485e25d2dd33adaad6d3726df63db52ddb1665dc011a
R
17,760
418
#################################################################################################### ### ### File: 00_source.R ### Purpose: Load required packages and functions used to ### create interactive maps. ### Authors: Gabriel Rodrigues Palma ### Date: 05/04/23 ### ##############################...
712142b4551880bcd6701f0db2f7b2884cca01ea53aa21564502fe1416bd87ed
R
17,761
362
#' This function submits a single script to a high-performance cluster using a scheduler (Slurm or TORQUE). #' It accepts a vector of arguments to be passed to the scheduler and #' a vector of environment variables that should be passed to the compute node at job execution. #' #' The function returns the jobid of t...
abcbe3c9f9ce6e5a5b7173582113b8e80c5db587539756dd11170cff48ed3ad4
R
17,769
531
#!/usr/bin/R # --------------------------------------- # Differential expression for astrocytes: # Updated: 05/25/21 # --------------------------------------- # Aggregate number of sign. genes: library(cbrbase) set_proj('DEVTRAJ') source(paste0(bindir, 'multiRegion/load_metadata.R')) library(tidyr) library(Matrix) lib...
fc4ee801edd2b80f03242b28851d88d77a4ed078b35346f161d0da816f874db9
R
17,803
440
library(knitr) if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install("ALDEx2") library(ALDEx2) install.packages("devtools") library(devtools) install_github("ggloor/CoDaSeq/CoDaSeq") library(CoDaSeq) library(zCompositions) library(igraph) library(car) ...
8533a967ec93d2a942c7773d73325c58a70f6944848b6727cb2f45d1e7c75d88
R
17,819
531
# Behavioral tests for the FLAME outlier auto-retry mechanism. # # These tests exercise the actual bash and R logic rather than grepping source # code for string patterns. if (identical(.Platform$OS.type, "windows")) { test_that("outlier retry behavioral tests require POSIX shell semantics", { skip("requires exe...
d23b813e90fe3f8b2e7907e928c2e56b65876db574a6f76b653d5fea35b19d68
R
17,851
402
# SCRIPT INFORMATION: # SCRIPT: DETECT NEURAL SEQUENCES IN TASK BY MODELLING # PROJECT: FMRIREPLAY # WRITTEN BY LENNART WITTKUHN, 2018 - 2019 # REVISED BY QI HUANG 2022 # CONTACT: STATE KEY LABORATORY OF COGNITIVE NEUROSCIENCE AND LEARNING, BEIJING NORMAL UNIVERSITY ## Decoding on slow trials ### Initialization We ...
894ce44e40c5f7302291f81109a4884afd61c0a4fce948aff3ec6afb3136e901
R
17,856
532
library(corrplot) library(dplyr) library(RColorBrewer) setwd("F:/Brain_region_project/Module_scores_DEGs/Module_scores_PFC427DEGs/Results") data=read.csv("Ast_metadata.csv") colnames(data) library(ggplot2) ###################################################################### ###########################...
cfa8132ce9ceacbbbaffd67e1692e72e65538425bc9b7b6fa7ce2d765b5f14ab
R
17,857
486
# Familywise-error correction specifications fwe_spec_schema_version <- function() 1L fwe_target_fields <- function(level = 3L) { if (!identical(as.integer(level), 3L)) { stop("FWE specifications currently support level = 3 only.", call. = FALSE) } c( "session", "l1_model", "l1_cope_number", "l1_co...
7d9741f3cec0610ac380733e5d7768914cd687b9c4b4d21612551cfeab0e77c3
R
17,876
602
# Function ------------------------------------------------------------------- #' @title Collapse/bind several `hyperSpec` objects into one object #' @description #' The spectra from all objects will be put into one object. #' The resulting object has all wavelengths that occur in any of the input #' objects, `wl.tole...
93743efc1c6bad813793e7d56c06aa45b12a3151ce0f2530da619f4d368a136a
R
17,953
610
#### Model-based testing of sample means #### ## ------------------------------------------- setMethod("meansTest", "ANY", function(x, data, fixed, random, samples, response = "y", reduced = ~ 1, byrow = FALSE, use_lmer = FALSE, na.rm = TRUE, verbose = getCardinalVerbose(), chunkopts = list(), BPPARAM = getC...
f2fe03f55aa2501cfa8386afcc67dd0fa4e2fb55f326a81c3e6e72482e532e9e
R
17,967
472
--- title: "Reproduciblity technical replicates" output: html_notebook --- ```{r} library(SingleCellExperiment);library(tidyverse);library(reticulate);library(tidyverse) library(ggplot2);library(scmap);library(fmsb);library(ggsci);library(scibet) library(Seurat);library(M3Drop);library(ROCR);library(cluster);library(p...
69b5b52e1f6effe030b43679aaf800c6747006cb3e1d957441d120af9147efa4
R
18,012
525
#make heatmaps for luminex data #1/30/2020 Annie Ciernia library(tidyverse) library(xlsx) library(ComplexHeatmap) library(dendsort) library(cowplot) theme_set(theme_cowplot()) library(ggpubr) library(rstatix) library(car) library(broom) #################################################################################...
ab32996ad9da3d3b95572022cbae20cd0504b75e01b6ad26664517a8982cbc61
R
18,015
522
#' @importFrom readr write_file fit_model = function( data_for_model, model_name, censoring_iteration = 1, cores = detectCores(), quantile = 0.95, warmup_samples = 300, approximate_posterior_inference = NULL, inference_method, verbose = TRUE, seed , pars = c("beta", "alpha", "prec_sd", "prec_intercept_1", "...
90df4bdad858f244c3b66b4d4333c0adf4fec015d9f231c647c7ba5a79601fe8
R
18,026
393
## ---------- Script ----------------- ## ## Script name: ## ## Purpose of script: ## ## Author: Szi Kay Leung ## ## Email: S.K.Leung@exeter.ac.uk ## ## ---------- Notes ----------------- ## ## ## ## ## ## ---------- Packages ----------------- suppressMessages(library(readxl)) suppressMessages(library(dplyr)) ...
4f52a2716c4060fc411fb695b887d691df6fcce9b5df67bcf2fb137b95c4eef3
R
18,028
442
vanilla_encoder <- nn_module( "Encoder", initialize = function(vae_dim, n_batch, n_covariate) { self$n_layers = length(vae_dim) self$layers <- nn_module_list() self$layers[[1]] <- nn_linear(vae_dim[1] + n_batch + n_covariate, vae_dim[2]) if (self$n_layers > 3) { for (i in 2:(self$n_layers...
2174e099593ada8e5b59cef18bbbf2fac33ef3952d38dbde023cd8bd2dd28801
R
18,100
509
#!/usr/bin/R # ----------------------------------------------------------- # Aggregate and plot chunked runs of MAST + RE for DGE # Plot the comparison between regressions on different pathologies. # Updated: 02/11/2021 # ----------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ') s...
1f62f27bffa54ef9b897e42f76a91d57fc53ca624a8fa6f3b1bec984e526b578
R
18,146
414
#' R6 class for pTFCE specification for one or more z-statistic images #' #' @importFrom R6 R6Class #' @importFrom checkmate assert_directory_exists assert_subset assert_string #' @export ptfce_spec <- R6::R6Class("ptfce_spec", private = list( gfeat_info = NULL, z_files = NULL, mask_files = NULL, resi...
6eca622a6ef69097fc2170eef56fe41d82dbfe197dad6e82f9dfb7567c004571
R
18,154
398
#' Plots all doublets in space #' #' saves as 'all_doublets.pdf' #' #' @param puck an object of type \linkS4class{SpatialRNA} #' @param doublets a dataframe of RCTD results restricted to doublets #' @param resultsdir output directory #' @param cell_type_names list of cell type names #' @return returns \code{\link{ggplo...
e4716174700ec79e83da7171c66345dbf40267fec6189f10f1fad82435d9738b
R
18,279
456
vanilla_encoder <- nn_module( "Encoder", initialize = function(vae_dim, n_batch, n_covariate) { self$n_layers = length(vae_dim) self$layers <- nn_module_list() self$layers[[1]] <- nn_linear(vae_dim[1] + n_batch + n_covariate, vae_dim[2]) if (self$n_layers > 3) { for (i in 2:(self$n_layers...
ca235c8168669d8cc3fb37b6c5c44837867d91167d00494020a5874e94f84816
R
18,326
527
--- title: "Analysis of genes with bootstrap and permutation (RD) Net [Sh, UBI] with mean" 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_typ...
ac0dd8550a2c89cefb742b865e3ecf07abea92bef1544a9c28b8a48d6dd5ddea
R
18,329
526
--- title: "Analysis of genes with bootstrap and permutation (RD) Net [Sh, UBI] median" 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: ...
c8e699bc9346f17c4c1cc1b87079840c3f4350bc58193d53a8c2ad83fc736698
R
18,334
459
# 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) # Add this to stop R from formatting into sc...
026500208afdb99d3544e3dfdb5290713e82871b77289b322e8576cb4d6a6309
R
18,351
527
--- title: "Analysis of genes with bootstrap and permutation (RD) Net Sh with median" 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: in...
125f8ecc8c188bba3bd96ab4ec382aa09769e8ba2cd70085bf138dc73327a3e2
R
18,377
432
#' Main function for plotting ASE fits from spase fit #' #' Takes in the result from spase and plots raw data and smoothed allele #' probability surface #' #' @description This function plots stuff for spase results. #' #' @param matrix1 a matrix of counts where the rows are genes and the columns #' are cells for alle...
695fb887218d8e282cdc5efffc74b592b0ed66e544116e385eaea9410b3bd44c
R
18,392
536
#!/usr/bin/R # ----------------------------------------------------------- # Plot/predict ligand interactions with string given # the top DE genes in each CT # Updated: 03/23/2021 # ----------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ') source(paste0(bindir, 'multiRegion/load_...
6a5c056fc003336a57fc8eb770d04e5c602933200eb1dc6e4d2b88fdfae07330
R
18,437
534
#!/usr/bin/R # ------------------------------------------------------- # Plot energy metabolism for glia and excitatory neurons: # Updated: 11/07/23 # ------------------------------------------------------ library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(bindir, 'multiRegion/load_metadata.R')) library...
f0c1ea4751b41819efe89060e8125978972bc2fd4cd38f2ac11b66cac6c73e69
R
18,444
471
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/singleCe...
4be5d56831e5661313141c877ef2f9a153424891b9acdcf265a276ab7105182d
R
18,498
434
#!/usr/bin/R # ----------------------------------------------------------- # Calculate the fraction differences, by binomial regression: # As in: # https://github.com/vals/Blog/tree/master/201127-cell-count-glm # Updated 01/19/2021 # Updated 03/15/2021 # Final version is composition_02_binom_emmeans.R # -------------...
6223ad37eb87de216cb22da49ac1f1344ab88dd95c7948fc01917fe497b07cc0
R
18,514
421
#' function to submit a set of jobs on a cluster to estimate many Feat level 1 models #' #' @param gpa a \code{glm_pipeline_arguments} object containing model specification #' @param level GLM level to run. #' @param model_names an optional level 1 model name used to subset the runs to submit to feat. #' If not provi...
b670cdb11af130e53affd8d9035eb60895692a41afca586ca7406bd4b2eb00e6
R
18,533
478
# Functions for CovBat simulations # by Andrew Chen #### Data-Generating Function: Additive Covariance Effect #### # modified in this code to allow for binary covariates # df_gen_add <- function(mu, # p-dimension intercept vector # Sigma, # p x p covariance matrix for error terms # ...
b7970ded4a898daf67b7e47afac0550a87aacb029104cc651efd4a11e82abc0c
R
18,573
455
basepath = "/net/trapnell/vol1/home/readdf/trapLabDir/hubmap/results/2021_07_15_Greg_ATAC_Code_nobackup/" dir.create(paste0(basepath, "archr/results/finalPlots/")) out_dir = paste0(basepath, "archr/results/finalPlots/") setwd(out_dir) set.seed(7) # load requirements suppressPackageStartupMessages({ # libra...
bc237a2a8b630741080f87ccc78bd69d9135b47728f297db5e729c359e968518
R
18,648
459
#' Extract headings of (R) Markdown-syntax text as an outline #' @inheritParams mm #' @return Character, showing the outline. #' @export #' @examples #' input <- system.file('examples/mindr-md.Rmd', package = 'mindr') #' input_txt <- readLines(input, encoding = 'UTF-8') #' outline(input_txt) #' outline(input_txt, md_li...
4e7323bc8414a4d15429074965374257482b89522e4b54dd5e682db37e25c74c
R
18,776
570
# Unit tests for collinearity_diagnostics.R functions # Uses mock factories from helpers-mock_factories.R # Note: create_mock_collinearity_summary() and create_empty_collinearity_summary() # are defined in helpers-mock_factories.R and loaded automatically by testthat # ================================================...
2f4b336975f4adf264becded5c6a00acd79150adb91de10d819ee8519e8817b6
R
18,851
471
library(here) #============================================================================== # function that grabs gene meta data from biomaRt getGeneMetaData <- function(){ library(biomaRt) # load tidy expression data reads_file = here("data","tidy_reads.csv") reads_data = read.csv(reads_file) # ...
6b8ca2bf20ec579c19fc145b6a48d642ed87629857c851821212e536221a9a8d
R
18,879
517
rm(list = ls()) library(fmsb) library(ggplot2) library(ggpubr) library(scales) library(stringr) library(asbio) library(tidyverse) library(car) library(broom) scriptsdir="/softwares/pyCAP_PLOS_Biol2024/" source(paste0(scriptsdir, "/clean_impute.R")) #source(paste0(scriptsdir, "/behavioral_pca.R")) #if not works due to...
5c6a2bb3818cc2bdfa36817b212da6edbcb404608f0e0c147b873d4e60045795
R
18,890
569
#!/usr/bin/R # ----------------------------------------------------------- # Use the pathology to run some tests on linear mixed models: # Last updated mid-2020 (exploratory analysis) # ----------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ') source(paste0(bindir, 'multiRegion/lo...
586d7ca9531af89b37e708b39aab7530d0987b41e090253899eddd32bbee6907
R
19,245
494
library(broom) library(diptest) library(knitr) library(PRROC) library(randomForest) library(tidyverse) library(yardstick) metrics_data = read_tsv("eLife_Metrics.tsv") %>% filter(!is_duplicate) num_images = nrow(metrics_data) %>% print() # 66253 ############################################### # Identify images wi...
85172282ce552ac8f5ab5868c7e4be4377d7df7cddef9458ddaaa5a7f75a2c87
R
19,348
411
suppressPackageStartupMessages({ require(argparse) library(stringr) }) #-------------------------------------------------------------------------------------------------------------------------- # Author: Javier de la Fuente # Date: 05-11-2020 # # Filename: paLDSC_JFC.R # # Purpose: Defining a function to perf...
71f985c45da3ce5f05353a3ee770fbdd802fc307a8b0f709410a69b13ef7f5b2
R
19,368
367
#Packages needed library(car) library(dplyr) library(rstatix) library(ggpubr) library(emmeans) library(FSA)#Dunn's test library(performance)#r2 library(SIBER)#SIA #Setting up main dataset trt.data <- read.csv("Lamarre_Wilson_2024_main_data.csv")# Main dataset #Long chain omega-3s (lcn3) in red blood cells (RBC) and c...
9bcd12a0359aee57812048eafb2d6830e8874ae949e193eecb1a864ed7fc0821
R
19,400
371
library(tidyr) library(ggplot2) library(glmnet) library(ROCR) library(data.table) # library(monocle3) # Get shared functions between this and runRegressionModel.R source("./utilityFunctions.R") library("optparse") # Get the passed parameters option_list = list( make_option(c("-p", "--pValFIMOcutoff")...
4388d2dd5c94100dd8921e2b1e862df996d51f41c196b4c6bc278bace416d01f
R
19,567
462
library(phytools) library(geiger) library(caper) library(ape) library(nlme) library(mvMORPH) library(ggplot2) library(dplyr) library(hrbrthemes) library(nortest) library(multcomp) library(RColorBrewer) #Load tree file tree = read.nexus("TreeTE.tre") tree = ladderize(tree) plot(tree) #Load data data...
6f03f778d9b295ff13d609cea452d29d5e513199b8efde028178ebaa3375b8e5
R
19,587
442
library(stringr) library(reshape2) library(ggplot2) print("Starting Now") plotCurveFromRDSdataframes <- function(dfAsRDSfiles,groupTitle, colToPlot = c("posResultMM")){ # read in the rds objects splitNames = str_split(dfAsRDSfiles, "_folds_") # Loop through. For each result make a separate plot for (eachRe...
b2a3bc2497e88c683c1f2c6bb572c81ba47b2929524e13a75c5280b979d9f711
R
19,598
508
#' Functions for extracting and summarizing collinearity diagnostics across the GLM pipeline #' #' These functions provide structured summaries of regressor correlations and variance #' inflation factors (VIF) for all subjects and runs following model setup. #' #' @name collinearity_diagnostics NULL #' Extract colline...
2a844bf1715a499a8ed2276e79a1a95ad5674d3c5bf6711e51a644b5e9998341
R
19,666
450
########################################################################################### # Load relevant packages source("../../../sharedProjectCode/utility/singleCellUtilFuncs.R") modStatus <- loadMonoclePackages() print(modStatus) source("../../../sharedProjectCode/scRNA_Seq_Background_Code/backgroundMethod...
a1d029fb4fe7e044f4f57f067c5a9f7e679d91c2fc39f546eefbb90dca3cb118
R
19,813
444
lassosum.pipeline <- function(cor, chr=NULL, pos=NULL, snp=NULL, A1=NULL, A2=NULL, ref.bfile=NULL, test.bfile=NULL, LDblocks=NULL, lambda=exp(seq(log(0.001), log(0.1), length.out=20)), ...
379112a051ec95e268f9e933fbfb979fccb57d725c0d17fe4926c66937352163
R
19,922
567
```{r} library(reticulate) library(dplyr) library(tidyr) library(ggpubr) library(arrow) library(ggplot2) library(cowplot) library(gridExtra) ``` The gene file timing_genes.parquet comprises 1000 randomly chosen genes. For the timing experiments, the number of regression chunks was set to 1 in all snakefiles. The t...
d1cee061bce1d96f05289cecb4f100958be94444e086b7f9035d43671e6ac5bb
R
19,950
554
library(corrplot) library(dplyr) library(RColorBrewer) setwd("F:/Brain_region_project/Module_scores_DEGs/Module_scores_PFC427DEGs/Results") data=read.csv("Ast_metadata.csv") colnames(data) library(ggplot2) ###################################################################### #########################...
fa247b8e0f15a806068f0ad2fb8298235fe25930fe7fd3fe2c3babffd06b1f60
R
19,967
369
#' archstabms__optimal_library_design_src #' #' Library design for Src optimising WT-like abundance and activity. #' #' @param mochi_outpath path to ddPCA data (required) #' @param position_offset residue position offset (default:0) #' @param max_num_mutants maximum number of mutations (required) #' @param explore_mut...
5beadaf7631a84294365355056702af4d27f583d39cd55d137c5f2c4e501c79d
R
20,110
778
--- title: "Pa for SO, UBI (L, R; Hand, Machine)" author: "Yaromir Kobikov <kobikov.yaromir@gmail.com>" date: "10/22/2021" output: word_document: default html_document: toc: true toc_float: collapsed: false editor_options: chunk_output_type: inline --- ```{r setup, include=FALSE} source("../BayesianPValue.R"...
ed3cae0420ba2cfd1b15d8fc98c579db7bd63694407152d09d2b16f15ef8b037
R
20,244
550
rm(list = ls()) library(fmsb) library(ggplot2) library(ggpubr) library(scales) library(stringr) library(asbio) library(tidyverse) library(car) library(broom) scriptsdir="/softwares/pyCAP_PLOS_Biol2024/" source(paste0(scriptsdir, "/clean_impute.R")) # -- Set ggplot basic theme theme1 <- theme( panel.border = eleme...
000d5aa13dc8adb7dc83276402094b75f6bd2c116c50a86147507283eb88c71a
R
20,343
495
library(knitr) if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install("ALDEx2") library(ALDEx2) install.packages("devtools") library(devtools) install_github("ggloor/CoDaSeq/CoDaSeq") library(CoDaSeq) library(zCompositions) library(igraph) library(car) ...
71730bba92bcd2bb6be0ff893b181a25164739ae64f7bd1abcf14803a86915b4
R
20,421
600
--- title: "Analysis of C>T variants in scs data" output: html_document: self_contained: false --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` In this document we provide an analysis of the C>T variants found in the SCS dart-seq data. The criteria for finding a C>T variant has been the fo...
a39e03a2be8909a064389fd17fbfdae27925ca7a68febddfe1d3be3b45774168
R
20,445
546
#' Assigns a y-label for a plot based on the target type and metric to plot .y_label <- function(target, metric) { # default: no label ylab <- "" # for specific targets (indicated by position in the plot): # assign a label based on the metric to plot if (target %in% c("blood_pressure_systolic", ...
19e64b750dc3315729843944f58971c727f25fb0ec148d5b994eb01234a8b81d
R
20,492
358
# This script saves the significant clusters for each map in a SCEPTIC group analysis #used for testing: group fixed entropy #Sys.setenv(fsl_pipeline_file="/gpfs/group/mnh5174/default/clock_analysis/fmri/fsl_pipeline/configuration_files/MMClock_aroma_preconvolve_fse_groupfixed.RData") #Sys.setenv(run_model_index=2) #...
1231e841d64659d763f1213d4678f740990312146345ebaf487cca7371dbf9c9
R
20,512
506
getInputDF <- function(opt, specifyFeatures=FALSE, specifiedFeatures="NULL"){ # Get the path dirName = paste0("../2021_07_26_setup_ATAC_to_expr_data_nobackup/fileOutputs/", "Gene_Prom_Plus_Distal_WithSequence_Sites_Max", opt$maxNdistalSites, "_Upstream", opt$promoterUpstream, "_Do...
5624468a9b570c03e731006a7dcf054601ddfa2557ebd442ef04702b947c151b
R
20,539
856
--- title: "10x snRNAseq pipeline" author: "Shahzad Khan" date: "2023-11-01" output: html_document --- Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot. ```{r} library(dplyr) library(Seurat) library(patchwork) library(ggplot2) install.package...
45168fe1224e9a3183bff0eb81078fe3c2b354bdba1061eb53ad078cf8846a22
R
20,577
602
library(tidyverse) library(broom) library(quickpsy) ########################################################################### # Load and preprocess data ------------------------------------------------ ########################################################################### data <- read_csv("../../data/data_exp1...
544207dda99345fabf3d51e8edc9ec7a4c6bcf59b33f2d4fb1994bf2659be285
R
20,651
629
--- title: "Melanoma single-cell DT data - Data preprocessing" author: "Yingxin Lin" date: "Created on 11 July 2022, last compiled on `r format(Sys.time(), '%d %B, %Y')`" output: html_document: code_folding: hide number_sections: yes toc: yes fig_height: 12 fig_width: 12 toc_float: colla...
f38f4c91633529b125d5400623428082e3aa8aa5907bf90beac4f09eafb992a8
R
20,673
664
--- title: "ROI analysis" author: "Michael Lombardo" date: "13/10/2023" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` # ROI analysis ```{r, warning=FALSE, message=FALSE} library(easypackages) libraries("here","tidyverse","readxl","reshape2","patchwork","ggpackets","emme...
1da6a5192fb11a9030dc0f97ecfb6b6b0e45ac26f0fd9299f894777395c425fc
R
20,799
528
coord_flipper <- function(coord_list, flip_vec) { flipped_coord_list <- vector("list", length(coord_list)) for (i in 1:length(coord_list)) { tmp_coord <- coord_list[[i]] # No flip if (flip_vec[i] == 0) flipped_coord_list[[i]] <- tmp_coord # Flip X if (flip_vec[i] == 1) { tmp_...
571566134899e971ffc798e8f91824d97b60410fb95c90ed5e601c280370f8cc
R
20,805
588
# Build a complete backend spec by merging test-specific overrides onto defaults make_test_backend_specs <- function(...) { defaults <- fmri.pipeline:::default_glm_backend_specs() overrides <- list(...) for (nm in names(overrides)) { if (nm %in% names(defaults)) { defaults[[nm]] <- modifyList(defaults[[...
a75c2ee503ad843f55ab39f6f14d6fb5a4fe98bb9ed90b66881ae550cdce95b1
R
20,835
715
--- title: 'SF: Read and preprocess raw stretch force measurements' author: "Yaromir Kobikov <kobikov.yaromir@gmail.com>" date: "11/26/2021" output: word_document: default html_document: toc: true toc_float: collapsed: false editor_options: chunk_output_type: inline --- ```{r setup, include=FALSE} source("....
9ed36a22263da3b1d87797e66f332884b9dbe3c3d851d309ab7acd5fdc72b694
R
20,859
727
#### SpectralImagingData #### ## -------------------------- # VIRTUAL class for containing spectra arrays # with imaging position/pixel information .valid_SpectralImagingData <- function(object) { errors <- NULL if ( length(object@processing) > 0L ) { is_ps <- vapply(object@processing, is, logical(1L), "Process...
05bffb9d47a7ba6c0334b0cf52fc51acf21d46f276f7a27059809e954f0a04b0
R
20,869
390
library(tidyr) library(ggplot2) library(glmnet) library(ROCR) library(data.table) library(RColorBrewer) # library(monocle3) # Get shared functions between this and runRegressionModel.R source("./utilityFunctions.R") library("optparse") # Get the passed parameters option_list = list( make_option(c("-...
4c2a636642044838184f61620aaaa5f622bcee62afdf8299e2da774c94dc76d0
R
20,885
435
library(ggplot2) library(Seurat) setwd("D:/Mouse_data_integration") pbmc=readRDS(file="GABAergic_neurons_integrated_all_class.rds") write.csv(pbmc@meta.data,file="GABAergic_neurons_integrated_all_class_metadata.csv") data=read.csv("GABAergic_neurons_integrated_all_class_metadata_addition.csv",row.names=1) p...
a508ff3ab1430d31912f9014aa7bffdcf8dcfcff024a8b421a3af379d33ddaf9
R
20,942
591
# NEPC DNA Variant Analysis # David Moline # University of Minnesota # Hwang Lab # Last updated: 8/13/24 # Libraries --------------------------------------------------------------- library(ggplot2) library(dplyr) library(tidyr) library(reshape2) library(pivottabler) library(corrplot) library(gridExtra) library(patc...
1eda2fa010c920a8ddbbac3614de5588f41830c61ef25d296f64c1afb8b386fb
R
20,999
775
# GRAPHIC FUNCTIONS create_heatmap <- function(plot_data, factorgroups, groups2plot, Colv = TRUE, ColSideColors = FALSE, RowSideColors = NULL, clusteralg = "a...
8e2c76ddbe2435305221d47645a4206126984c2c38eddd734c5a7ba5a113b37c
R
21,008
352
# devtools::install_github("kushnerlab/scRNAseqR") library(EMC.SKlab.scRNAseq) ##### USER INITIALIZATION ----- ### USER CONFIG ### # general run_name <- "sakshi_pipeV8" project_dir <- "C:/SynologyDrive/Projects/scRNAseqR" samples_dir <- file.path(project_dir, "data/samples/") # sample analysis sample_names <- c("N...
afe8176e6a81948d7312a57dffcbc65345623bad3f07b3393148f043285a8641
R
21,088
680
########################################################################################### # Load relevant packages source("/net/trapnell/vol1/home/readdf/trapLabDir/sharedProjectCode/utility/singleCellUtilFuncs.R") # modStatus <- loadMonoclePackages() # print(modStatus) library(monocle3) source("/net/trapne...
d04b49194bebc68cec70ea57083647c1b73130be98f26f3a9f76058f77427a62
R
21,281
353
#' Analyse individual samples #' #' Performs Seurat SCTv2 analysis workflow on individual samples. #' #' @param samples_dir Root directory of samples. #' @param sample_name Current sample name, used to match in samples_dir. #' @param output_dir Package home directory, used to create output directory for results. #' @pa...
8db854496e26ee8fc719c174f8ed968bfb3d0f5c255abc0c06707b132f93cba7
R
21,406
549
# 4-7-22 add .libPaths('1') # 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) # Add this to...
9632ceb30086f5fbdbe10f9821218d9ae65e27b84965ace68ad862ac42649190
R
21,467
719
--- title: "Morphometric_Quantification_RAgas" output: html_document date: "2024-01-02" --- ```{r} library(tidyverse) library(readxl) library(cowplot) library(tidyr) library(reshape2) library(viridis) library(scico) library(RColorBrewer) # Theme setting my_theme <- theme_bw(base_size = 12, base_family = "") + th...
1ba92a3d401ae18f06baa4df9b4af510b024fb69074644e3abb52a47168ddd8d
R
21,619
629
#' Produces forecasts from fitted forecast objects #' @param forecast_obj A fitted forecast object from the forecast package #' @param lambda The applied box-cox transformation parameter #' @param bias_correction Whether or not to use bias correction when doing #' box-cox re-transformation #' @param forecast_produced_...
e45162860797f7adeeea2a20339b6d3a91811b208e2b0b9ba9cfc8e5bfa22045
R
21,791
373
#!/usr/bin/env Rscript ## ----------Script----------------- ## ## Author: Szi Kay Leung (S.K.Leung@exeter.ac.uk) ## Mapt 4R vs 3R ## Trem2 proteogenomics characterisation ## -------------------------------- suppressMessages(library("cowplot")) suppressMessages(library("ggh4x")) ## ---------- config file -------------...
230a61579bbcf26394873a07d3c9361181a87415054ae452e51f3462b81e5962
R
22,204
543
coord_flipper <- function(coord_list, flip_vec) { flipped_coord_list <- vector("list", length(coord_list)) for (i in 1:length(coord_list)) { tmp_coord <- coord_list[[i]] # No flip if (flip_vec[i] == 0) flipped_coord_list[[i]] <- tmp_coord # Flip X if (flip_vec[i] == 1) { tmp_...
5d5ff1c149ab339d312c3182959a1ec44d8e2e030b32ff862962a8493c856e95
R
22,304
438
#' Convert R code into FreeMind mind map code #' @inheritParams mm #' @export #' @return Character, FreeMind mind map code. #' @examples #' input <- system.file('examples/mindr-r.R', package = 'mindr') #' input_txt <- readLines(input, encoding = 'UTF-8') #' output_txt <- r2mm(from = input_txt) #' output <- tempfile(pat...
1d38b9ef0e95409a761a7314535f67cfefc38b6357662dcbc8e939bf3ae19c2d
R
22,369
670
#### Simulate mass spectra #### ## ---------------------------- simulateSpectra <- function(n = 1L, npeaks = 50L, mz = rlnorm(npeaks, 7, 0.3), intensity = rlnorm(npeaks, 1, 0.9), from = 0.9 * min(mz), to = 1.1 * max(mz), by = 400, sdpeaks = sdpeakmult * log1p(intensity), sdpeakmult = 0.2, sdnoise = 0.1, sdmz = 10...
b30de6cf77e45dd13ad146f023ef2fa1a8b36f0ab660a40ba267f69bdec47157
R
22,437
546
basepath = "/net/trapnell/vol1/home/readdf/trapLabDir/hubmap/results/2022_04_03_redoATAC_proc_nobackup/" dir.create(paste0(basepath, "archr/results/NB11/")) out_dir = paste0(basepath, "archr/results/NB11/") setwd(out_dir) set.seed(7) # load requirements suppressPackageStartupMessages({ # library(ArchR) library(mo...
ef46122d035cb7dc715ccb2713874c127dd0c8b1c2aca00d051def60583360ac
R
22,445
713
--- title: "Vertical Analysis Pa: Ctrl, BNI, FNA (hand, machine)" 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 --- ...
8559eaf428e27525f7a2709709ff7d717aefa55b41cc2da9fa1ebecbc187a6ff
R
22,506
513
suppressPackageStartupMessages({ library(ggplot2) library(GGally) #library(GSEABase) library(limma) library(reshape2) library(data.table) library(knitr) #library(TxDb.Hsapiens.UCSC.hg19.knownGene) library(stringr) library(NMF) library(rsvd) library(RColorBrewer) library(MAST) }) ...
2a805a33c84e2788a709397c50a38f629c82e24fc325a81ac3ddd7e0d95b7e52
R
22,548
637
## Tests for brms-style smooth terms (s(), t2()) in sccomp formulas. ## ## The unit tests at the top do not need cmdstan: they only exercise the ## R-side machinery in `R/smooths.R` and the patched `parse_formula()`. ## The end-to-end smoke test does need cmdstan and is gated by ## `skip_cmdstan()`. library(dplyr) # ...
3deff3c628cde8f7287e20da6af63869cc3e1d8c15782525bed3db087ab51826
R
22,672
618
#!/usr/bin/R # ----------------------------------------------------------- # Aggregate and plot chunked runs of MAST + RE for DGE # Updated: 01/21/2021 # ----------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ') source(paste0(bindir, 'multiRegion/load_metadata.R')) library(tidyr)...
6480f8f3dc0e064eac3f5a568860c1324d099013ba39122a435388bd079202fb
R
22,755
454
#' --- #' title: "Pairwise sample analysis output" #' author: "Tomas Bjorklund" #' output: #' pdf_document: #' highlight: tango #' geometry: margin=0.6in #' fontsize: 9.5pt #' --- #' This script presents overview ploits and top candidates. suppressPackageStartupMessages(library(knitr)) #+ setup, include=FALSE ...
6fa0165f161e01f40c5eac22f3b5f174956a99ffc100bf08a6817e75fd885ec1
R
22,769
682
#' Load in citations for deduplication #' #' This function loads in a citation file within the shiny app #' @import RefManageR #' @importFrom glue glue #' @import bibliometrix #' @import XML #' @importFrom utils read.csv read.table #' @param paths Relative paths to the citations file or files #' @param method Import m...
1ac427ea35e2bebae87a1d29d74d31c048e2747b175aabe379ca51252ac214f8
R
22,882
353
# Szi Kay Leung: sl693@exeter.ac.uk suppressMessages(library("data.table")) LOGEN <- "/lustre/projects/Research_Project-MRC148213/lsl693/scripts/LOGen/" source(paste0(LOGEN,"/transcriptome_stats/read_sq_classification.R")) source(paste0(LOGEN,"/target_gene_annotation/summarise_gene_stats.R")) source(paste0(LOGEN,"/com...
6ea196fe56744c20f664b44004d2d16daa7ef702d733ea96a732fdd3f9dc714c
R
22,960
530
#' sccomp_remove_outliers main #' #' @description #' The `sccomp_remove_outliers` function takes as input a table of cell counts with columns for cell-group identifier, sample identifier, integer count, and factors (continuous or discrete). The user can define a linear model using an input R formula, where the first f...
098126cfdef73c3302846493590340624410102d6a6e30c643a44acdc62f5211
R
23,040
552
--- title: "code_for_figures" author: "Yuvarani Masarapu" date: "`r Sys.Date()`" output: html_document --- ```{r} library(SeuratObject) library(Seurat) library(harmony) library(sctransform) library(Matrix) library(RColorBrewer) library(ggplot2) ``` # Load the seurat object containing the analysed spatial barcodes and...
8d2a2580701aec10e6b27e5febdf1d9785dc0c1cd4006287217abe8694d205f3
R
23,079
645
library(dplyr) library(ggplot2) library(limma) library(muscat) library(purrr) library(scater) library(Seurat) ####################################################################### setwd("G:/PFC_429_final_Spring2021/Data") pbmc=readRDS("Oli_integrated_batch3000_leiden_res02_final.rds") #Add official ...
a0f6829231bf5d0f28c13907d04bdfbf07a11cddd971c48c322340953ec5f2ed
R
23,107
578
library(knitr) if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install("ALDEx2") library(ALDEx2) install.packages("devtools") library(devtools) install_github("ggloor/CoDaSeq/CoDaSeq") library(CoDaSeq) library(zCompositions) library(igraph) library(car) ...
c45b91fd087b10b42d0b3c81bf209a3d041bbdda9efaa357fbc97c7630549830
R
23,121
423
#' --- #' title: "Heatmaps generated from HMM peptide clustering" #' author: "Tomas Bjorklund" #' header-includes: \usepackage{longtable} #' output: #' pdf_document: #' highlight: tango #' geometry: margin=0.6in #' fontsize: 9.5pt #' --- #' This script clusters Polypeptide motifs using the Hammock hidden Markov ...
9fc3b906d229c9ad5f1f83df5213c4849a44c0753944ffa99d40b3e845d02359
R
23,126
500
if (!require("dplyr")){ install.packages('dplyr') library(dplyr) } if (!require("lme4")){ install.packages('lme4') library(lme4) } if (!require("nlme")){ install.packages('nlme') library(nlme) } if (!require("splines")){ install.packages('splines') library(splines) } if (!requi...
cf034bfaa08bc395ebcec39c6a19288aac9acb7694b16318d53995320c9b3708
R
23,171
493
#################################################################################################### ### ### File: 06_trial_coordinates_differences.r ### Purpose: Computing the differences in trials ### Authors: Gabriel Rodrigues Palma, Rafael Moral ### Date: 03/08/23 ### #########################################...
5cd9b863a27987ed298c890d945f8cb49055ccc299f90468e30c2b200ca3c64d
R
23,191
623
#!/usr/bin/R # -------------------------------------------------------------- # Plot the two correlation scores + directionality # Use this to partition neuronal DEGs # Perform gene set enrichment on specific partitions # Updated: 06/22/2023 # -------------------------------------------------------------- library(cbrba...
4b7c33e8e003b330e36a2eaa169e2ad452d16d0024c126db58aada65b63a14bf
R
23,280
571
#!/usr/bin/R # ----------------------------------------------------------- # Use the pathology to run some tests on linear mixed models: # Using Liang's Nebula package to run the fast NBLMM # Basic overall + per-region interactions, for relevant subtypes # Updated: 10/28/2020 # # Compare multiple models (in a per-regi...
7bf702c3ec0a04528f4e2f36843d5b815bf2d8a826a8a4b10fe4ce55aea25f63
R
23,390
569
rm(list = ls()) # the code we are using is an amended version of radarchart function from fmsb library: # install # install.packages("fmsb") # Library library(fmsb) library(ggplot2) library(ggpubr) library(scales) library(stringr) library(data.table) # -- Set ggplot basic theme theme1<- theme(panel.border = element...
612af3bc2498d18a0b36b2733afa67f787671b2fd1a754744a7fd1050ed5f0fb
R
23,395
298
#' Creates an \code{\linkS4class{RCTD.replicates}} object across multiple \code{\linkS4class{SpatialRNA}} replicates #' #' Applies the \code{\link{create.RCTD}} function for each \code{\linkS4class{SpatialRNA}} replicate inputted using a #' scRNA-seq reference \code{Reference} object. #' #' @param spatialRNA.replicates...
2bc8da406f77794967851c73ccc5ca3a494e47c66d850f910a9bc9958ceb0140
R
23,524
419
#' --- #' title: "Heatmaps generated from HMM peptide clustering" #' author: "Tomas Bjorklund" #' header-includes: \usepackage{longtable} #' output: #' pdf_document: #' highlight: tango #' geometry: margin=0.6in #' fontsize: 9.5pt #' --- #' This script clusters Polypeptide motifs using the Hammock hidden Markov ...
d657cf9e9fd38176dc0079ee5faac88a4197f18cc776278e83b6d055f0edda00
R
23,588
454
filter_genes <- function(puck, threshold = 5e-5, batch_size = 1000, remove_genes = NULL) { message(c('filter_genes: filtering genes based on threshold = ', threshold)) gene_means <- numeric(length(rownames(puck@counts))); names(gene_means) <- rownames(puck@counts) n_batches <- ceiling(length(gene_means) / batch_s...
f9ef18107dc064b2736d03b6ff18dd03db0da9edf4056bac41a884b749ffe264
R
23,797
814
--- title: "PAS UBI vs SO (L, R; hand, machine)" author: "Yaromir Kobikov <kobikov.yaromir@gmail.com>" date: "9/23/2021" output: word_document: default html_document: toc: true toc_float: collapsed: false editor_options: chunk_output_type: inline --- ```{r setup, include=FALSE} source("../Bayesian...
e4540ffbebc8a1e9350e3816bc313063f6669a227c2afd8a1bb1f975b8fb1c01
R
23,818
414
```{r init} library(Matrix) library(tidyverse) library(biomaRt) library(monocle3) library(rgl) library(tricycle) library(SignacX) library(princurve) library(ggplot2) library(Hmisc) library(pheatmap) library("ComplexHeatmap") library(circlize) library(dplyr) library(ggrepel) library(latex2exp) library(scales) ``` ```{r...