sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
25ae4884f06de229db8a15812b6e4dc69fee49bc837ce779335845f11e2dd20b
R
9,844
266
#!/usr/bin/R # ----------------------------------------------------------- # Use MAST + RE to run differential gene expression # - Per region x per celltype subdivision # Submit as chunks (2500 -> 8 chunks) per combination. # TODO: Write separate script to batch and one to combine # Updated: 01/21/2021 # --------------...
7172608d7bff137dd03909a3212d0321fdc1403dc4806d33a80fa82442acd1ce
R
9,878
310
# Analyse p-values of genes w/ wo correcting for common variants to get the results for the condtional analysis for qunatiative traits run https://github.com/PMBio/deeprvat/blob/main/pipelines/association_testing_control_for_common_variants.snakefile ```{r} library(dplyr) library(tidyr) library(ggplot2) library(arrow...
cffad8c9d9ed7f99acd396b2ccffaeef610fe49b8f65a3b7b2d771058db42d63
R
9,940
160
--- title: output: html_document: toc: true toc_float: true --- ```{=html} <style> .list-group-item.active, .list-group-item.active:focus, .list-group-item.active:hover { background-color: #754E9B; } </style> ``` ## Overview <img src="updated_logo.png" align="right" width="142"/> Welcome to the the *...
af2df258b55d7aa1759b91fca18c1efb49236bc8d7372abb2e13162dbc114367
R
9,978
210
# TODO: clean up the mess of the 'local' approach, but for now, prefer the glue expression # consider whether we want a 'what' type argument, like subject directory, analysis directory, # run directory, model-specific analysis directory, etc. #' small helper function to return the location of an l1 directory based on ...
b1ca525af5383858b3715c53ac9dc92e157cecfb4dd6ac9250cb54f3dd015eb2
R
10,049
241
##POE dominate expression identification setwd("F:\\RNA_20221101\\02_ModifiedGenome\\C_POEgeneSelection\\result") library(dplyr) POE <- read.csv("ASE_N-1_filter_final.PO2.csv", header = T, row.names = 1) Br_40 <- POE$Br_40[!is.na(POE$Br_40)] Br_70 <- POE$Br_70[!is.na(POE$Br_70)] Br_115 <- POE$Br_115[!is.na(...
ba531acd1562ed7b46c1eee48147a8517e4c5c7a2c40415947f2a8deb5159d81
R
10,058
270
library(tidyr) library(ggplot2) library(glmnet) library(ROCR) library("optparse") # Get the passed parameters option_list = list( make_option(c("-f", "--featureSelection"), type="character", default="Binary_Combined_Motif_Counts", # "Binary_Combined_Motif_Counts", "Binary_PromOnly_Motif_Counts"...
48a4a48c4b61b33a1e99df30b0bec0631778ee5bc9af42819d6256001086d509
R
10,091
176
```{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...
cafa8fb27f48cebe54b37b9abef705b2f9964e820265ccfa79370f3c4f226455
R
10,120
276
#!/usr/bin/R # -------------------------------------------------------------------------- # Calculate the fraction differences, by logistic regression + mixed effects # Updated 10/23/2020 # -------------------------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ') source(paste0(bin...
92c99a8aa05c79150885f54e78c45f53881a3445af1db29631e4852e801eef22
R
10,136
257
#' helper function to insert a keyed data.frame into the sqlite storage database #' #' @param gpa A \code{glm_pipeline_arguments} object. #' @param id the id of the subject to whom these data belong #' @param session the session of these data #' @param run_number the run_number of these data #' @param data A \code{data...
7af0418fd07d46343451518e54ba50c7f6d51910c818c902a3fa4482c9bd48a0
R
10,155
250
--- output: pdf_document params: pmean: 0.5 pphi: 0 iter: 1000 --- ```{r} # confidence interval coverage simulation for binomial, beta-binomial # with varying p, var(p), total UMI (sum(y)) = m, total observations n library(dplyr) library(ggplot2) library(reshape2) library(aod) library(RCurl) ``` ```{r} # get re...
884388433c165c5c76bc97b88b3eb7bbfd8dc8dd2d95df03805246bff124db5a
R
10,167
250
##################### Plotting. ##################### colors <- c('#c6dbef', '#9ecae1', '#6baed6', '#3182bd', '#08519c', #'pink', "aquamarine4", '#E6AB02', '#7A2961') methods <- c('Burden pLOF', 'Burden missense', 'SKAT pLOF', 'SKAT missense', 'Burden/SKAT combined', "Monti et al.", "STAAR",...
baf2b3e3919903dc13d69e5377a8910a67c89357d746b22bee94046e6951a360
R
10,207
321
### -------------------------------------------------------------------------~ ### ### plot methods ### ### -------------------------------------------------------------------------~ # Set generic ---------------------------------------------------------------- #' @noRd #' @export setGeneric("plot") # Functions ---...
45d147d7aaecc9acc5a1ae02619b74699a0a7ddbf19b49c14ed7b3e9a379e026
R
10,224
294
#!/usr/bin/R # --------------------------------------------------------------------- # Compute and plot differences between subtypes for a certain celltype: # Updated 12/02/21 # --------------------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(sbindi...
a44171c5fc6ecbba819182a679dd8c5843b842844761203997f756b6b3ab7396
R
10,229
247
#' Helper function to better summarize GPA object #' @param object the \code{glm_pipeline_arguments} object #' @param ... ignored. #' @return a readable summary of the given gpa object #' @export summary.glm_pipeline_arguments <- function(object, ...) { gpa <- object cat("\nSummary of GLM Pipeline Analysis:...
bb8f358a0fddc91fd39f9dce9171ac8ad96ac5e515873f2842a638fbd82e496e
R
10,229
352
#### Spatial shrunken centroids (classification) #### ## ------------------------------------------------- setMethod("spatialShrunkenCentroids", c(x = "ANY", y = "ANY"), function(x, y, coord, r = 1, s = 0, weights = c("gaussian", "adaptive"), neighbors = findNeighbors(coord, r=r), bags = NULL, priors = table(y...
2a54a001d881faf25815f920d72701f216a1bbe726781c0388f9dc1581589271
R
10,251
270
library(tidyr) library(ggplot2) library(glmnet) library(ROCR) library(data.table) library(viridis) # 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"), t...
c830bfe812355f09971b28ab341def948cb78b52c4ef9315816e8b8986e1ddfd
R
10,280
364
# ---- Utility functions for making nice file names ---- prefix_filename <- function(file.name, prefix=NULL) { if (!is.null(prefix)) { file.name <- paste(prefix, file.name) } return(file.name) } groupby_splitby_filename <- function(file.name, group.by=NULL, split.by=NULL) { if (!is.null(group.by)) { fi...
aae233a92b0c8420f7eb40972174304d5223af03de3027ae42fc23b59bb16303
R
10,287
294
#!/usr/bin/R # ----------------------------------------- # Comparison of published with own DEGs: # - major cell types, across pathology vars # Updated: 07/27/23 # ----------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(bindir, 'multiRegion/load_metadata.R')) library...
aaf001c2f5bc61267fac802719be555e0b3666e3b8a93d211df9b02621950ac7
R
10,324
251
library(testthat) library(tibble) library(dplyr) library(tidyr) library(rlang) library(sccomp) test_that("get_random_effect_design3 with new NA groups", { skip_cmdstan() # Create test input data test_data <- tibble( sample = c("sample1", "sample2", "sample3", "sample4"), type = c("healthy", "healthy", "c...
4ec898ecdcc7f18e2283efd4ce4d82155f59dfb057d23185729d1490284829ff
R
10,327
328
#!/usr/bin/R # ------------------------------------------------------------------------ # Plot cross-module scores within the same celltype (at pseudobulk level): # Updated 02/16/2021 # ------------------------------------------------------------------------ library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') if (!exis...
24ce01267886b61a6f2c0b8bafe086566fbbff896cf2cb45891da5f76982f66d
R
10,372
277
rm(list = ls()) library(ggplot2) library(stats) library(plyr) library(lsr) library(ggridges) library(matrixStats) library(rapportools) library(optparse) library(dplyr) ################# # Set themes and functions ################# # -- Set ggplot basic theme theme1<- theme(panel.border = element_rect(size = 2, colou...
365f25ddbf5b05431d507fe5a6d6ad404f107c2584da81ca1a18ab9e7af80805
R
10,384
276
library(SingleCellExperiment);library(tidyverse);library(reticulate);library(tidyverse) library(ggplot2);library(scmap);library(fmsb);library(ggsci);library(ROGUE) library(Seurat);library(M3Drop);library(ROCR);library(cluster);library(parallel);library(scran) # Load data lung.sce <- readr::read_rds("/data1/pauling/04...
6196722f78d71784a4940880c8bacd810b50f9a021fea1da2eba1a742c6e7dce
R
10,395
213
#' --- #' title: "Top 23 connectivity analysis output" #' author: "Tomas Bjorklund" #' output: #' pdf_document: #' highlight: tango #' geometry: margin=0.7in #' fontsize: 10pt #' --- #' This script presents top 23 candidates as connectivity graph. suppressPackageStartupMessages(library(knitr)) #+ setup, inclu...
249b8d87461b2715c8af8efc7e659a1985aa46238e79479158e00860f5bfe4c1
R
10,449
148
#' archstabms__plot_model_performance #' #' Plot model performance. #' #' @param input_dt data.table with model free energy estimates (required) #' @param report_outpath output path for scatterplots (required) #' @param trait trait name and suffix for output files (required) #' @param highlight_colour colour for highl...
8956d15e7d7c8934a4876879a43747550bf503cc2d192db149af228e418429ce
R
10,462
233
# allow a set of .feat folders as input? #' Generate a set of diagnostic images and plots for brain masks relative to one another and a template #' @param input Can be a character vector of mask files, a \code{gpa} object, or a \code{data.frame} containing #' a \code{brain_mask} field, or at least a \code{$run_nifti...
f0296e91e7f0fb3cb4bad5682c305253790758bc03af6e0dbc252a4f876058a4
R
10,462
261
#!/usr/bin/R # ---------------------------------------------------------------------------- # Investigate the co-variation of selective vulnerability in EC/HC and others: # TODO: Neurons alone and neurons + glia # Updated 12/21/2021 to perform beta regression # ----------------------------------------------------------...
7d73ce05cd7579c91c14a7ccf227ff8fe3e59102dbc866540e1ba92ff75bb7ee
R
10,469
267
matchpos <- function(tomatch, ref.df, auto.detect.tomatch=T, auto.detect.ref=T, chr="", ref.chr="", pos="", ref.pos="", snp="", ref.snp="", ref="", ref.ref="", alt="", ref.alt="", ...
53ee78ee948e13b6896e90ff43e5ffd62d8f528e2fdddce66782b7a067c9226b
R
10,511
272
#!/usr/bin/R # ---------------------------------------------------------- # Plot enrichments for the collated + aggregated DE results: # Shared and specific pathways up and down. # Updated: 03/22/22 # ---------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(p...
892f2cfec99791a4b8579595b3e9f6d5c68276e1541fa12e7d9a645fb153179a
R
10,511
256
#!/usr/bin/env Rscript args = commandArgs(trailingOnly=TRUE) ### Analysis of interspecies deformation and aging utilising OPNMF structural ### covariance regions ### 5 INPUTS: ### ARG_1 - Working directory (wd) where relative paths can be used to find files ### ARG_2 - Cohort investigated ### ARG_3 - Parcellation Im...
f69c52ad19907882c19342031b62db11d314b31b0df366b1221b115d65f18426
R
10,523
286
library(dplyr) library(fmri.pipeline) # setwd(file.path(getMainDir(), "projects", "clock_analysis", "fmri", "hippo_voxelwise")) setwd(file.path(getMainDir(), "users", "michael", "sceptic_decon")) trial_df <- get_mmy3_trial_df(model="selective", groupfixed=TRUE) %>% mutate(rt_time=clock_onset + rt_csv/1000, #should b...
058b210ac3e93075bdc0c38e4e1a4a3329419dac0e2f28e490d3aa7d05d532e8
R
10,538
277
######################### ########Licensing######## ######################### # Breathe Easy - an automated waveform analysis pipeline # Copyright (C) 2022 # Savannah Lusk, Andersen Chang, # Avery Twitchell-Heyne, Shaun Fattig, # Christopher Scott Ward, Russell Ray. # # This program is free software: you can redis...
41b1275fb2706c10b9da6749bd23a9835962ef0938002640a352533cc399e683
R
10,566
356
#### Read MS imaging data file(s) #### ## ----------------------------------- readMSIData <- function(file, ...) { ext <- tools::file_ext(file) if ( tolower(ext) %in% c("ibd", "imzml") ) { readImzML(file, ...) } else if ( tolower(ext) %in% c("img", "hdr", "t2m") ) { readAnalyze(file, ...) } else { stop("can...
b1d2df546009b487235c6e8d01a481bea335d8c50b7a11817a5ede6eae69b5f0
R
10,605
272
--- title: "prep_all_mira_forscvelo" author: "T Attenborough" date: "11/01/2023" output: html_document --- ```{r, message=FALSE} library(remotes) library(Seurat) library(zeallot) # For %<-% that unpacks lists in the Python manner library(DropletUtils) library(tidyverse) library(GGally) # For ggpairs library(scales) l...
c59dc737deef3172f33241fb6bfbf76f2fa100970c44e17f44ff96e4f1c3e2cf
R
10,611
233
exptDir = '/path/to/along-tract-stats/example/between_group' grpLabs = c('Control', 'FASD') thresh = 0.05 nPerms = 100 library(nlme) # Mixed-effects models library(ggplot2) # Plotting tools library(plyr) # Data manipulation library(RColorBrewer) # Color tables ##################################...
fb5f139092697d3ebb1aee67aace203c7ce7ea7b4d4d509205e1828338305478
R
10,617
226
#' helper class to generate 3dttest++ null datasets using -randomsign #' @keywords internal simulate_null_3dttest <- R6::R6Class("simulate_null_3dttest", private = list( residuals_file = NULL, mask_file = NULL, n_permutations = 20000, njobs = 16, job_output_files = NULL, # full path to permutation...
c6da66058191319d21b2c1993c31a2509fb7a7c7154b1f27af970b6c48ebd5e4
R
10,622
303
#' sccomp_scatterplot #' #' @description #' Creates a scatterplot of cell-group proportions against a continuous covariate, #' optionally overlaying the posterior predictive trend from the fitted model. #' Use this visualisation when the factor of interest is numeric; for discrete #' factors prefer [sccomp_boxplot()]. ...
f10cc8719079e00e5c6f2a43de582e64bd01058d104a472a2ecae48e513cdbc3
R
10,624
412
suppressPackageStartupMessages({ library(Seurat) library(magrittr) library(dplyr) library(purrr) library(stringr) library(ggplot2) library(patchwork) library(forcats) }) SAMPLE_DIRS <- list( "AH59.5" = "202309211049_MsEmbryo-VS147-AH59-2-5-A_VMSC18002/region_1", "AH59.6" = "202309151103_MsEmbryo-VS...
29c04eda91d158d437beb301cfce4506cb1e868fc2e35ba07cc2d3b8d477513f
R
10,627
260
#!/usr/bin/env Rscript # # This is a modification of the original pTFCE shell script: https://spisakt.github.io/pTFCE/ # The goal is to apply pTFCE to a single zstat image based on relevant inputs print_help <- function() { cat(paste("This script runs pTFCE (probabilistic threshold-free cluster enhancement) on a sin...
80295bb16631cfa6e81ef9fd0d4ff49fbe6534b82c08c3e912651c750593163f
R
10,638
248
# helper function to return a logical vector of trials included in subset get_trial_set_from_signal <- function(ss, trial_data=NULL) { checkmate::assert_data_frame(trial_data) # if user has a cached trial expression, need to evaluate the trial set before getting value df if (isTRUE(ss$trial_subset)) { # calcu...
3935cd36b6c9e8b2eae6521e9c71e0528178d3d8f19905c33aade82279153858
R
10,666
301
#!/usr/bin/R # ---------------------------------------- # Calculate relative changes in markers of # vulnerable neurons w.r.t. APOE genotype # Updated: 07/22/2022 # ---------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(sbindir, 'load_metadata.R')) library(tidyr) li...
6055bfa3bef088f882b64773f39a29cf56c02ddbc6172282743fd65b98a5761e
R
10,675
401
--- title: "PPMI differential expression analysis with DESeq2" output: html_document: toc: true --- Subtype III vs healthy controls. Gender as covariate. Protein-coding genes only. Code adapted largely from: * http://bioconductor.org/packages/release/bioc/vignettes/DESeq2/inst/doc/DESeq2.html * https://bioco...
e5f6ab73920f643ceab5493309a99212ec8865696c17fb2c9808093fca115253
R
10,678
267
#' simulate_data #' #' @description This function simulates data from a fitted model. #' #' @import dplyr #' @importFrom magrittr %$% #' @importFrom magrittr divide_by #' @importFrom magrittr multiply_by #' @importFrom magrittr equals #' @importFrom rlang quo_is_null #' @importFrom SingleCellExperiment colData #' @impo...
2b8cd0141002c5becfc2dfbaf39c07a01656c8bfbc08a5d3db0a3b83d15543bf
R
10,701
243
--- title: "Analysis of m/k = 1" output: html_document: self_contained: false --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` Enrichment analyses on variants with m/k = 1 from single-cell data. #### Enrichment analysis ```{r, echo = FALSE, warning=FALSE, message = FALSE, dev=c('png', 'p...
4a91eed420c86d27b979fd3463e502b208886b37c1bd30531312b3e5695fca80
R
10,727
402
--- title: "PPMI differential expression analysis with DESeq2" output: html_document: toc: true --- Subtype III vs healthy controls. Gender as covariate. Protein-coding genes only. Code adapted largely from: * http://bioconductor.org/packages/release/bioc/vignettes/DESeq2/inst/doc/DESeq2.html * https://bioco...
906a0debf7b0132e5aeb82f82612b4b6c8394cac86f041029a592ad3856ee3c9
R
10,729
403
--- title: "PPMI differential expression analysis with DESeq2" output: html_document: toc: true --- Subtype III vs healthy controls. Gender as covariate. Protein-coding genes only. Code adapted largely from: * http://bioconductor.org/packages/release/bioc/vignettes/DESeq2/inst/doc/DESeq2.html * https://bioco...
b0c05af4ae25c14b2b4f5a1cee7b6620fbba2ce21693bd2776b401be31ea3cac
R
10,739
336
# Function ------------------------------------------------------------------- #' Identifying spectra and spectral data points #' #' Function [identify_spc()] allows identifing the spectrum and the wavelength #' of a point in a plot produced by [plot_spc()]. #' #' @rdname identify_spc #' #' @aliases identify_spc #' ...
ec127d01e5084cb6c6a38ccbd24ec3141095f12ca2f4f1a76342356db67a3a84
R
10,749
306
--- title: "THRA Isoform 1 and Isoform 2 Relative Expression" output: html_document: toc: True toc_float: True df_print: paged editor_options: chunk_output_type: inline --- INTRODUCTION to the Experiment Dataset from Testa et al 2020 (E-MTAB-8325 https://www.ebi.ac.uk/biostudies/arrayexpress/studies/E...
ac88a7c03dd5db62aa7a5d9a2df4e7bbc01666afaee03d5fa17257de02afe07c
R
10,750
329
#!/usr/bin/R # -------------------------------------------------- # Ask whether modules predict AD and other variables # at sample & cell type level # Updated 01/26/2022 # -------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') if (!exists("cellmeta")){ source(paste0(...
5c8904051a410308bb9165db71083723be5956fd19bddc230434bcba4840093e
R
10,764
249
--- title: "Phosphoproteomics data set of multiple mouse tissues" author: "Patrick Forny" date: "2023-10-01" --- Z-score based analysis. Load packages. ```{r packages} # Load packages library(pacman) p_load(data.table) p_load(tidyverse) p_load(readxl) ``` Load the data. ```{r load data and prep} # vector of ti...
9c59cbb9cec7382f85a3b24e55e7c167fbd5e5f4942963db23f7ebf09033fc46
R
10,791
288
#!/usr/bin/R # ----------------------------------------------- # Plot number of differential genes as a heatmap: # Updated: 09/28/21 # ----------------------------------------------- # Aggregate number of sign. genes: library(cbrbase) set_proj('DEVTRAJ') source(paste0(bindir, 'multiRegion/load_metadata.R')) library(ti...
32b94aaf16f39ce05c74a6b7809488f88453d967b12b30ccb967bc39341eee65
R
10,797
334
--- title: "DeepRVAT - Including random seed genes during training" author: "Eva Holtkamp" output: pdf_document: default html_notebook: default --- ```{r} library(arrow) library(tibble) library(tidyr) library(dplyr) library(ggplot2) library(cowplot) library(ggpubr) library(latex2exp) theme_set(theme_cowplot()) `...
1d4490cda6a62fc765326c4ad79a8e6c2521e806fa0fc43a0511b1906635cd24
R
10,807
412
--- title: "p_Contra (UBI, L, R; hand, machine)" author: "Yaromir Kobikov <kobikov.yaromir@gmail.com>" date: "10/7/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") ...
3af3a7d6abe716e599d85d81558a6ac6cd33d882729e21c8e4bc9b17d141013f
R
10,810
234
library(tibble) library(arrow) library(groupdata2) library(logger) ### name and input path settings ########## genetic_pcs = paste0("genetic_PC_", 1:20) prs = "prs" age = "age" sex = "genetic_sex" covariates_dict <- list(c(prs, age, genetic_pcs), c(prs, genetic_pcs), c(genetic_pcs), c(prs, age, sex, genetic_pcs), c(...
f150f918490cf14cd8949bc53ee417ded71bd4439fede1cc40f92725c4d8e915
R
10,877
301
library(tidyverse) library(broom) library(quickpsy) library(BayesFactor) library(rstatix) ########################################################################### # Load and preprocess data ------------------------------------------------ ########################################################################### ...
d3853858099c33ca521ceb7743f671c4df84a8da8802f8ac49332f4c454ad49b
R
10,899
317
--- title: "Plotting for ZIV: simulation and application" author: "Junting Ren" date: "2023-07-08" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) library(tidyverse) library(ggplot2) library(patchwork) ``` # Main simulation to evaluate algorithm validality ```{r} sim_result...
d6a3ff6d17aaa4a0718565c6a26a88745a6eba8d7f9f373c629a3e4eb63ec94c
R
10,909
194
Input="F:\\RNA_20221101\\02_ModifiedGenome\\A_GeneExpressionMatrix\\" library(dplyr) library(edgeR) library(ggplot2) library(stringr) data_filter <- read.csv(paste0(Input,"AutosomeGeneCount_filtered2.csv"), header = T, row.names = 1) POEgeneList <- read.csv("F:\\RNA_20221101\\02_ModifiedGenome\\C_POEgeneSel...
26128db587f3de79768b084b110668484cb0d3f84fc469ee9bc93836daee3eeb
R
10,915
295
#!/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/14/2020 # -----------------------------------------...
23a1b89f6c19451218e6db7b23f4643d56d298e21b41db0b22465c18f828351a
R
10,959
331
library(testthat) library(dplyr) test_that("build_3dlmer_command constructs valid strings", { cmd <- fmri.pipeline:::build_3dlmer_command( prefix = "myset", model_formula = "Group*Session + (1|Subj)", qVars = "Age", glt_codes = list(con1 = "Group : 1*patient -1*control"), data_table_file = "dt.tx...
302e0554edd73085644bc4d37dccbf0b488e5c063e377b5b19e1a2c876482a7c
R
10,990
197
Input="F:\\RNA_20221101\\02_ModifiedGenome\\A_GeneExpressionMatrix\\" library(dplyr) library(edgeR) library(ggplot2) library(stringr) data_filter <- read.csv(paste0(Input,"AutosomeGeneCount_filtered2.csv"), header = T, row.names = 1) POEgeneList <- read.csv("F:\\RNA_20221101\\02_ModifiedGenome\\C_POEgeneSel...
f36db6aefee05717b62fa3961df426be233b6a4898594202b4fd9ff1c20fa8c9
R
11,001
314
#!/usr/bin/R # ------------------------------------------------- # Make a heatmap across all regional shared/specific # Updated: 11/06/23 # ------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(bindir, 'multiRegion/load_metadata.R')) library(tidyr) library(...
d683ec5af6498bb338631f7cfd47d625418820a42664752f5ede64bd00eac17d
R
11,018
322
library(tidyverse) library(broom) library(quickpsy) ########################################################################### # Load and preprocess data ------------------------------------------------ ########################################################################### data <- read_csv("../../data/data_exp1...
ca4879ba9b6b47753bff50f7ecceb08fba294add10fab42351399b0918ceb9cb
R
11,035
288
#!/usr/bin/env Rscript # Script to correct for multiple sequence features across a list of binCov files # Note: Designed to be run on 24 chromosome-split files from the same library #Requires tab-delimmed input file with the following 4 columns: # 1: contig name # 2: full paths to binCov files for each contig # 3: fu...
f512c5d0f645f0418bcc8deea2cc1454598fa5f3c369923cf96f4807bd439ff8
R
11,039
414
--- title: "Bilateral rhizotomy. Analyse pContra UBI" author: "Yaromir Kobikov <kobikov.yaromir@gmail.com>" date: "11/1/2021" output: word_document: default html_document: toc: true toc_float: collapsed: false editor_options: chunk_output_type: inline --- ```{r setup, include=FALSE} source("../../BayesianPVa...
eded2e30e319b2bf9bc64aae44421f65d7b53fdfa4434d0b7df2de8a3f7c34e2
R
11,090
300
# devtools::install_github("mauritsunkel/EMC-SKlab-scRNAseq") library(EMC.SKlab.scRNAseq) ##### USER INITIALIZATION ##### ### USER CONFIG ### # general run_name <- "Bas_pipe_V8" # may be empty string: "" project_dir <- "C:/SynologyDrive/Projects/scRNAseqR" samples_dir <- file.path(project_dir, "data/samples/") # sam...
5db38b59388b3f8e23ce8b22ab3319511e79311fc08a0be514e6027a6ed00d91
R
11,104
267
#' --- #' title: "Reverse mapping of CustumArray oligos to original proteins" #' author: "Tomas Bjorklund" #' output: #' pdf_document: #' highlight: tango #' geometry: margin=0.7in #' --- #' This workflow aligns the short oligos from the CustomArray order to the full reference sequences using Bowtie2. This enabl...
56b1212d1535573c40b34acd1f67a16ac2ab4afa52be3573aac72d969f0d994e
R
11,165
323
check_columns_exist = function(.data, ...){ tryCatch({ .data |> select(...) # Try selecting the column TRUE # If successful, the column exists }, error = function(e) { # Print a warning with additional context warning( "sccomp says: please check typos in your formula_composition, formula_v...
fc830fb4879fa49b932803e142a0bbbe0daec9673ff25f1871eacaffe49b085a
R
11,183
289
basepath = "/net/trapnell/vol1/home/readdf/trapLabDir/hubmap/results/2022_04_03_redoATAC_proc_nobackup/" dir.create(paste0(basepath, "archr/results/NB10/")) out_dir = paste0(basepath, "archr/results/NB10/") setwd(out_dir) set.seed(7) # load requirements suppressPackageStartupMessages({ # library(ArchR) library(mo...
570bbeae357b9b1b0e31d1fff88aa657425ec53fcc9362d8d1f347ab01d01c86
R
11,200
162
process_cell_type_info <- function(reference, cell_type_names, CELL_MIN = 25) { message("Begin: process_cell_type_info") message(paste("process_cell_type_info: number of cells in reference:", dim(reference@counts)[2])) message(paste("process_cell_type_info: number of genes in reference:", dim(reference@count...
caa8a6f27a0650645416aba14fd040143b78bb1d28bd10e38e942d99b455990c
R
11,202
123
#modify color schemes for heatmap functions from NeuronChat #################### For Heatmap plot #' Heatmap plot with ligand abundance and target abundance for single ligand-target pair #' @param object a NeuronChat object #' @param interaction_name the ligand-target interaction used to plot #' @param sender.names se...
83ac286c2eac6c4cb704af2bd2a135b989c6856f73004ee7e58445663711f855
R
11,207
475
#### SpatialResults #### ## --------------------- SpatialResults <- function(model, data, featureData = if (!missing(data)) fData(data) else NULL, pixelData = if (!missing(data)) pData(data) else NULL) { new("SpatialResults", model=model, featureData=featureData, pixelData=pixelData) } setMethod("show", "Spatia...
10bf2cf0089e3cdb96820bc7bcb9c9ea4357df7b95daf38889054b0497ae14f5
R
11,243
315
############################################### GOTERMS ################################################ table1<- read.csv("MSADPrkMsNew_allClusters.markers.csv") library(org.Hs.eg.db) hs <- org.Hs.eg.db my.symbols <- as.character(table1 $gene) myEntrez<- select(hs, keys = my.symbols, columns = c("EN...
ff17c57c8ab1431f89345f9e3b163c01b2a1eba33e308076f5911b3bfd81931b
R
11,252
336
#' @name DEPRECATED-read.txt.Witec #' @concept moved to hySpc.read.txt #' #' @title (DEPRECATED) #' Import Raman spectra from Witec files #' #' @description #' #' These data input functions are **deprecated** and they will be removed in #' the next release of \pkg{hyperspec} package. #' Now functions in package ...
fcb596854e98b929519e0aa1dd3bd975dd7fb7ad4d438a07c20c40d9eee379e4
R
11,260
285
choose_sigma_gene <- function(sigma_init, Y, X1, X2, my_beta, nUMI,test_mode, verbose = F, n.iter = 100, MIN_CHANGE = 0.001, MAX_ITER_SIGMA = 10, PRECISION.THRESHOLD = .01, spase = F) { sigma_s_best <- sigma_init if(spase){ ...
c33e4664310c6b7080fd4d6c16beddec0136c1cf7ccc73380d60c3066f0bbed1
R
11,277
344
#!/usr/bin/R # -------------------------------------------------------- # Plot the aggregated DE results across different methods: # Raw counts of degs # Number of overlaps across region/condition # Updated: 03/22/22 # -------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiR...
0098642ba808ee75fd31ba9b39a9f14945c3bf07abec0a3c0446ffc37ad94161
R
11,278
290
basepath = "/net/trapnell/vol1/home/readdf/trapLabDir/hubmap/results/2021_07_15_Greg_ATAC_Code_nobackup/" dir.create(paste0(basepath, "archr/results/NB10/")) out_dir = paste0(basepath, "archr/results/NB10/") setwd(out_dir) set.seed(7) # load requirements suppressPackageStartupMessages({ # library(ArchR) library(m...
ab49035a382dbb832f8995e4220f0027dde1048ba8256dc96bfd46c0f385c891
R
11,320
416
--- title: "Bilateral adrenalectomy: p_Contra (Pre, after adx, ADX+UBI, hand, machine) " author: "Yaromir Kobikov <kobikov.yaromir@gmail.com>" date: "10/7/2021" output: word_document: default html_document: toc: true toc_float: collapsed: false editor_options: chunk_output_type: inline --- ```{r setup, inclu...
7101b72830ca7616a5c91e1cf04af9ed6996950004186fa9d859175c849f2eb2
R
11,380
294
library(tidyr) library(ggplot2) library(glmnet) library(ROCR) library(data.table) library(viridis) # 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"), t...
7d6b0671bca420296c7f031926d451d815a4db8f41033850e6b9098c5302e95d
R
11,410
320
--- title: "THRA Isoform 1 and Isoform 2 Expression pattern and exploration of dataset" output: html_document: toc: True toc_float: True df_print: paged --- INTRODUCTION to the Experiment GEO_GSE153076. Organoids generated from 3 replicate batches of H9 and G1 cell lines were collected at 7 time points ...
5782a5fa7f7553cf192f8b3cf6aac330b66e9f97e7742ea673fd8e9ae7c4aaf5
R
11,438
355
# load the reshape2 package library(reshape2) library(dplyr) library(lme4) library(lmerTest) ###################################################### #MT #metadata setwd("D:/PFC_427_WS/Vanshika") meta=read.csv("dataset_652_basic_04-23-2020.csv") meta=meta[,c("projid","age_death","pmi","msex","gpath")] setw...
b461a71c69946a8991d16ad3a84126b46279887ef2604606c66151a27968288f
R
11,544
307
init_directories <- function() { cat("Initializing directories...\n") directories <- c("bin", "data/facebase/counts", "docs", "logs/facebase", "logs/neuroblastoma", "output/facebase", "output/neuroblast...
ee1b064302994c1143dd984d9b64695d127c39822ef372879b467225c67d9241
R
11,557
338
#!/usr/bin/R # ---------------------------------- # Put together the full GWAS figure: # Updated 02/21/2022 # ---------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') if (!exists("cellmeta")){ source(paste0(sbindir, 'load_metadata.R')) } source(paste0(sbindir, 'auxiliary_pseudobulk_lo...
20cad16ba24340afb49f8ba02267b5cb02b3d32fda680330bd1e25ec67f6d258
R
11,564
406
#' Polynomial baseline fitting #' #' These functions fit polynomial baselines. #' #' @details #' Both functions fit polynomials to be used as baselines. If `apply.to` #' is `NULL`, a `hyperSpec` object with the polynomial coefficients #' is returned, otherwise the polynomials are evaluated on the spectral range #' of `...
0d54c249d6475ee7c61aa96e1e228ca4e54d255b9126d6d690388c4fd3109aef
R
11,571
351
#!/usr/bin/R # --------------------------------------------------------------------- # Compute and plot differences between subtypes for a certain celltype: # Updated 12/02/21 # --------------------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(sbindi...
a3d7813fddd54983cf78d8e52b74f438d65d1170e8bedb789a4ef1c5aa997b41
R
11,579
293
# Run to set up modules: ######### # module unload R/4.0.0 # module unload pcre2/10.35 # module unload proj/4.9.3 # module unload gdal/2.4.1 # module unload hdf5/1.10.1 # module add sqlite/3.32.3 proj/7.1.0 gdal/3.5.2 hdf5/1.10.5 pcre2/10.39 R/4.1.2 ########## # library(nebula) # #> Warning: package...
0296ebaccc1f1694e1716d0bf2d081c11deb175226924bd84d86806cd0ee2cd2
R
11,609
315
#' This function pauses execution of an R script while a scheduled qsub job is not yet complete. #' #' It is intended to give you control over job dependencies within R when the formal PBS #' depend approach is insufficient, especially in the case of a script that spawns child jobs that #' need to be scheduled or compl...
30b7dc86b68005df58956c259cf2d0f85c55ceb9f77def0894c49783c7639a8a
R
11,625
437
# Function ------------------------------------------------------------------- #' Bind `hyperSpec` objects #' #' Functions to bind `hyperSpec` objects. #' #' #' The former difficulties with binding S4 objects are resolved since R version #' 3.2.0 and `cbind()` and `rbind()` now work as intended and expected for #' `hy...
302f128ed030aeb7b7703d320ab378cb947ec49cc68901236f77a1bcca7ff011
R
11,655
269
library(dplyr) library(sccomp) library(tidyverse) data("seurat_obj") data("sce_obj") data("counts_obj") my_estimate_0_1_a = seurat_obj |> sccomp_estimate( formula_composition = ~ type + continuous_covariate, formula_variability = ~ 1, sample, cell_group, prior_overdispersion_mean_association = list(...
adeff667b35780b5c38fb623581c520658f5e63ccc7dbb44f75b0d7c2f421fbb
R
11,670
320
#!/usr/bin/R # ------------------------------------------- # Plots of top markers of vulnerable neurons: # Updated: 12/22/2021 # ------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(sbindir, 'load_metadata.R')) library(tidyr) library(viridis) library(ggplot2) li...
8dc6891829878799e2cecdc75d54fa8bf4626155ac99bf168104c07efefb859d
R
11,714
299
#' R6 class for running 3dFWHMx on a single input file based on user specification #' #' @importFrom R6 R6Class #' @details N.B. This class doesn't even expose the Gaussian ACF options given false positive problems #' @export afni_3dfwhmx <- R6::R6Class("afni_3dfwhmx", private = list( input_file = NULL, mask_...
bcc663a8b659c28b4d5369479f89667e976067a9f0477d1ed539cb91281e5ddd
R
11,716
229
#decompose with just two cell types #if score_mode, then returns the objective function score #if denoise, then it fits a "noise" dimension as the mean of all the data decompose_sparse <- function(cell_type_profiles, nUMI, bead, type1=NULL, type2=NULL, score_mode = FALSE, plot = F, custom_list = NULL, verbose=F, constr...
5426a17c110d2d55ab6d3fb19ed6e700e531c85a3aa8e93d0ac2bfb21aec5d90
R
11,757
286
library("Seurat") library("tidyverse") setwd("./Step5.FinalClustering") Seurat.SNC.final <- readRDS("Seurat.SNC.final.rds") ## DimPlot of the data Idents(Seurat.SNC.final) <- Seurat.SNC.final$seurat_clusters jpeg("Clusters.jpeg", width = 6.0, height = 6.0, unit = "in", res = 600) DimPlot(Seurat.SNC.final, label = T,...
2ebc6af9253012b8df3e2bde2d6fab4f780c46d90093d671f37ff15cefa01ef5
R
11,771
242
--- title: "figs_for_update" author: "T Attenborough" date: "2024-05-07" output: html_document --- ```{r} library(Seurat) #Seurat v4.0.2 library(dplyr) library(patchwork) library(here) library(ggplot2) library(clustree) library(SingleCellExperiment) library(scater) library(DoubletFinder) library(zellkonverter) library...
7a8d274fe8b0ccf0ded0a1649e505b3b002daebf4eb4edeb93afe32ac0db15f8
R
11,771
217
#' --- #' title: "Heatmap analysis output" #' author: "Tomas Bjorklund" #' output: #' pdf_document: #' highlight: tango #' geometry: margin=0.7in #' fontsize: 10pt #' --- #' A secondary approach to visualizing the top candidates and their relative abundance. suppressPackageStartupMessages(library(knitr)) #+ s...
95c5a08b250aabb7b58e7240b82c60b3609b119a508281aeab5998984cb5b953
R
11,781
232
#' --- #' title: "Clustering Polypeptide motifs using the Hammock hidden Markov model 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...
00c0df71968599609cf79ee9bd7221cd447bb95042950f03794555bb8cc6fa29
R
11,805
249
#!/usr/bin/env Rscript # Parse KING output to assign relatedness ###Set master parameters & load libraries options(stringsAsFactors=F,scipen=1000) require(e1071) ################### ###HELPER FUNCTIONS ################### #Import fam file and split into relative classes #Note: assumes parents of trios are not dire...
aed8b4e77f695e12ac3a05243c28dc0f681dd18c9a23b40514e663915c018d09
R
11,849
434
--- title: "Bilateral rhizotomy. Analyse Pa UBI" author: "Yaromir Kobikov <kobikov.yaromir@gmail.com>" date: "10/27/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....
52b50110d485e584ec2208492a690927bb1ac51355c49524ba5b144eec82a31f
R
11,852
363
#!/usr/bin/R # -------------------------------------------------- # Part of metabolic modules figures # - GO enrichments # - Distr vs. regions/path # Updated 06/19/2023 # -------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') if (!exists("cellmeta")){ source(paste0(sb...
373030935e397bb6d0e75219fe1c17dbd99942b37d8f48998ba072def8be83c1
R
11,867
339
--- title: "Rare cell type detection" output: html_notebook --- ```{r} #Generate simulated data using RaceID intestinal data library(RaceID) #RaceID3 library(tidyverse) library(ggsci) library(ROGUE) library(Seurat) ## input data x <- read.csv("/home/pauling/projects/04_SEmodel/07_NC_revision/03.data/02.Rare.cell.t...
240ff8bee1c594879dd3e230e3486eb723f032f2f593dccef131adb5d083cef9
R
11,892
204
test_single_beads <- function(puck, gene_list, cell_type_info, trust_model = FALSE, constrain = T, OLS = F) { cell_type_names = cell_type_info[[2]]; n_cell_types = cell_type_info[[3]] beads = t(as.matrix(puck@counts[gene_list,])) weights = decompose_batch(puck@nUMI, cell_type_info[[1]], beads, gene_list, constrai...
f537db8ee4bae13cdd1d909de82a5386af0baeb3bc8a4a54629adf6d03737336
R
11,896
206
#This script import and process scRNA-seq from 24,48,72 and 96 hours of orginal human gastruloids (Moris et al., 2021) #The processed .RDS files from this script are provided at National Center for Biotechnology Information (NCBI) Gene Expression Omnibus (GEO) under accession numbers GSE208369 suppressPackageStartupMe...