sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
bda8d882792e615aa10ae2b7df88a591bbe9dc7bf47a3c06edcb9f0b33f04d83
R
11,902
331
#!/usr/bin/R # ------------------------------------------------------------------------- # Run MAST + wilcoxon (Nebula in other script) using the precomp. matrices: # Updated: 10/31/23 to add interaction # ------------------------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'mu...
7ca1e24af72da235105716713c1535a070cf3f7b8f829c34de8ebfb2cd5f32c3
R
11,917
339
make_fwe_execution_test_gpa <- function(root, create_smoothness = TRUE) { l3_feat <- file.path( root, "feat_l3", "L3m-l3_group", "L1m-facehouse", "L2m-l2_session", "l2c-overall", "FEAT_l1c-EV_face.gfeat" ) image_feat_dir <- file.path(l3_feat, "cope1.feat") stats_dir <- file.path(image_feat_dir, "stats")...
0c0b5baffab172cbfb291bfa1da3a3d16c26cc7e43b737af276bc35fbaa79e02
R
11,931
369
#' @name DEPRECATED-read.jdx #' @concept moved to hySpc.read.jdx #' #' @title (DEPRECATED) #' JCAMP-DX import for Shimadzu library spectra #' #' @description #' This function is **deprecated** and will be removed in the next release #' of \pkg{hyperSpec} package. #' Please use function `hySpc.read.jdx::read_jd...
69507617dbbdeb08b5d61d0f1572ff6a4ca9fe0d6b53120b49939a72a86146d5
R
11,931
309
#####对于没有删除样本的组 Input="F:\\RNA_20221101\\02_ModifiedGenome\\A_GeneExpressionMatrix\\" library(dplyr) library(edgeR) library(ggplot2) data_filter <- read.csv(paste0(Input,"AutosomeGeneCount_filtered2.csv"), header = T, row.names = 1) ###------------------------------------Function----------------------------...
307ccdb08d5db47639c5b39d7efd1fa51960cf12a9f3d86976080e42c2d8a947
R
11,940
338
### --------------------------------------------------------------------------~ ### ### .extract - internal function doing the work for extracting with [] and [[]] ### ### --------------------------------------------------------------------------~ # Function ------------------------------------------------------------...
c162cbbc3e1fa95d19c434f88df0e3bd35052d614c4541196fedd12f6b7cfb1c
R
11,941
228
#' --- #' 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...
d2c3a5d3364a00d4d820d53e0954bd0e45893115fa4cbac5a3355fa663b15121
R
11,978
262
find_genes <- function(myRCTD, cell_types, MEAN_VAL_THRESH=5, TOT_THRESH=100) { mean_val <- myRCTD@de_results$gene_fits$mean_val # Cell type mean gene expression from CSIDE mean_val <- mean_val[,cell_types] # find genes with well-behaved estimates i.e. low variance tot <- rowSums(myRCTD@spatialRNA@maternalCount...
3ce13c923cfdc9af4c5810352b3868a2ec8faba21dfa5dd7526df3e5aee5b322
R
11,985
362
# Derived from revtools code, copyright Martin J Westgate # Adapted by Lukas Wallrich, still unter GPL-3 licence add_green <- function(x) { paste('<span style="color: green">', x, '</span>') } clean_text <- function(str) { str %>% # Remove editions like "2nd Ed." gsub("(\\d+(?:st|nd|rd|th)\\s*Ed[\\. ])", ...
8682f64db6e24a1c0007e2f990a60d33d62dc11f97536c1da5ddecc720aaf584
R
12,066
288
#!/usr/bin/env Rscript # Helper script to determine categories of SV that # don't meet a minimum Mendelian violation rate (MVR) ###Set master parameters options(stringsAsFactors=F,scipen=1000) ################### ###HELPER FUNCTIONS ################### #Clean input data cleanDat <- function(dat){ #Drop variant I...
d10289f106e79a3a091bd13856c207d323eadf66b7d8a60070e3b95e3ba2f60d
R
12,071
303
#' --- #' title: "Library fragment alignment" #' author: "Tomas Bjorklund" #' output: #' pdf_document: #' highlight: tango #' geometry: margin=0.7in #' --- #' This workflow identifies correct fragments from the Cre-recombined AAV plasmid library and aligns them to the CustumArray ordered nucleotide fragments usi...
c60e0bd1ed8163bcd26d93b4f94e3abe0599f40aa6f0d6ca70120f743262d9ed
R
12,075
347
basepath = "/net/trapnell/vol1/home/readdf/trapLabDir/hubmap/results/2022_04_03_redoATAC_proc_nobackup/" dir.create(paste0(basepath, "archr/results/")) out_dir = paste0(basepath, "archr/results/NB2_Peak_UMAP/") dir.create(out_dir) setwd(out_dir) # DFR add source("/net/trapnell/vol1/home/readdf/trapLabDir/sharedProjec...
60e687b60a3e09a47304fb3b67ad198c534af5d5490ea75d4da146e9f246c4ec
R
12,092
315
##POE gene identification Input="F:\\RNA_20221101\\02_ModifiedGenome\\A_GeneExpressionMatrix\\" library(dplyr) library(edgeR) library(ggplot2) data_filter <- read.csv(paste0(Input,"AutosomeGeneCount_filtered2.csv"), header = T, row.names = 1) ###------------------------------------Function------------------...
7da6b7a46c57ac72aa00e17485bc3c6cbecb056f038ad10bbe6a9d45579953fb
R
12,123
372
#' @name DEPRECATED-wlconv #' @concept deprecated #' #' @title (DEPRECATED) #' Convert different wavelength units #' #' @description #' These \pkg{hyperSpec} functions are **deprecated** and not maintained any #' more. You should not use these. #' Currently they are present due to back-compatibility reasons and ...
ecaac3303e0e931c03cf390b7a9867065c5a17aec63dc384b968be9dbd8cbb7f
R
12,158
226
#!/usr/bin/env Rscript ## ----------Script----------------- ## ## Author: Szi Kay Leung (S.K.Leung@exeter.ac.uk) ## simple analysis rewiew ## find reference genes ## correlation ## ## -------------------------------- library("dplyr") library("stringr") library("cowplot") library("data.table") library("ggplot2")...
b908907ef996b982576549ac5fa0f11c101e34288a4303bffe47fbe0761dbdf7
R
12,209
408
#' The theta method as in the forecast package #' but with seasonality forced to FALSE #' @param y The time-series #' @param h The forecast horizon #' @param level Confidence levels for prediction intervals #' @param fan If TRUE, level is set to seq(51,99,by=3). This is suitable for fan plots. #' @param x Deprecated. I...
b7814f60f8928246d6033aebbf4a1b79f31053b6e0c770c42061102b156e209b
R
12,235
360
rm(list = ls()) ############################# ## Load Relevant Libraries ## ############################# require(ggplot2) require(Hmisc) require(MASS) require(mgcv) require(ppcor) require(stringr) require(visreg) require(parallel) require(multilevel) require(stats) require(Formula) require(lavaan) require(lme4) requi...
ceec94dc2c8c8219f3d34d16693e000b964a2316309954ab4268c7b9fc3b5c63
R
12,236
325
library(tidyr) library(ggplot2) library(glmnet) library("optparse") # Get the passed parameters option_list = list( make_option(c("-p", "--pValFIMOcutoff"), type="numeric", default=1e-6, help="Max FIMO p value to retain match", metavar="character"), make_option(c("-f", "--featureSelection"),...
eecad417f984215ed25c9e12043dc50bb8c6debe431286ca9c29a35fe54a342a
R
12,283
355
### match IXI sample to chimp under 41 sample ### wd <- "~/projects/chimp_human_opnmf/" setwd(wd) library("readr") library("ggplot2") library("MASS") library("dplyr") library("fs") library("stringr") library("MatchIt") library("optmatch") library("rgenoud") library("broom") #library("emmeans") no package by this name...
5f3b27b750a68af9dc3e7ed8a734dfaab607331a869e9b728724196c6327c168
R
12,297
252
#!/usr/bin/env R #Construct_fasta_variant_sequences.R ################################################################################ #This script is used to convert a phased VCF to a table that can more easily be #parsed and used by a later script, Construct_fasta_variant_sequences.R # #Run under R 3.4.3, but can be...
d5b72247f526127bd14f127754e2cb234ab1e7def90679c5476860a40986250a
R
12,301
404
--- # For vignette --------------------------------------------------------------- title: Unstable Laser Emission subtitle: "Example Workflow for Time-Series Spectra Dataset `laser`" description: "laser: Example workflow for time-series spectra dataset `laser`." # Authors --------------------------------------...
40129d037984c73fe96d13d6e6dd0883d58a27d042598fd4b90a2c98054d9fc3
R
12,320
334
library(readr) library(dplyr) library(tidyr) library(data.table) library(lgr) library(foreach) library(doParallel) library(emmeans) library(glue) library(oro.nifti) library(RNifti) library(ggplot2) # library(fmri.pipeline) # setwd() # setwd("~/Data_Analysis/r_packages/fmri.pipeline/R") #file.sources <- list.files("~/D...
72de6563be414f5c50f0ce83932c5c730065c8f6ec08652236dc8010ea8ab0e7
R
12,328
304
library(data.table) library(dplyr) library(foreach) library(doParallel) require(argparse) ####################### ### Notes # GWAS 1 is the reference SNP # Compute per chromosome ####################### ####################### # Parser arguments ####################### ### Define parser arguments parser <- argparse::...
2649b7f473b0e1317f528050c29333b6fee7eba90a3de23666ea9c96ca2fdcb7
R
12,338
346
library(tidyverse) library(broom) library(glmnet) library(glmnetUtils) library(cowplot) ########################################################################### # Load and clean data ---------------------------------------------------- ########################################################################### da...
9d4a35b9eaa98c45113601824681818721b23cb8b74e222e0d978060cadeab70
R
12,388
317
# EYE SIZE AND VISUAL ACUITY, EXPERIMENT WITH MALES AND FEMALES, UP- AND DOWN-SELECTED FOR TELENCEPHALON SIZE, # GENERATION 3, 5% DIFFERENCES IN TELENCEPHALON SIZE, 234 FISH # OCTOBER - NOVEMBER 2020, DATA COLLECTED BY MADDI GARATE-OLAIZOLA #----------------------------------------------------------------------------...
1633a30c9ef06eedda957c58080a5d228b31bbfdc03374c68596bef39a281c06
R
12,393
399
--- title: "DeepRVAT - Seed Genes Downsampled figures" author: "Eva Holtkamp" output: pdf_document: default html_notebook: default --- Load libraries ```{r} library(ggplot2) library(arrow) library(dplyr) library(stringr) library(tidyr) library(latex2exp) library(RColorBrewer) library(ggpubr) ``` ```{r} source(f...
30ae776bb29d00706526d48d2a2c3e4a6efcf91014847754a96c431ca639a694
R
12,405
320
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(parallel);library(ROGUE) expr <- readr::read_csv("/data1/pauling/04_SEmodel/07_NC_r...
0bddfbe814408933e748b19834b760e00676d86c77bc5f8737427604f49c52e1
R
12,426
341
--- title: "RTqPCR Data Analysis" author: "Jenn Kim" date: "17/10/2023" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` # MAIN FIGURES ### Load libraries ```{r} library(tidyverse) library(xlsx) library(ComplexHeatmap) library(dendsort) library(cowplot) library(ggplot2) th...
e340d7a96a70fe0d0052c077cfd35e3fee721b076cb8ae489cf01c1537ba6ff7
R
12,442
328
library(tidyr) library(ggplot2) library(glmnet) library("optparse") # Get the passed parameters option_list = list( make_option(c("-p", "--pValFIMOcutoff"), type="numeric", default=1e-6, help="Max FIMO p value to retain match", metavar="character"), make_option(c("-f", "--featureSelection"),...
190db4ca6156ab32b7df3334c9b0585ff5e65b885617c98b256e957a740aefa6
R
12,451
409
#' Create a `hyperSpec` Object #' #' To create a new `hyperSpec` object, you can use one of the following functions: #' - [new()] (i.e., `new("hyperSpec", ...)`); #' - `hyperSpec()`. #' #' @note #' #' A `hyperSpec` object is an S4 object, so its initialization is performed #' by calling `new("hyperSpec", ...)`. The fun...
714ed506e39795361d0360f70f10260aae5b3df2a1ac234ed77dbe413b4dda88
R
12,469
292
--- title: "R Notebook" output: html_notebook --- ```{r} library(RaceID) #RaceID3 library(tidyverse) library(ggsci) library(ROGUE) library(Seurat) ``` #Load data ```{r} cl.sce <- readr::read_rds("/data1/pauling/04_SEmodel/07_NC_revision/03.data/01.clustering.ari/01.10x.5cl/sce.rds.gz") cda <- readr::read_csv("/dat...
7963bb21a68f854753f854eb6f0192b63a2623295d6cd83eb8ca33f9cb4df212
R
12,495
266
.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 ...
c986413f99816499cd0d03f0f0f2a83634e3b4c848ef9f3c278a26e8f34430ba
R
12,503
372
################################################################################ #MULTIVARIATE ANALYSIS ON BEHAVIOURAL DATA OF YOUNG AND OLDER ADULTS ################################################################################ #LOAD DATA setwd("/Users/au685269/Library/CloudStorage/OneDrive-AarhusUniversitet/Add...
730442cec78fdb46df359ddc9add31e663275fb5724240d05a5d179e664726d2
R
12,506
392
#' #' Tests whether user-defined input and output directories and their paths exist. #' The output directory should not yet exist, but the input directory should. #' #' @param input_dir Path of an existing directory. #' @param output_dir A path whose base name exists but the destination directory does not. #' #' @retu...
0645b659e4ab04382757da9bdac25816b5f477ad7530cfb3aeaccfdc43466bd4
R
12,517
278
################################# PCA based clustering ########################################################## # http://www.sthda.com/english/articles/31-principal-component-methods-in-r-practical-guide/117-hcpc-hierarchical-clustering-on-principal-components-essentials/ library(FactoMineR) library(factoextra) lib...
8c446d757b614c6c365c8ef26c8c0bb76de6b56c3028d07d91fd0fae4da14c24
R
12,546
406
test_that("extract_spm_l2_projection aligns runs and drops intercept/constant columns", { gpa <- create_mock_gpa(n_subjects = 1, n_runs = 2, include_l1_models = TRUE, include_l2_models = FALSE) gpa$glm_settings <- list(spm = list()) gpa$l2_models <- list( models = list( l2_main = list( name = "...
9fe29885bdf469f6c0d60796ed6457a2f734250ac4c504abacee6d3120ea61cc
R
12,547
288
#' --- #' title: "Analysis plots for AAV plasmid library and coverage" #' author: "Tomas Bjorklund" #' output: #' pdf_document: #' highlight: tango #' geometry: margin=0.7in #' fontsize: 10pt #' --- #' This script provides a number of measurements on the AAV plasmid library and the readouts in vitro & in vivo. ...
0052a39a4b5c34f82d80a1f9eb20665faaaa6c29031d0f8cb77ab74bee2d0c93
R
12,579
263
# function to compute lme and make spaghetti plot spaghettiPlot2 <- function(data2use, x_var, y_var, subgrp_var, cov_vars=NULL, xLabel, yLabel, modelType = "quadratic", fname2save = NULL, plot_dots = TRUE, plot_lines = TRUE, dot_alpha = 1/...
73bf19072eea15047d00eaeecf18296eb3bfad9f95716a3173e492455d380e8c
R
12,665
322
#' Calculate Proportional Fold Change from sccomp Estimated Effects #' #' @description #' This function calculates the proportional fold change between two conditions using the estimated effects from a sccomp model. #' The fold changes are derived from the model's posterior predictions rather than raw counts, providin...
06b38ff20d2e09354fb644ce214f641e20638cb3ba033107be4a945472e13b50
R
12,686
402
#!/usr/bin/R # ------------------------------------------------------- # Plots for the integrated neuronal trajectory from DEGs: # Updated: 03/01/2022 # ------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(sbindir, 'load_metadata.R')) library(tidyr) ...
cd7bfa4a099ca6e288577e0dd14e888b5e2bfdf2a31494ab5d47422ca2be0273
R
12,688
361
#!/usr/bin/env Rscript # This script generates SPM contrasts from an fmri.pipeline L1 model contrast matrix. args <- commandArgs(trailingOnly = FALSE) scriptpath <- dirname(sub("--file=", "", grep("--file=", args, fixed = TRUE, value = TRUE), fixed = TRUE)) argpos <- grep("--args", args, fixed = TRUE) if (length(arg...
4c5efdfdffc033040a0743999a296000849db65c9bc9764c12e78433493d982a
R
12,730
364
#!/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...
676fc8620e893a96f71d0b93ad4d01c67ed3a3b1817ff3941ed70840f7189eed
R
12,732
359
#' Output GLM configuration to a '.yaml' or 'json' file #' @param gpa the `glm_pipeline_arguments` object with relevant fields already populated, including #' `$l1_models`, `$l2_models`, and/or `$l3_models`. #' @param file the filename for the exported configuration file #' @return invisibly return the YAML/JSON synt...
bc43efbbb17befb6ebf5c2252b1b7699622f67149ae494027608e04d4001f0e8
R
12,756
308
basepath = "/net/trapnell/vol1/home/readdf/trapLabDir/hubmap/results/2021_07_15_Greg_ATAC_Code_nobackup/" dir.create(paste0(basepath, "archr/results/NB8/")) out_dir = paste0(basepath, "archr/results/NB8/") setwd(out_dir) set.seed(7) # load requirements suppressPackageStartupMessages({ library(ArchR) library(monoc...
abe209b7c5968c2759c7076c334f45c4dd8cc47a51987bfdfb1f1a0fb0049141
R
12,759
245
#' Run DEA on processed Seurat object #' #' Perform differential expression analysis on processed and annotated Seurat object. #' #' @param sample_name sample name, string #' @param qs_file character string file path to .qs file of processed Seurat object #' @param output_dir output directory for plots, string #' @para...
2f73e3a6e3a76e474727c01ab39b75e16f4b3dbac971f46aa0cdc3a115be4d82
R
12,783
206
#' archstabms__random_library_design #' #' Random library design. #' #' @param ddpca_outpath path to ddPCA data (required) #' @param position_offset residue position offset (default:0) #' @param fitness_abundance_file path to abundance fitness data (required) #' @param fitness_binding_file path to binding fitness data...
f17102a9085ef58a8cf47955ee66c5b69c1169cd00cef0a9e7590451244ffc7b
R
12,805
305
plot.genotypes.qtl <- function(msg_cross_object, scanone_object, phenotype, format, zoom, plot_title){ ####plot.genotypes.qtl plots all the genotypes of individuals ordered according to the value of a phenotype and the QTL corresponding to that phenotype ####USAGE ####plot.genotypes.qtl(msg_cross_object, scanone_obje...
3cc956db0fa200dd78464d79e248a568e14b4970c5f6e4bc66f9f91f843aeac8
R
12,822
339
--- title: "Beta binomial cell type abundance testing" output: html_notebook date: "9/8/2021" author: "Lauren Saunders" --- ```{r setup, echo=FALSE, warning=FALSE, message=FALSE} knitr::opts_chunk$set(warning = FALSE) knitr::opts_knit$set(progress = TRUE, verbose = FALSE) suppressPackageStartupMessages({ l...
fb025ed3dba1da2e246454df5bcaf158ceab61d091b8526bdc9db432f1c002ba
R
12,842
295
#' Main function for detecting spatial allele-specific expression (ASE) patterns #' #' Fits a beta-binomial thin plate regression spline for each gene. #' #' @description This function fits a spatial beta-binomial model, estimates a #' 2D smoothed probability function, and stores information for plotting results. #' Us...
ee03b5b6e9df9c7f7d9a2aca123dd9e4e9374422c6b71f9b7f4eeeb7b12ec16f
R
12,896
225
--- title: "Azimuth annotation" output: html_document: theme: united df_print: kable date: 'Compiled: `r format(Sys.Date(), "%B %d, %Y")`' --- *** ```{r setup, include=FALSE} all_times <- list() # store the time for each chunk knitr::knit_hooks$set(time_it = local({ now <- NULL function(before, option...
7fb6d64e4f29c3857ea5f700ddb4e8aca164895474e660bd602a65ea994df9b8
R
12,899
253
--- title: "Nurr1 project clustering" author: "Yuvarani Masarapu" date: "11/18/2022" output: html_document: code_folding: hide toc: TRUE --- ```{r} library(SeuratObject) library(Seurat) library(harmony) library(sctransform) library(Matrix) library(RColorBrewer) library(ggplot2) ``` ### Load filtered seurat...
6aedbc32baaa2ab4546c96200d9df864914164cf472068bbdd14b5cc98c568f1
R
12,947
378
#!/usr/bin/env Rscript # Script to score dosage bias per sample #Inputs: # 1) a binCov matrix subsetted to the testing bins of interest # 2) a list of bins with signed weights per bin #################################### #####Set parameters & load libraries #################################### options(scipen=1000,st...
62fb99be7ac7a3c7d7219042eada8eae8bd96d49339f263a5cf7b3ec2d1b7bc4
R
12,984
358
# Trying: # qlogin -l mfree=20G -q trapnell-login.q -pe serial 16 -l centos=7 # Trying this on 7-20-21. (Didn't work, going back to 20g) # qlogin -l mfree=40G -q trapnell-login.q -pe serial 16 -l centos=7 basepath = "/net/trapnell/vol1/home/readdf/trapLabDir/hubmap/results/2021_07_15_Greg_ATAC_Code_nobackup/"...
a7f5e9d323773d2074eafbfc4e69d934416cff66a08213152a19c1cb420ef157
R
12,985
293
#bsub -q taki_normal -J "ml[1-4]" -M 40000 -o ~/Documents/nnbatch/run_ml.txt bash -c "Rscript /home/fengling/Documents/nnbatch/code/run_ML_battery.R" source("~/Documents/nnbatch/code/load_packages.R") setwd("~/Documents/nnbatch") #ML library(caret) library(randomForest) library(xgboost) library(e1071) library(MASS) lib...
d770d76491ff4fe8b86f6ae1e4170ceca0f66d14baf755ca9795843a02feaec5
R
12,986
453
--- title: "Bilateral rhizotomy. Analyse PAS 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...
563b4682a9fae5e58badcc1350a9c79e41fcbe7fcb29b8ec391f53c0739ee09a
R
13,089
365
#!/usr/bin/R # ----------------------------------------------------- # Starting from all DEG results, # - Plot the lFC for diff. pathology against each other # NOTE: mostly preliminary, not finished analysis # Updated: 05/18/23 # ----------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ',...
8cf9a70a1298962e0c3c682498f4236bad0a69bee98a4c0787bd37b036ab80df
R
13,115
303
--- title: "prep_for_velo_sporos" author: "T Attenborough" date: "16/01/2023" output: html_document --- The other packages are on CRAN. ```{r, message=FALSE} library(remotes) library(Seurat) library(zeallot) # For %<-% that unpacks lists in the Python manner library(DropletUtils) library(tidyverse) library(GGally) # F...
9486cea6880a9b71c6176202efc61556b1898a5344bc1caa4678095aeb48e716
R
13,116
303
--- title: "prep_for_velo_sporos" author: "T Attenborough" date: "16/01/2023" output: html_document --- The other packages are on CRAN. ```{r, message=FALSE} library(remotes) library(Seurat) library(zeallot) # For %<-% that unpacks lists in the Python manner library(DropletUtils) library(tidyverse) library(GGally) # F...
ebcd454a3b414d8366ce56028765db5f28ca56c814e846628b5ca93879ff2f0b
R
13,118
303
--- title: "prep_for_velo_sporos" author: "T Attenborough" date: "16/01/2023" output: html_document --- The other packages are on CRAN. ```{r, message=FALSE} library(remotes) library(Seurat) library(zeallot) # For %<-% that unpacks lists in the Python manner library(DropletUtils) library(tidyverse) library(GGally) # F...
96b13f440ef6512e04914938167b70a31db8921082ea75dec13ff3c97a7ef1f0
R
13,124
314
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"...
27e34e36d382ffa8c8718406112777f318694edb2036cb7cf15252d36fe36bc3
R
13,126
303
--- title: "prep_for_velo_sporos" author: "T Attenborough" date: "16/01/2023" output: html_document --- The other packages are on CRAN. ```{r, message=FALSE} library(remotes) library(Seurat) library(zeallot) # For %<-% that unpacks lists in the Python manner library(DropletUtils) library(tidyverse) library(GGally) # F...
2e2f23bb81553ad11e55ba4803d6eabec883b60af1117c74c1468163e43bbca0
R
13,132
472
globalVariables("cont") globalVariables("contrast") globalVariables("grupo") globalVariables("type") globalVariables("table") globalVariables("ranking") globalVariables("association") # READING AND NORMALIZATION FUNCTIONS obtaining_annotations <- function(){ annotation_packages <- grep(x = as.data.frame(installed.p...
e09e377c9a37d2a503c9e9f361957e32ecf637e4f15397c5110039e7b0b59822
R
13,163
387
#!/usr/bin/R # ------------------------------------------------------- # Plots for the integrated neuronal trajectory from DEGs # Focusing on DPT pseudotime # Updated: 03/02/2022 # ------------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(sbindir, 'load_me...
075a84b8785d18f1a6841a783bc40c8ae6f8ffe6c68b57e84b1e38c61b949524
R
13,174
329
#' Setup a third-level SPM model using lower-level con images #' #' @param l3_df a data.frame containing one row per L3 input map, typically one row per subject/session, with fields including #' id, session, l1_model, l3_model, l1_cope_name, and con_file #' @param gpa a gpa (glm_pipeline_arguments) object containing ...
4453d2f024ed132f1351d3e2c22e88c411f9c2e43b08882c4182da6eb6391ef2
R
13,188
323
#!/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 # # Run with filters for low expr. genes, ...
0a2a806b2fab83e7bdf962db7188461c95ca250eb3d63f4e0e48afd8750db3c8
R
13,191
340
######################### ########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...
f3be89466fe5caa5fa44c28a7f127665eae2525663f2a2e9c0920a893207b080
R
13,418
426
--- title: "dartseq replicates of HEK293-T" 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 HEK293-T cell line. #### YTH, V1 `...
98082f03cae3549027c10eb35026f2fc808e09c67506ce295e584ae16024fc77
R
13,480
357
#!/usr/bin/R # -------------------------------------------------- # Starting from all DEG results, # - Predict each region from others + from pathology # Updated: 11/02/23 # -------------------------------------------------- library(cbrbase) set_proj('DEVTRAJ', 'multiRegion') source(paste0(sbindir, 'load_metadata.R')) ...
fea2677b7b6be3ddd5fd07b62db8c79f0599def51a5e7a260a06fe5b8e481581
R
13,496
431
require(testthat) require(Cardinal) context("stats") test_that("PCA", { set.seed(1, kind="L'Ecuyer-CMRG") s <- simulateImage(preset=1, dim=c(10L, 10L)) pc <- PCA(s, ncomp=2) pred <- predict(pc, newdata=s) x <- t(spectra(s)) pc2 <- prcomp(x) pred2 <- predict(pc2, newdata=x) expect_equivalent(pc$sdev, pc2$s...
d964502e2aa515dc716a6aaeaa57c4cf95e52e85c50c73e21805d623ff872b66
R
13,572
395
# Greg Booth 2021 # run with qlogin session on multiple cores: # qlogin -q trapnell-login.q -l mfree=25G -pe serial 4 # This script integrates sciATAC and sciRNA from HEART using ArchR # The sciATAC data is already stored in an ArchR project # The sciRNA data is pulled in as a cds object and converted to seurat f...
fe1c7806936bf470861ea667083011ac7fcd3431987d4b489a873a2a4053a139
R
13,581
350
library(Matrix) library(irlba) library(Seurat) library(plyr) library(dplyr) library(stringr) library(GenomicRanges) options(stringsAsFactors = FALSE) .get_aux_files = function(mtx_file) { base_name = str_replace(mtx_file, '[.]gz$', '') base_name = str_replace(base_name, '[.]mtx$', '') features_file = paste0(b...
61bace130843f3a16c795dc67bd3edad553d33cdde3d2b4b916dc61a3003d505
R
13,590
249
--- title: "DeepCombat" output: html_document --- # Preprocessing ```{r} source("./code/load_packages.R") raw <- as.matrix(read.csv("./data/raw.csv", header = F)) covariates <- read.csv("./data/covariates.csv", stringsAsFactors = T) covariates$X.1 <- covariates$X.1 + 1 final_visits_covariates <- covariates %>% group_b...
d29b4dbc870cb5c004a82a78778e80f3510e33bf38226745e4069ca82754a401
R
13,662
264
fake_coords <- function(counts) { coords <- data.frame(as.matrix(Matrix(0,nrow=dim(counts)[2],ncol=2))) colnames(coords) <- c('x','y') rownames(coords) <- colnames(counts) return(coords) } #' Creates a SpatialRNA object from a 10x Genomics Visium `outs` directory #' #' Given a SpatialRNA directory 10x Genomi...
57bae4c1d9077dc1d6416ba09f9f33a98b90f3a32f4fb70b3cbc21bd4f8ca78a
R
13,711
416
# For the specified k, conduct PCA on the cognition and network reconfiguration # variables separately to check the relationship between the first PC and PLSC # dimension. Also plot first and second PC loadings to see which network reconfiguration # variables are similar and examine variance explained. # Output: # ne...
591385190d077cd079aeb056bd0c8378dc4dde4dbb0b953fabe19b89db990b38
R
13,731
276
```{r init} library(Matrix) library(monocle3) library(tricycle) library(dplyr) library(RColorBrewer) library(scales) library(ggplot2) ``` ```{r load data} cds <- readRDS('E36_v2.rds') fname <- 'Figure5' S_matrix <- SingleCellExperiment::reducedDims(cds)[['UMAP']] data_df <- data.frame(S_matrix) colnames(data_df) <- ...
1bb5fedba8adc86d9133c2d8b17b5676d1118b9369068b8448ca5131c45c73c9
R
13,777
498
#### XDataFrame #### ## ----------------- .valid_XDataFrame <- function(object) { errors <- NULL nms <- names(object) keys <- object@keys if ( length(keys) > 0L && is.null(nms) ) errors <- c(errors , "'keys' must be a named list") strings <- vapply(keys, is.character, logical(1L)) if ( !all(strings) ) error...
b1b6476a414947fe813a54e4e336e2444a38b1a50b8256f57500ed933da7ff4a
R
13,779
490
test_that("generate_spm_mat handles concatenated ts_files and non-concat mismatch", { skip_if_not_installed("RNifti") tmp_dir <- tempfile("spm_mat_") dir.create(tmp_dir, recursive = TRUE) make_nifti <- function(path, nvol = 5L) { dims <- c(2L, 2L, 2L, nvol) img <- RNifti::asNifti(array(0, dim = dims))...
54f8e7b01aeee33ec80a80cbf77c2f88c49710175ddd98d152bb3c4f3d89b414
R
13,792
419
library(cicero) library(monocle3) library(ArchR) library(batchelor) ## Clusters 2 and 11 (CN7 based clusters) proj <- loadArchRProject('/ArchR/subprojects/clusters_shendure_drop_SMN_CN12') proj <- proj[proj$Sample %in% c('cluster2', 'cluster11')] ## Call new peaks on just this cluster; iterative sub-clsering - re-clus...
142edf8c7888697b5dba92b3d98ad68a731bb473363304c538d204ca326bb05d
R
13,842
189
#################################################################################################### ### ### File: 06_EEG_results_data.r ### Purpose: Loading the results data to obtain the statistics ### and get differences among the work. ### Authors: Gabriel Rodrigues Palma, Rafael Moral ### Date: 08/0...
c6228d213aef2ee1ae87cd5a7f8911b6fde12a2a03156b0f7a0d6c7b341a0c2d
R
13,874
342
#https://bids-specification.readthedocs.io/en/stable/appendices/entities.html #' Function for extracting fields from BIDS filenames (mostly generated correctly by ChatGPT) #' @param filenames a character vector of BIDS filenames #' @return a `data.frame` containing the fields extraced from `filenames` #' @importFrom c...
7a788d1135c92d499a8e297072b5217fdb7793647a17fb055eea6d63d0bec732
R
13,878
322
# Hypothesis testing for smooth (spline) terms. # # `sccomp_test_smooth()` tests whether the mean composition differs between two # positions (or two intervals) of a continuous covariate entered as a smooth # `s()` term. It is a thin wrapper that: # 1. predicts the *mean* linear predictor (`mu_unconstrained`, the log...
c9d8b5835da62b369105b63029e35332f92dbf91c2cbb82e9056cc274b0e2780
R
13,940
479
#### Spectral pre-processing #### ## ------------------------------ setMethod("addProcessing", "SpectralImagingData", function(object, FUN, label, metadata = list(), verbose = getCardinalVerbose(), ...) { args <- list(...) step <- ProcessingStep(FUN, ARGS=args) step <- setNames(list(step), label) metadata <- s...
9a57c4b904796aa481a0d61ed04972219841bf07d9d0ac716e9c063803289bf8
R
13,965
360
# load requirements suppressPackageStartupMessages({ # library(ArchR) library(monocle3) library(dplyr) library(ggrastr) # library(Seurat) }) library(tidyr) library(plyr) library(ggplot2) library(Matrix) library("lme4") assignDonorAndSite <- function(inputCDS){ updatedColdata = separate(data...
2fb82dbb0cfef980a35bd4b9c7854bbae3564ba710cf046875a034f59e2f3216
R
13,975
416
make_lookup_feat_outputs_gpa <- function(root, l1_feat = NULL, l2_feat = NULL, l3_feat = NULL) { if (is.null(l1_feat)) { l1_feat <- file.path(root, "feat_l1", "sub-01", "ses-1", "facehouse", "FEAT_LVL1_run1.feat") } if (is.null(l2_feat)) { l2_feat <- file.path( root, "feat_l2", "sub-01", "ses-1", "L...
1b80b32b8a1c5c5aea1625c9dbb75edfe9f7608def4552a32bd74e9d34c29620
R
13,980
375
## Simulation --- AUC #library library(SingleCellExperiment);library(tidyverse);library(reticulate);library(tidyverse) library(ggplot2);library(scmap);library(fmsb);library(ggsci);library(scibet);library(ggpubr) library(Seurat);library(M3Drop);library(ROCR);library(cluster);library(parallel);library(ROGUE) #Functions...
3dc690ec6b234c1867e4681a995709510ea24f0c72cb0d2969ff2232fbe57290
R
13,984
189
#################################################################################################### ### ### File: 06_EEG_results_data.r ### Purpose: Loading the results data to obtain the statistics ### and get differences among the work. ### Authors: Gabriel Rodrigues Palma, Rafael Moral ### Date: 08/0...
96d98769e516367a85ded2d156515e14bfcb028ab38a8186a84444ccfda67550
R
14,027
220
# STAT_MODEL_TYPE1.R # This is the main code that runs the first type of model, namely to compare the # cortical activity of the PD group to the HC group for the various gait events # when no freezing occurred. # INPUT: # - data_nrlgait.csv (created by create_dataframe_nrlgait.m) # - participants.xlsx # OUTPUT: # - d...
58da83395846a21170d1351133a32d228ba5f280051edb92b5a46e8d3e7b3354
R
14,042
387
--- title: "04_longitudinal" author: "Veronica Mandelli" date: "2/14/2022" output: html_document --- This script run the longitudinal model (statistics + graphics) for VABS and MSEL for the 2 ASD subtypes identified wiht NDA database usign the reval algorithm ```{r} # load libraries library(grid) library(lattice) lib...
4a91964825367187afa9cfa13cd310bb100dcd34a4df1f233d71f57167e685d7
R
14,050
390
# Note: This only runs if you get the right resources upon qlogin/qsub. Run: # qlogin -q trapnell-login.q -l mfree=4G -pe serial 16 # to start up # Trying: # qlogin -l mfree=20G -q trapnell-login.q -pe serial 16 -l centos=7 # Trying this on 7-20-21. (Didn't work, going back to 20g) # qlogin -l mfree=40G -q trapnell-...
829170c6425c7fcb0d46fe6b9c6a407607a010d82194b1eb8192a7260298c933
R
14,080
394
#The input of the function is a black and white skeletonized #image (using Zhang Suen method of skeletonization). horizontal_ridge_count<-function(pictures){ #Image is opened as a function "im_orig" and stored as raw data as "image_data". graphics.off() im_orig<-load.image(as.character(pictures)) i...
b9b1e9fc20096bdb96c6868fd4e83eacc8fe6a8421f50a43b757c5308d4baac4
R
14,087
368
#' Internal helper function to submit a query to the tracking SQLite database #' #' @param str Character string SQLite query #' @param sqlite_db Path to SQLite database used for tracking #' @param param List of parameters/arguments to be used in query #' #' @keywords internal submit_tracking_query = function(str, sqlit...
f7ee908b0fe5d8aee16284241f54a060ba59b1a461b6b896ac77447eadbeb954
R
14,095
299
library(TwoSampleMR) library(MRInstruments) library(MRPRESSO) require(argparse) func_run_MR <- function(exposure_name, outcome_name, harmonized_rdsfile, savedir_individual){ dat0 <- readRDS(harmonized_rdsfile) no_MR <- FALSE if (is.null(dat0)){ result ...
d7d3828c48f7deec2b1597bcf322b4bb3553a9f3cbe7feceae8842709bb56d4e
R
14,152
337
#!/usr/bin/env Rscript # Helper script to create final minGQ tree from # combined outputs of ROC analysis at individual # filter conditions ###Set master parameters options(stringsAsFactors=F,scipen=1000) ################### ###HELPER FUNCTIONS ################### #Read and merge all input data process.inputs <- f...
860e081dcf333eda92d46cd80c0a8ecf2a52362310aaa9fa6a4d29e0eae5b988
R
14,208
351
# load requirements suppressPackageStartupMessages({ # library(ArchR) library(monocle3) library(dplyr) library(ggrastr) # library(Seurat) }) library(tidyr) library(plyr) library(ggplot2) library(Matrix) library("lme4") assignDonorAndSite <- function(inputCDS){ updatedColdata = separate(data...
4952b488dc75d9b9ff12aacdd87213196d78566cca968d813c8ffa297ac1b04a
R
14,234
329
library(ggplot2) library(dplyr) library("optparse") library(stringr) library(ggrepel) options(ggrepel.max.overlaps = Inf) print("Libraries loaded, starting now") # Get the passed parameters option_list = list( make_option(c("-m", "--modelNotes"), type="character", # default="_fix_Anatomical_Si...
a50743bf3b7d8eb3e704c12a478fcf0005bcbd44995b90e5f8c61bbbb6870486
R
14,282
359
getInputDF <- function(opt, specifyFeatures=FALSE, specifiedFeatures="NULL"){ # Get the path dirName = paste0("../2022_04_07_redoATACtoExprData_nobackup/fileOutputs/", "Gene_Prom_Plus_Distal_WithSequence_Sites_Max", opt$maxNdistalSites, "_Upstream", opt$promoterUpstream, "_Downstr...
e774befc37a2757511e476322324b2072c18ac64eb12c2fc3eaf72f4e4f0bf11
R
14,297
359
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...
3cceeba3cf41cbc2a80320701016d7b1a16afdd29f033962576d508ccdb0d79f
R
14,308
355
#' sccomp_boxplot #' #' @description #' Creates a boxplot visualization of the model results from `sccomp`. This function plots the estimated cell proportions across samples, highlighting significant changes in cell composition according to a specified factor. #' #' @import ggplot2 #' @importFrom ggrepel geom_text_repe...
8e66878190514f880cc60a322cda83c82cb1b1a74bcb4caa622c74cff728645b
R
14,356
363
rm(list = ls()) #################### ## Load libraries ## #################### require(stringr) require(R.matlab) require(pracma) require(Formula) #################################################################################### ### This script will construct a subject sample for Elis's Nback & Rest Analyses ### #...
34375d6cf0f0da6b006b83a6453915f6406d14606351e6299e5b340ac0568c2a
R
14,361
351
basepath = "/net/trapnell/vol1/home/readdf/trapLabDir/hubmap/results/2022_04_03_redoATAC_proc_nobackup/" dir.create(paste0(basepath, "archr/results/finalPlots/")) out_dir = paste0(basepath, "archr/results/finalPlots/") setwd(out_dir) set.seed(7) # load requirements suppressPackageStartupMessages({ # librar...
995f251e35e9a3e2c412114846c50274f6c6b7d9aa27524ea1e346954c409ebc
R
14,409
351
library(tidyr) library(ggplot2) library(glmnet) library(ROCR) 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("...