sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
21.8k
content
stringlengths
1
200k
90933117d049bcbe1d675c40fdb87ebc68a9c9ac66f171a362c5e25289bdfe85
R
50,118
1,073
check_cave <- memoise::memoise(function(min_version=NULL) { check_reticulate() tryCatch( cv <- reticulate::import("caveclient"), error = function(e) { plp=reticulate::py_list_packages() plpc=plp[plp$package=='caveclient',] errmsg <- if(nrow(plpc)==0) paste( "Please instal...
8d8b307bc049156f2173d48cf726c84916f075f4b696f88964acdef7da83940b
R
50,568
1,041
--- title: "MultiNicheNet analysis: SCC paired analysis - wrapper function" author: "Robin Browaeys" package: "`r BiocStyle::pkg_ver('multinichenetr')`" output: BiocStyle::html_document output_dir: "/Users/robinb/Work/multinichenetr/vignettes" vignette: > %\VignetteIndexEntry{MultiNicheNet analysis: SCC paired ana...
8042f25812de76a6953dfabbeef2e84d6e8459edfddc44e37429c343410833b2
R
51,477
934
--- title: "MultiNicheNet analysis: Workflow for condition-specific cell types" author: "Robin Browaeys" date: "2023-06-06" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{MultiNicheNet analysis: Workflow for condition-specific cell types} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UT...
8adcb6e6a2af3a40e685ee1597d057350d44e4ff8982d52f8133acf1eb74e073
R
52,020
1,168
plotPruningExample <- function(moduleOfInterest, initial_modules, consensus_network, n_iterations) { # adjacency matrix adjMat <- as_adjacency_matrix(consensus_network, attr = "weight") # filter module data initial <- initial_modules %>% dplyr::filter(regulator == moduleOfInterest) #pruning nr. 1...
558776207f40c0e2a0a78390c027c13c7b23f2750bda3ec98b253a21359cfdd1
R
52,106
1,259
#' @export print.emc <- function(x, ...){ n_chain <- chain_n(x) cat("Iterations: \n") print(chain_n(x)) sub_names <- names(x[[1]]$data) cat("\n") cat("Subjects: \n") print(sub_names) par_names <- x[[1]]$par_names cat("\n") cat("Parameters: \n") print(par_names) return(invisible(list(iterations =...
a11aa8eaf7c1df5fb3fbd80d29d23f7b47e6c7c58d9366d7fd60151426cb6d4b
R
52,245
1,304
apply_contrasts <- function(events, contrast = NULL, cell_coding = FALSE, remove_intercept = TRUE, levels = NULL) { factor_name <- events$factor[1] colnames(events)[colnames(events) == "event_type"] <- factor_name # If a contrast is provided, use it; otherwise let R default to its default contrasts. if(!is.nul...
e444920bed4aad370e0c89936a23dd383cd7d7b4f02715805b775c0f9a40a825
R
52,539
856
library(tidyverse) library(methylclock) library(survival) library(survminer) library(ggpmisc) library(viridis) library(ggrepel) library(ggplot2) library(dplyr) library(ggpubr) library(ggh4x) library(ggsci) raw <- read_rds("./input/fhs/epigenomics.rds") clocks <- DNAmAge(raw, clocks = c("Horvath", "Hannum", "Levine"),...
6d2471f344100a97b32814d595efcaf11d4a054c522ae6eba68f3f45973a0fff
R
53,183
1,100
--- title: "MultiNicheNet analysis: include additional data modalities: serum proteomics in MIS-C" author: "Robin Browaeys" package: "`r BiocStyle::pkg_ver('multinichenetr')`" output: BiocStyle::html_document output_dir: "/Users/robinb/Work/multinichenetr/vignettes" vignette: > %\VignetteIndexEntry{MultiNicheNet a...
3bc33b9bf99fd170bd64cbc4dae1e5fbf906bacefbfa2e159831398c9e4c739a
R
53,430
1,306
# # sleuth: inspect your RNA-Seq with a pack of kallistos # # Copyright (C) 2015 Harold Pimentel, Nicolas Bray, Pall Melsted, Lior Pachter # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software F...
e3239da41da5796fff3f52b33c84e96aa2571e6a56e96f69c4cde2273716b337
R
53,716
1,461
########################################################################################## # LSI Dimensionality Reduction Methods ########################################################################################## #' Add an Iterative LSI-based dimensionality reduction to an ArchRProject #' #' This function wil...
b442a01795f5c56bece888bf7d46cdca53a18ebbc9c49c3b5ca7fbaba2235ea3
R
54,356
828
## This file will be used to store common functions that are useful in scRNA-seq anlysis. ## Quote, Unquote and Quasiquote: https://masterr.org/r/quote-n-quasiquote/ ## Quasiquotation: https://adv-r.hadley.nz/quasiquotation.html ## Non-standard evaluation: http://adv-r.had.co.nz/Computing-on-the-language.html ## ht...
ed8f3cffe87d3b98ee21fe270326a7811a56113e856613ce9274024e900d85a0
R
54,453
1,314
memo_sqlite_con <- memoise::memoise( function(db, flags=RSQLite::SQLITE_RO, ...) { con <- RSQLite::dbConnect(RSQLite::SQLite(), db, flags=flags, ...) con }) memo_tbl <- memoise::memoise(function(db, table) { check_package_available('RSQLite') check_package_available('dbplyr') if(is.null(db)) return(NULL)...
aac103658d8cb8fe38679340a230178d29f0937a15f5e623907b95bd61f8790c
R
54,763
1,535
########################################################################################## # Marker Feature Methods ########################################################################################## #' @export markerFeatures <- function(...){ .Deprecated("getMarkerFeatures") getMarkerFeatures(...) } #...
bf61a67f5d512ed1dac40c6dda58c94e2f6a90b95be68d6aabda8fe200c65a8b
R
55,070
1,411
--- title: "PAL simulation-based calibration" author: "I. S. Plank" date: "`r Sys.Date()`" output: html_document: toc: true number_sections: true fontsize: 10pt #geometry: margin=0.5in --- ```{r settings, include=FALSE} knitr::opts_chunk$set(echo = T, warning = F, message = F, fig.align = 'center', fig.w...
41d5f4d7903065cbda28d11beda82111f246c1250c525fd503397b9086810e70
R
56,047
1,352
#' Summarise edits for one or more FlyWire segment ids #' #' @details When \code{filtered=TRUE} the following are removed \itemize{ #' #' \item edits that are outside of the given root id - meaning these edits are #' in the history of the cell but the affected part of the arbour was since #' cut off. #' #' \ite...
bb1990b5321f691475d64629f2981e903b735f1cfca5570f08104955c21671b0
R
56,583
1,340
setwd('~/d/sci/src/prp_mrm') options(stringsAsFactors=FALSE) library(sqldf) library(reshape2) library(minpack.lm) library(beeswarm) percent = function(proportion,digits=2,format='fg') { return ( gsub(' ','',paste(formatC(proportion*100, digits=digits, format=format),"%",sep="") ) ) } alpha = function(rgb_hexcolor, ...
09c36b2c8866c85edfa29718ad57c2cfa3613df925104358dd762b3937fd98de
R
57,737
1,027
#' @title get_muscat_exprs_frac #' #' @description \code{get_muscat_exprs_frac} Calculate sample- and group-average of fraction of cells in a cell type expressing a gene. #' @usage get_muscat_exprs_frac(sce, sample_id, celltype_id, group_id) #' #' @inheritParams multi_nichenet_analysis #' #' @return List with two dataf...
e8e95a731934fd9fcc7c2d89882c78592f313c91c0abb67d9518e2d24b3daf41
R
57,775
1,597
setSparseSigma = function(sparseSigmaFile) { Check_File_Exist(sparseSigmaFile, "sparseSigmaFile") sparseSigma = Matrix:::readMM(sparseSigmaFile) locations = rbind(sparseSigma@i, sparseSigma@j) values = sparseSigma@x nSubj = dim(sparseSigma)[1] sigmaMatListR = list(locations = locations, ...
875822d3130e5675b5ca6658551ef51f041d7a371ad4d0e4a4d577fd611948a2
R
57,835
1,491
#################################################################### # Trajectory Analysis Methods #################################################################### #' Add a Supervised Trajectory to an ArchR Project #' #' This function will fit a supervised trajectory in a lower dimensional space that #' can then...
693be40b722d6e3ac5231a12ff6c6c068e0ad3fb9697d1fd5c5f22b84788ae90
R
57,881
1,586
########################################################################################## # Annotation Methods ########################################################################################## #' Get peakAnnotation from an ArchRProject #' #' This function gets a peakAnnotation from a given ArchRProject. #' ...
5a296fdadaccd92539ca867a72ec67d5a00f8a98b56a935544384aba55e8f54f
R
58,368
1,316
############################################## ### Integrate BANC meta data with seatable ### ############################################## source("banc/banc-startup.R") message("##### Building seatable meta data #####") # Update BANC meta seatable bancr:::banctable_updateids() # Save snapshot bc.orig <- banctable_q...
c98e7f89c856c0fe1e16da9936e587cd300a7960433fb47913426b0513fde701
R
58,481
1,660
--- title: "Tutorial 03: Connectivity Analyses" author: "Alexander Bates" date: "`r Sys.Date()`" output: html_document: toc: true toc_float: true code_folding: show --- ```{r setup, include=FALSE} knitr::opts_chunk$set( echo = TRUE, warning = FALSE, message = FALSE, fig.width = 10, fig.height =...
36add748d2eb7a136f10e235619411b73c84e78a9d0ee2a77236ce19395f4c8d
R
59,204
1,274
--- title: "MultiNicheNet analysis: Integrated lung atlas analysis - correct for batch effects to infer differences between IPF and healthy subjects" author: "Robin Browaeys" package: "`r BiocStyle::pkg_ver('multinichenetr')`" output: BiocStyle::html_document output_dir: "/Users/robinb/Work/multinichenetr/vignettes"...
ffdeb12147fb6872355720c1bf24617fe15f55cffb1fbdb89a08f14659dcbe53
R
59,289
1,485
#' author: Gavin Ha #' Dana-Farber Cancer Institute #' Broad Institute #' contact: <gavinha@gmail.com> or <gavinha@broadinstitute.org> #' date: June 26, 2018 loadDefaultParameters <- function(copyNumber = 5, numberClonalClusters = 1, skew = 0, hetBaselineSkew = NULL, alleleEmissionModel = "binomial", symmet...
98c2a7b4763f10150cfbdc25a3d13c8ed3df53f32da324d37e7d538d80aa7fc9
R
59,323
1,235
#' banc-calculate-completion — Synapse-capture rates across v1, v2, v3 detection rounds. #' #' Classifies each synapse's pre/post as proofread / identified / fragment #' and emits per-source capture-rate CSVs + a 3-way comparison. #' #' @section Reads: #' - GCS v1/v2/v3 synapse parquets, `banc_<ver>_synapses_v3.parqu...
4d32a5c90b77e73345115954074a876be3d1170912c4f856bca18debc2d04e6d
R
59,701
1,396
--- title: "DESEQ CP circadian data" output: html_document date: "2023-02-22" editor_options: chunk_output_type: console --- #Analysis of RNAseq data from sleep/circadian choroid plexus ###There are several different ways to analyze this data as there are 3 conditions, awake, asleep and sleep disrupted. Previous an...
2687443f130c35cc68c865795cf3bedd8faadd77804c62857c99dbcf62feb215
R
60,299
948
################################### PACKAGES, HELPER FUNCTIONS, LIST OF TRAITS ################################### library(ggplot2) library(ggrepel) library(readxl) library(googlesheets4) library(stringr) library(latex2exp) library(Cairo) library(ggtext) library(stringi) library(patchwork) library(reshape2) library(mlt...
50ac5fa7dbe3f2528cd7e47b8f72e581f96f3a76b8c299d0a77bf2a606bed8a8
R
60,353
1,522
library(Seurat) library(Matrix) library(dplyr) library(ggplot2) library(reshape2) library(cowplot) library(fields) library(KernSmooth) library(ROCR) library(parallel) library(DoubletFinder) #/histor/sun/wangtao/3_software/anaconda3/envs/ScenicProtocol/bin/R ######################## setwd("/histor/sun/w...
5ca276797e8e8db921683141ec04d73abe569e486eec974eadded3f627838874
R
60,832
1,325
#' banc-frankenbrain — Build the franken-brain meta CSV (FAFB + MANC merge). #' #' Merges FlyWire (FAFB) and MANC metadata into a single cross-dataset #' "franken" metadata table, using BANC-mediated cell_type bridges where #' available. The output is the canonical reference loaded everywhere via #' `franken_meta()`. #...
3a542840011b34e052b54c65e823d6305065b6e7d2aefe5dbbbb2ad93935cbf3
R
61,050
1,614
#' Specify a Design and Model #' #' This function combines information regarding the data, type of model, and #' the model specification. #' #' @param formula A list. Contains the design formulae in the #' format `list(y ~ x, a ~ z)`. #' @param factors A named list containing all the factor variables that span #' the d...
de4c2022b91c88a1a265e926c692d9f587fdb99227f8d49f7a889cacbbf02e02
R
62,070
1,866
# AD risk variants annotation # open R srun -n 10 -p interactive --pty /bin/bash module load cluster/gsl/1.15 module load cluster/htslib/1.9-devel module load cluster/build_tools/llvm/8.0 module load cluster/util/gcc/8.2 module load hdf5_18/1.8.21 conda activate r_env #conda deactivate R # Load libraries library(...
836ca9b0e172142ef57c0c91e5fb554abb426fb5ec6603ec6bbb25980479090e
R
62,454
1,109
#' @import ggrepel #' @import gridExtra #' @import leidenAlg #' @import R6 #' @import Rtsne NULL ## exporting to inherit parameters below, leiden.community #' @export leidenAlg::leiden.community #' @title Conos R6 class #' @description The class encompasses sample collections, providing methods for calculating and v...
30afb5b5481fb3f9db9bb10c4490584e77bc0e45526af403e6f9d07a35c308a4
R
63,016
1,569
title: "R Analysis of Spine/Astrocyte data by Dr Francesco Gobbo (original code input by Tara Spires-Jones" output: html_notebook --- Load libraries ```{r} library(readr) library(plyr) library(forcats) library(lme4) library(ggplot2) library(stargazer) library(lmerTest) library(rcompanion) library(dplyr...
95bccb4d1f8079e606fa15a5ad2a69e0e906ebddd7ed6d1df76ce154b1859fbb
R
63,341
1,351
#' banc-data — Assemble the versioned BANC release: meta, metrics, synapses, edgelists. #' #' @section Reads: #' - `banc_<ver>_synapses_<src>.parquet`, `banc_<ver>_edgelist_simple_<src>.feather` #' - `banc_metrics.feather`, NT-prediction feathers, per-neuron split CSVs #' - SeaTable `banc_meta` #' #' @section Wri...
20e797a75bded3687632bd4fbb8936111fc415039e8057ce25208d90ccba48c4
R
63,903
1,594
# Script to compare target genes in iTF cells # open R srun -n 10 -p interactive --pty /bin/bash module load cluster/gsl/1.15 module load cluster/htslib/1.9-devel module load cluster/build_tools/llvm/8.0 module load cluster/util/gcc/8.2 module load hdf5_18/1.8.21 conda activate r_env #conda deactivate R library(G...
5df44f098609c5fb08d66ec9b5ef8cdf29b2a70f4f20d2f0787052a418a53615
R
65,618
1,164
#' @title multi_nichenet_analysis #' #' @description \code{multi_nichenet_analysis} Perform a MultiNicheNet analysis in an all-vs-all setting. #' @usage multi_nichenet_analysis( #' sce, celltype_id, sample_id,group_id, batches, covariates, lr_network,ligand_target_matrix,contrasts_oi,contrast_tbl, senders_oi = NULL,re...
fb2eafdcded0274d169129ec764cf161b9fb9680fcdf3581316651538ec76914
R
67,045
2,080
#' @import shiny #' @import SingleCellExperiment #' @import ggplot2 #' @import grid #' @import paletteer #' @importFrom cowplot plot_grid #' @importFrom viridisLite viridis #' @importFrom sessioninfo session_info #' @rawNamespace import(plotly, except = last_plot) #' @importFrom grDevices as.raster pdf dev.off #' @impo...
1ea79acfae17e45f27a12dd22f47a214e82fecc0b98b695e85642341524f42b7
R
67,908
811
#' @title generate_prioritization_tables_condition_specific_celltypes_sender #' #' @description \code{generate_prioritization_tables_condition_specific_celltypes_sender} Perform the MultiNicheNet prioritization of cell-cell interactions. Focus on including condition-specific cell types as sender cells. This implies no...
a55a39f27a529144138a40ab37a0800911021b7d5f6206df53af9b60f84f7adf
R
68,138
1,180
library(bhr) source("correct_winners_curse.R") library(pracma) ########################################BHR basic estimates (h2, intercept) ############################# path = "/Users/daniel/Desktop/rare_h2/ms/genebass_summary_statistics_null/" phenotype_file <- read.csv("~/rv_h2/reference_files/ms_phenotype_sheet.cs...
75674ed0fdc6a2d14612f732543c30063434fc9ee32a738b7c3864da82ae4b7b
R
68,779
2,141
library(dplyr) library(tidyr) library(cluster) library(ggrepel) library(FactoMineR) library(ggplot2) # Only if you want to use ggplot for visualization library(factoextra) # Load factoextra package library(ggforce) # For drawing circular shape library(psych) library(plotly) library(purrr) # Load the purrr package l...
a2ec4a5d7e35e7b39047e4890863cb5d5d94343edd4a2d91795dc36aeb790cd7
R
68,901
2,253
#' @title Regional plot #' #' @description `fig_region` creates a regional plot, i.e. a scatter graph of #' genomic markers associations (e.g. log10(p-values)) with a gene bar #' underneath. #' #' @name fig_region #' #' @import dplyr #' #' @import tidyr #' #' @import ggplot2 #' #' @import ggiraph #' #' @import ggre...
9dd2ba89ff6fd5a54d33c7553f62c0913ae15ef283b9c91f40d1f01a80eaa7cd
R
69,267
1,720
check_seatable<- memoise::memoise(function(min_version=NULL) { check_reticulate() tryCatch( st <- reticulate::import("seatable_api"), error = function(e) { if(interactive()) { chc=readline("Install the seatable_api python package for flytable access (y/n)? ") if(tolower(chc)=='y') { ...
ca5f632f066d6ab3ac0f9361ce9e78885b0f7f9647aea2db6d5485476bd7a7da
R
69,393
1,613
--- title: "getting_module_scores" output: html_document date: "2024-05-07" author: - name: Vladyslav Storozhuk --- # 1. Processing peaks with scores ```{r} random_modules_in_extended_format <- readRDS("/data/share/htp/hack_GRN/NPC_diff_network_analysis/07.module_assignment/randomModules/initial4000_min20_ext.rds")...
06a0405190a6c6cd86e26c8f394172f5181b652b0f9d0c933eeb552045883354
R
70,545
1,667
# load packages library(patchwork) library(Seurat) library(rhdf5) library(DropletUtils) library(DropletQC) library(dplyr) library(Matrix) library(ggplot2) library(plyr) library(tidyverse) library(tidyr) library(ggpubr) library(reshape2) library(rio) library(data.table) library(harmony) library(ggrepel) library(edgeR) l...
d0c9b580984e1ea612a150e87471934cacb2de52eb73d614200d236163448cf1
R
71,690
1,747
########################################################################################## # Assay Correlation Methods ########################################################################################## #' Correlate Matrices within an ArchRProject #' #' This function will correlate 2 matrices within an ArchRPr...
4a94ae2e14bf039a5bb60a91793882456a862b7f05a4eb214e9bc97b936d2ad6
R
72,710
1,532
--- title: "Analysis Report of EPS effect on NMO transcriptome using bulk RNA-seq" output: html_document: theme: journal toc: true toc_float: collapsed: false smooth_scroll: false date: "2025-10-16" --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = FALSE,warning = F,message = F) `...
72fce5042130ddd1bf6651413b351ef278e64c1d8b7c6a2372398dbdd62ff8db
R
73,813
1,241
#' @import shiny #' @importFrom shinyWidgets pickerInput pickerOptions updatePickerInput #' @import SingleCellExperiment #' @importFrom DT DTOutput #' @importFrom SummarizedExperiment assays app_ui <- function() { ## Get options spe <- golem::get_golem_options("spe") docs_path <- golem::get_golem_options("d...
e71214062bf9587dbfcae3b3c6a1f7980da62db9886995528cd11d330ab445b4
R
74,050
1,641
--- title: "MultiNicheNet analysis: aPD1 treatment response breast cancer - multifactorial design - sample-agnostic/cell-level alternative" author: "Robin Browaeys" package: "`r BiocStyle::pkg_ver('multinichenetr')`" output: BiocStyle::html_document vignette: > %\VignetteIndexEntry{MultiNicheNet analysis: aPD1 tre...
ac30dd4906e6588851d0dd6f423253c54c5ceac466475b5ef38537f429862092
R
74,412
1,396
--- title: "MultiNicheNet analysis: MIS-C threewise comparison - step-by-step" author: "Robin Browaeys" package: "`r BiocStyle::pkg_ver('multinichenetr')`" output: BiocStyle::html_document output_dir: "/Users/robinb/Work/multinichenetr/vignettes" vignette: > %\VignetteIndexEntry{MultiNicheNet analysis: MIS-C three...
66b01c820c738240d4b99c2241bd008488832cc2f7fb4b3b0aba1b6f78a472cc
R
76,193
1,733
#' banc-dimorphic-density — Density plots of sexually dimorphic presynapses (combined VNC + brain). #' #' VNC: JRCVNC2018U space for BANC, maleCNS, MANC. Brain: JRC2018U for #' BANC, FAFB, maleCNS. Reads the `sexually_dimorphic` column from each #' dataset (set by `banc-vnc-sexually-dimorphic.R`) and produces faceted #...
09d35aef481640a9bf520fe03d0cc2ea9bdb46ce7c1adcf269ba542c9cc7f72b
R
76,958
1,677
monsterAnalysis <- setClass("monsterAnalysis", slots=c("tm","nullTM","numGenes","numSamples", "logging")) setMethod("show","monsterAnalysis",function(object){monsterPrintMonsterAnalysis(object)}) #' monsterGetTm #' #' acessor for the transition matrix in MONSTER object #' #' @param x an object of class "monsterAnalysi...
6bf2fdc11336fc7e4264580a755c8c2ab65df50f995dfda0f5b4502c880f60c8
R
77,875
1,270
#' @title get_abundance_info #' #' @description \code{get_abundance_info} Visualize cell type abundances. #' @usage get_abundance_info(sce, sample_id, group_id, celltype_id, min_cells = 10, senders_oi, receivers_oi, batches = NA) #' #' @inheritParams multi_nichenet_analysis #' @inheritParams combine_sender_receiver_inf...
6b0b26ac6c0b8942f4c7eb8a037ecdc6e0cc8737a4325132947e5bc74a986448
R
79,734
2,286
--- title: "Ambra Villani's microglia RNA-seq" author: "Izaskun Mallona, Mark D. Robinson's lab, UZH" date: "`r format(Sys.time(), '%d %B, %Y')`" output: html_document: toc: true toc_float: true code_folding: hide code_download: true number_sections: true df_print: kable theme: lumen param...
70da773cfa582b2c72ebf2722c5e34e532dba1d8a9d7bb088312617976fe8889
R
80,561
1,741
--- title: "MultiNicheNet analysis: anti-PD1 Breast cancer multifactorial comparison" author: "Robin Browaeys" package: "`r BiocStyle::pkg_ver('multinichenetr')`" output: BiocStyle::html_document output_dir: "/Users/robinb/Work/multinichenetr/vignettes" vignette: > %\VignetteIndexEntry{MultiNicheNet analysis: anti...
49e581edf0f4408563fb8c98016912c993641a82b229fcc1ae5acc9dc5d2502f
R
80,562
2,141
#################################################################### # Signal Track Plotting Methods #################################################################### #' Launch ArchR Genome Browser #' #' This function will open an interactive shiny session in style of a browser track. It allows for normalization o...
52724d6c74e935b03930c844ecada22c0a3298ca5ad666ffc7f1940bac0538cf
R
81,551
1,994
create_group_key <- function(df, factors) { if (length(factors) == 0) return(rep("All Data", nrow(df))) key <- apply(df[, factors, drop = FALSE], 1, function(x) paste(paste(factors, x, sep = "="), collapse = " ")) levs <- lapply(df[,factors],levels) for (i in 1:length(factors)) levs[[i]] <- paste(factors[i]...
f234cb8383357fc9772804785e95cbd1b6b96e4b8caa571ae981012d1b7dded8
R
82,045
2,032
--- title: "RESTORE NPCRA & Light Analysis" author: "Emily Stanyer" date: "`r Sys.Date()`" output: html_document: theme: lumen toc: true toc_float: true toc_depth: 2 code_folding: hide --- This code calculates standard non-parametric circadian rest-activity (NPCRA) and light exposure metrics u...
ef273156c98d8f1d2928a59863dee9c74f5590f806d2f868f66bc77399c13b60
R
82,398
879
scale_quantile_adapted = function(x, outlier_cutoff = 0){ y = nichenetr::scale_quantile(x,outlier_cutoff = outlier_cutoff) y = y + 0.001 return(y) } #' @title generate_prioritization_tables #' #' @description \code{generate_prioritization_tables} Perform the MultiNicheNet prioritization of cell-cell interaction...
85521b22907fc127aedc92be370639ad434b819919547c3e52658daf1f307b38
R
83,486
2,383
--- title: "Memory_Encoding_Analysis" author: "Michael Colwell" date: "2024-04-05" output: html_document --- #Memory encoding task (or 'Hippocampal task') behavioural and neuroimaging data preprocessing analysis scripts for the PEACE Study ('Pitolisant Effects on Affect and Cognition Exploratory Study') (NCT05849...
bdd6e634bbf73d99d111c0dd4e37816a748139f064e2c13e63b3b518afbe1cf9
R
83,952
2,075
#' Create a trend specification for model parameters #' #' @param par_names Character vector specifying which parameters to apply trend to #' @param cov_names Character vector specifying which covariates to use for each trend #' @param kernels Character vector specifying which kernel function to use for each trend #' @...
8238a9fa0f7fd51392cc8f45f9c1bcef8fe165e5ce0d0b328304b80f9bf11cd2
R
83,977
2,106
# # sleuth: inspect your RNA-Seq with a pack of kallistos # # Copyright (C) 2015 Harold Pimentel, Nicolas Bray, Pall Melsted, Lior Pachter # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software F...
d3cbb1930f6fdce30b1437ac71f8a072e3e4084c0ad5e42dd4c1fa5d9896291c
R
84,324
1,602
#' banc-nblast-compile — Consolidate per-query NBLAST CSVs into per-dataset feathers. #' #' Updates compiled feathers from reviewed CSVs + scanned PNG review #' folders. Run AFTER `banc-nblast-wrong-matches.R`. #' #' @section Reads: #' - per-query NBLAST CSVs, reviewed CSVs, PNG review folders, existing feathers #' #...
0ced56353b2526dc83f37ff411b74f3c6b065175297195295233c37f8cfc01cf
R
85,789
1,745
library(readxl) library(dplyr) library(ComplexHeatmap) library(circlize) library(tidyr) library(ggplot2) library(cowplot) library(lmtest) library(broom) library(outliers) library(stringi) library(plotrix) library(ggforce) library(FSA) library(ggpubr) # #Synapses # exp_names <- list.files("AtlasV8 Sp...
d81f5fa27d962591f1779d8cec3027ca59073ce61a82d6f8a3d9396e3fa9b66e
R
87,095
1,837
# ============================================================================== # Script 22: Fig 4 & SupFig 11 - DNA Methylation Alterations (DMI, ILC vs NST) # ============================================================================== # Description: Analyzes DNA methylation instability (DMI) and generates # ...
49160b2fe1bb5e916e825e6b0200ddea22ef451dc647a0f74dde5a88650f1c94
R
88,655
1,189
--- title: "CroCoNet" output: rmarkdown::html_vignette bibliography: references.bib csl: bmc-biology.csl vignette: > %\VignetteIndexEntry{CroCoNet} %\VignetteEncoding{UTF-8} %\VignetteEngine{knitr::rmarkdown} editor_options: chunk_output_type: console --- <style> img { border: 0; } p.caption { font-size: ...
7c02885ba974038cd8eb1142323b666465d36742f400cd1cf2a7c204945d5129
R
88,914
2,308
##### PREREQUISITES ##### rm(list=ls()) library(tidyverse) library(ggpubr) library(phangorn) library(MCMCglmm) library(phytools) library(bbmle) library(MuMIn) library(plotly) library(ggbeeswarm) library(wesanderson) library(ggResidpanel) library(emmeans) ##### #SEX DIFFERENCES (FIGURE S1) ##### se...
8ee0f1165386559ecaaf829ebd5d544633d32a3927bb51feb3272667b71766f3
R
89,950
1,423
#' Plot expression profiles as a heatmap #' #' Plots the expression profiles of one or more genes as a heatmap, with the cells ordered by pseudotime or cell type. #' #' The function creates a heatmap, with columns corresponding to cells, rows corresponding to genes and colors corresponding to scaled and centered expres...
f798879526c05a0ec2325669e7dd681a31027149b86b5284149d3f250b039312
R
90,155
2,371
#' Create Arrow Files #' #' This function will create ArrowFiles from input files. These ArrowFiles are the main constituent for downstream analysis in ArchR. #' #' @param inputFiles A character vector containing the paths to the input files to use to generate the ArrowFiles. #' These files can be in one of the follo...
409b195cd48e42d955acb7570a917863c1b5e9e53c64da81f960749309f61ff7
R
91,759
2,402
[file name]: UMAPHarmony_10samples_ArchR.R [file content begin] library(ArchR) library(ggplot2) library(Seurat) addArchRThreads(threads = 16) addArchRGenome("mm10") #/histor/sun/wangtao/3_software/anaconda3/envs/R4.0/bin/R setwd("/histor/sun/wangtao/0_user/3_shixh/singlecell/choline/ATAC/data/d2c/UMAPHarmony_10cholin...
7fc367bc970be8d462ebca145aeb1f03c3160b0da4567942077a641456cde1ba
R
91,977
2,075
#' Run SEAHORSE in R #' Author(s): Enakshi Saha #' Description: #' SEAHORSE computes gene-gene coexpression matrix, #' associations between a set of given phenotypes and each gene, #' performs gene set enrichment analysis (GSEA) for each phenotype, #' using the me...
54293744b1907482f57f9ad2df02012fbce4761ddef97e9efe033a415ed1059d
R
93,240
2,501
#library(caTools) #dyn.load("src/bed2vector.so"); #dyn.load("src/wdl.so"); #dyn.load("src/peaks.so"); #dyn.load("src/cdensum.so"); # -------- ROUTINES FOR READING IN THE DATA FILES ------------ # fix.chromosome.names : remove ".fa" suffix from match sequence names read.eland.tags <- function(filename,read.tag.names=F...
fafc91b7ee50f484489f21b7f0ae4db52ef2c3d0b9e1a27b64666589831c8ac4
R
93,294
1,889
########################################### ### Compile NBLAST from various sources ### ########################################### source("banc/banc-startup.R") message("##### Building BANC NBLAST data files #####") version <- "elastix_tpsreg_240721" # Register cores cl <- setup_parallel() ##########################...
e1a1fd8793456e17f9f5feeb73001d94a0366aa2e71d4e2e5a8ba25cd4f64c54
R
93,321
2,097
#' banc-vnc-type-changes — Detect VNC cell_type changes vs the new VNC typology. #' #' Two parts: (A) VNC intrinsic neurons — joins #' `banc_vnc_cell_type_and_dimorphism.csv` to SeaTable on `root_626` to #' detect cell_type / hemilineage changes and dimorphism assignments; #' (B) Effector neurons — joins `banc_to_manc_...
c7a6e6fccc3d2250c6cfda7c5af9343cf25a3d4aa1f71318fde301e17b13aa36
R
93,511
2,281
library(Seurat) library(Matrix) library(ggplot2) library(plyr) library(tidyverse) library(tidyr) library(dplyr) library(ggpubr) library(reshape2) library(rio) library(data.table) library(harmony) library(GeneOverlap) library(readr) library(DropletQC) library(xlsx) library(biomaRt) library(ggbreak) source('~/SCRIPTS/uti...
ee7194b37bb414c1f3d662304d99f9078f207b7dab35279a4a36e9af0c55f0d6
R
94,445
1,923
library(readxl) library(dplyr) library(ComplexHeatmap) library(circlize) library(tidyr) library(ggplot2) library(cowplot) library(lmtest) library(broom) library(outliers) library(stringi) library(plotrix) library(ggforce) library(FSA) library(writexl) # #Synapses # exp_names <- list.files("AtlasV8...
a8688eedf691843f64bb23d218ace0feea1011803500372f315b5b9faaf2c899
R
94,593
1,507
context("test SEAHORSE result") test_that("seahorse function works", { skip_if_not_installed("fgsea") skip_if_not_installed("matrixTests") skip_if_not_installed("stats") skip_if_not_installed("limma") set.seed(42) # Simulate expression data expression_data = data.frame(matrix(rexp(1000, rate=.1), ncol=10...
cae445f67ca8f638693deb6f1108984d2f06f4bf994f5636494d5a2fd2dcee93
R
95,804
2,854
# Load required libraries library(readr) library(readxl) library(sf) library(dplyr) library(tidyr) library(ggplot2) library(MASS) # For kde2d function library(igraph) library(RColorBrewer) # Set working directory setwd("C:/Users/huynhk4/Documents/") #--------------------------------------------- #cell_type=c("Fibro...
dad8c2010eca68b1c95a8c3f4379e77d9b6c8898f4c1841fa116902f5dc5e9d0
R
95,938
1,654
################################################################################################################################### ## One-Step GSA FET (R piano implementation) WITH USER PARAMETERS ## - by Eric Dammer, Divya Nandakumar ## Nicholas Seyfried Lab Bioinformatics - for the lab - ## 01/07/2026 version 1.4...
fbab51e6ee42082c0d4760d67d363099b1a03c0fec632f8a57798fbcc9847bfc
R
96,221
2,318
#' banc-plot — Diagnostic plots for cross-dataset matching + NT predictions. #' #' Density / beeswarm / heatmap diagnostics for cross-dataset matching and #' neurotransmitter prediction sanity checks. Manual exploration script. #' #' @section Reads: #' - `<banc.meta.save.path>/{flywire,manc,fanc}_meta.csv` #' - Sea...
4de951f7748559de6bed438c6b30252d33ee77d8bdaa852d775d9b6043ccb02f
R
96,922
3,182
# modified by pliu # # revised on 2-20-10 # - fix error in pass.structure: reverse rank.combined, so that big sig.value # are ranked with small numbers (1, 2, ...) # - fix error on get.ez.tt.all: get ez.cutoff from sorted e.z # # modified EM procedure to compute empirical CDF more precisely - 09/2009 # this file c...
313388f1955bf16bae2924e2962143feea472b4bef12ed98e0082be0b8b90e05
R
97,648
2,175
#' banc-functions — Shared helper functions for the BANC pipeline. #' #' Sourced by `banc/banc-startup.R`. Defines the per-script helpers used #' across the pipeline: neuron filtering (`filter_valid_neurons`), SeaTable #' I/O wrappers + retries, status-column append helpers, side-index and #' laterality helpers, plot p...
db302b285fff8a230e55dfb8274b43c119770871c6a8f51bd1a0002322eb647e
R
98,357
2,276
--- title: "ABCD Sleep Paper MI First" author: "Emma Devine" date: "2024-04-21" output: html_document --- # Data Management & Set-up ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) #this line of code is ensuring the code as well as output is being included in the R Markdown html file when rende...
e576e0ed9ce2167d8db53d0a7b8b1da5d793115630c2331fbbe1d5eed5c0ae39
R
98,701
1,810
############################# ### GET MALECNS META DATA ### ############################# source("banc/banc-startup.R") library(malecns) # Franken meta authority franken.meta <- franken_meta() %>% dplyr::distinct(neuron_id, .keep_all = TRUE) %>% dplyr::select(neuron_id, side, region...
d84b9dde7b644646434e78f629d72b78f2b5156d40e1d14b6ed27d0b9af156e1
R
100,897
2,986
# Load required libraries library(readr) library(readxl) library(sf) library(dplyr) library(tidyr) library(ggplot2) library(MASS) # For kde2d function library(igraph) library(RColorBrewer) # Set working directory setwd("C:/Users/huynhk4/Documents/") #--------------------------------------------- #cell_type=c("Fibro...
141cf959346f19746dd12850053c44a72bbf82df4f57ddd33ed2f4dc639478be
R
109,600
2,003
#' franken-annotations-fix — Standardise franken-brain annotations against published labels. #' #' Diff `franken_meta()` cell_types against the published FAFB Supplemental #' table and apply targeted corrections to the franken-brain CSV (column #' harmonisation, dataset-specific fix blocks). #' #' @section Reads: #' ...
f2317d0210966fc00ee913764cefd67d6cdfe5d27f576241467073136a669fb8
R
116,724
2,957
GetIndexofCases = function(status, time){ timedata = data.frame(time=time, orgIndex=seq(1,length(time)), status=status) timedata = timedata[order(timedata$time),] timedata$newIndex = seq(1,length(time)) caseIndex = which(timedata$status == 1) caseIndexwithTies = caseIndex for(i in 2:length(caseIndex)){ ...
0aeb3ad533802452a4086aa2460424653ff984dc72a31b4098121ac607236b12
R
132,072
3,769
####read me#### #Code for drosophila activity monitor analysis, modified for R from python scripts from Vaughen et al 2022 #Reads .txt activity monitor files saved in subfolders for different GAL4 drivers depleting Pex5. Experiments were done in LD except for DD run of cortex glia (GMR77A03) #Code outputs similar graph...
f134556d38b503add19ec4f2bfd6e782a966a9763d3d768fcf49d77c230c1d55
R
141,727
5,096
--- title: "gmb_mel_tma_wta" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{gmb_mel_tma_wta} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- # Setup ```{r setup, include = FALSE} # cran packages library(ppcor) library(tidyverse) library(readxl) library(writexl) library(factoe...
b74e5e2b0bf1941a5dcf9608dd6f86dcc67537ddc9f995624e65f3ad4b9a968c
R
141,866
1,586
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <link rel="dns-prefetch" href="https://github.githubassets.com"> <link rel="dns-prefetch" href="https://avatars.githubusercontent.com"> <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com"> <link rel="dns-prefetch" href=...
c521a7765dfe6a60fd484c3d29c99a73e08f0b53ebfe41261f6c9ba7c9733761
R
151,502
2,817
# Analysis Script for the taste_test TUE008 Depression Study # Author: Corinna Schulz, corinna.schulz96@googlemail.com # Created: March 2023 # Edited: July 2024 # Code content: # (1) SET UP # (2) LOAD DATA # (3) VISUALIZE WANTING LIKING CHANGES OVER TIME # (4) LINEAR MIXED EFFECTS MODELING & DATA VIZ for MDD. VS. H...
0dc765e140f785563e6feba6ed1756d711b74f2db9130de3b1ab137ee45c9e0d
R
151,614
3,904
--- title: "Extensive profiling of transcription factors in postmortem brains defines genomic occupancy in disease-relevant cell types and links TF activities to neuropsychiatric disorders." date: "5/19/2023" output: html_document: toc: true --- # Pre-processing This was run for each tissue/cell type ```{r,...
8d363a3b0cdb85e4b8d5c76a65ab260e6d7d74824307151cb57142de0fe4f291
R
155,000
3,782
# source ~/load_modules.sh library(Seurat) library(Matrix) library(ggplot2) library(plyr) library(tidyverse) library(tidyr) library(dplyr) library(ggpubr) library(reshape2) library(rio) library(data.table) library(harmony) library(GeneOverlap) library(readr) library(ggrepel) source('~/SCRIPTS/utility_functions.R') set....
d768cb28be4f4fed5a77eecb463d90b540f1c1fbb7f3614130aabe849599fb2b
R
158,527
5,188
--- title: "Analysis pipeline for the behavioral and functional MRI data from the semantic Mnemonic Similarity Task" output: html_document editor_options: chunk_output_type: console --- # Glossary & packages ENC = Encoding task phase REC = Recognition task phase RS = repetition suppression (first presentation - repe...
9df3818f529c98bb98b525a031491fa67b34b02bc73e7320e1ad526fb54cf591
R
168,351
2,960
--- title: "manuscript" author: "RC" date: "`r Sys.Date()`" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) setwd("/Users/corcorri/Documents/Denver/Manuscript") sessionInfo() ``` ``` {r Libraries} suppressPackageStartupMessages({ library(tidyr) library(dplyr) library(gg...
8c3d2e8b66734fabd5511eecdda0a99090fb05a8fdc3ab5957b8a8002a9596d6
R
174,410
4,032
#!/usr/bin/env Rscript # ============================================================================ # ## 00_mgngtus_functions_regression.R ## MGNG-TUS study: Functions for plotting and fitting regressions to behavioral data. ## Copyright (C) Johannes Algermissen, University of Oxford, Oxford, UK, 2024-2025. # ======...
62f6a085176680c327146ecce1b07a22b20f7514bbd56ed31ef1246728805d39
R
174,548
3,045
#' @title make_sample_lr_prod_plots #' #' @description \code{make_sample_lr_prod_plots} Visualize the scaled product of Ligand-Receptor (pseudobulk) expression per sample, and compare the different groups #' @usage make_sample_lr_prod_plots(prioritization_tables, prioritized_tbl_oi) #' #' @param prioritization_tables ...
371e297eca7f6777593bb44f20d5301850249746b3ee8e19dc04900a2cd0d199
R
179,994
4,620
# STARTUP #### overall_start_time = Sys.time() tell_user = function(...) { cat(file=stderr(), paste0(...)); flush.console() } # DEPENDENCIES #### tell_user('Loading required packages...') options(stringsAsFactors=F) if (interactive()) { setwd('~/d/sci/src/divalent') } suppressPackageStartupMessages({ library(t...
88a5654dda24a240cceefd17860a6c89b424a58597fab02e7fa89933f40320db
R
195,224
976
pdf(file='/home/ubuntu/Software/PyRate/example_files/BDNN_examples/Carnivora/pyrate_mcmc_logs/Carnivora_occs_1_G_BDS_BDNN_16_8TVc_contribution_per_species_rates.pdf', width = 7, height = 6, useDingbats = FALSE, pointsize = 7) ord_by_importance = function(s, consrank, rate_mean) { imp = consrank**2 s = scale(s) i...
77ab2206b0664db4837e62353cd1b72bebea76e7ab7f686c139ab3226e0eade0
R
197,901
976
pdf(file='/home/ubuntu/Software/PyRate/example_files/BDNN_examples/Carnivora/pyrate_mcmc_logs/Carnivora_occs_1_time_windows_G_BDS_BDNN_16_8TVc_contribution_per_species_rates.pdf', width = 7, height = 6, useDingbats = FALSE, pointsize = 7) ord_by_importance = function(s, consrank, rate_mean) { imp = consrank**2 s =...
ee40d42749e388ee2c62efffc809f73c3134962a2ddfd8d5c955774d6bdb43a0
R
200,000
970
pdf(file='/home/ubuntu/Software/PyRate/example_files/BDNN_examples/Carnivora/pyrate_mcmc_logs/Carnivora_occs_1_taxon_time_tables_G_BDS_BDNN_16_8TVc_contribution_per_species_rates.pdf', width = 7, height = 6, useDingbats = FALSE, pointsize = 7) ord_by_importance = function(s, consrank, rate_mean) { imp = consrank**2 ...