sha256
stringlengths
64
64
language
stringclasses
27 values
size
int32
1
491k
lines
int32
1
17k
content
stringlengths
1
200k
8b294ed048e3ffbce314ddd37c6763fab3f1cb5e6e0d56649358571e196a31fe
R
7,491
175
#install.packages("colorspace") #install.packages("stringi") #install.packages("ggplot2") #install.packages("circlize") #install.packages("RColorBrewer") #if (!requireNamespace("BiocManager", quietly = TRUE)) # install.packages("BiocManager") #BiocManager::install("org.Hs.eg.db") #BiocManager::install("DOS...
ca77ed7f674ab057f6c4862bbcabf9b2d84923229e26a04f1e6b1545c67a200a
R
7,507
210
#' Select probes for use in cellular deconvolution #' #' Using a DNA methylation dataset containing profiles for a panel of #' reference cell types this function selects the sites for cellular #' deconvolution and estimates the nessecary coefficients #' This function is adapted from minfi pickCompProbes() #' to take a...
7605180bad39eea5a96fbbe267d0003cb4e58ffc04af62bf213509dbfdcc0e77
R
7,523
188
library(Seurat) library(tidyverse) library(cluster) #library(factoextra) library(dendextend) library(weights) library(ggpubr) library(matrixStats) library(readxl) library(glue) setwd("/n/scratch/users/s/sad167/EPN") base_dir <- "/n/scratch/users/s/sad167/EPN/scRNAseq" resources_dir <- file.path(base_dir, 'scripts/res...
9d3bf564cc6d83d0fa9d1288da108471f714a956508610b44da75a8cf283b1e6
R
7,523
284
# ---- funcs ---- # The below function is thanks to Curtis: # https://github.com/curtis-murray/MedicalDevicesNLP #' Function to get data for disproportionality analysis #' #' @param group_1 any vector combination of "pelvic_mesh", "hernia_mesh", #' "other_mesh", "other_device". #' @param group_2 any vector combinat...
c086c8efeadc5f4aa68bdf93c24325fe823e5d14710e6e476c1f83d016143282
R
7,558
169
context("Testing nhood marker gene function") library(miloR) ### Set up a mock data set using simulated data library(SingleCellExperiment) library(scran) library(scater) library(irlba) library(MASS) library(mvtnorm) set.seed(42) r.n <- 1000 n.dim <- 50 block1.cells <- 500 # select a set of eigen values for the covari...
e92585ef15c051932eae872b06bfb56e177e6ccc4424ca55d1de27229ee69b01
R
7,564
250
detrend_signal <- function(signal) { time <- 1:length(signal) # Create a time index lm_fit <- lm(signal ~ time) # Fit a linear model detrended_signal <- signal - predict(lm_fit) # Subtract the trend return(detrended_signal) } calculate_overall_ccf <- function(sig_pairs, theta_df){ results_df <- tibble("s...
06ffb7a8d080e5569c9034450278462b54b210c0a32f5844dfaeee2ba34f814a
R
7,588
191
##' Neural network based non-linear PCA ##' ##' Artificial Neural Network (MLP) for performing non-linear ##' PCA. Non-linear PCA is conceptually similar to classical PCA but ##' theoretically quite different. Instead of simply decomposing our ##' matrix (X) to scores (T) loadings (P) and an error (E) we train a ##' ne...
2af97529f9f84023367a6999d36b5e04e8df5144df6ef0fd26807dce35c53007
R
7,607
202
rm(list = ls()) # Load packages ----------------------------------- library(dplyr) library(Seurat) library(ggplot2) library(SingleCellExperiment) library(tidyverse) library(ggpubr) library(readxl) library(qs) library(SeuratWrappers) library(circlize) library(ComplexHeatmap) library(RColorBrewer) library(dendextend) li...
8313126f27e6989e325b85bf023ac5d520595c0b08889aed80e1a518d8f6cb94
R
7,739
203
# Load packages ----------------------------------- rm(list = ls()) library(data.table) library(tidyverse) library(R.utils) library(ggpubr) library(dplyr) library(Seurat) library(ggplot2) library(writexl) library(tidyverse) #library(paletteer) library(readxl) library(cowplot) #library(scCustomize) #library(ComplexHeat...
266266886b68efa3a12ab915e2e7de57c33f9ca0af0b66fcc222b2d3328c8576
R
7,750
228
library(here) library(tidyverse) library(cowplot) library(ggplot2) ### Establish location --- here::i_am("src/ASO/ASO_Correlate_DAT_with_Rotarod.R") ### Read in input files --- ASO_rotarod <- read.csv(here("data/ASO/ASO Rotarod - Rotarod.csv")) ASO_rotarod <- ASO_rotarod %>% filter(Day=="One") %>% filter(ASO_Tg==...
ca99bd98a20e8cd3497ad9202f4425e6a904c9f5ba86ca873eaa8de53d689927
R
7,766
231
--- title: "Correlation_Analysis" output: html_document date: "2025-06-09" --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` # Configuration ## Load library ```{r} library(data.table) library(dplyr) library(pheatmap) library(ggplot2) library(ggpubr) library(cowplot) int_dir = "analysis/adata_o...
db417371968fff7d4d47bc106bf71e942e12557f1c1b604eb5cc78ab7752f834
R
7,824
239
library(NMF) ## preprocess cm for nmf analysis ## @param cm log transformed and centered cm nmf_df_preprocessing <- function(cm){ ## convert negative values to zero cm = ifelse(cm < 0, 0, cm) ## remove genes with zeros in all cells cm = cm[Matrix::rowSums(cm) != 0,] } ## Find genes with high NMF score ## @par...
a215da92eaf53ad58151a4da97eef39888b7fb735eb1bb0e1ab6d80b6809ebdd
R
7,847
271
--- title: "P3 amplitude" output: html_document --- ```{r include = FALSE} # clear old outputs if(dir.exists(file.path("../output/p3_amp"))) { unlink("../output/p3_amp", recursive = TRUE) } output_dir <- file.path("../output/p3_amp") dir.create(output_dir) nice_tables_file <- paste0(output_dir, "/nice_tables.m...
d3b711f87f77529b7abc993f3989ce29237406692ec831568926bf2ec2dbc8bb
R
7,875
225
library(clusterProfiler) library(org.Hs.eg.db) library(AnnotationDbi) library(rrvgo) library(purrr) library(stringr) library(ggplot2) library(patchwork) library(dplyr) name <- 'exneu' path_rs <- sprintf('~/../jinandmaya/perturbseq/results/DE/') method <- 'ruv' df_deseq <- read.csv(sprintf('%sres.%s.%s.csv', path_...
586a70738bcdd3ade8b3c7f6c806a9c45b3e90a2fba25cb93879ca4e79684eb7
R
7,905
248
--- title: "right_left_mfg" output: html_document date: "2024-10-30" --- ```{r setup, include=FALSE} ## libraries ## library(tidyverse) library(ggplot2) library(lmerTest) library(doParallel) library(parallel) library(foreach) library(here) library(fs) library(lmtest) library(scales) library(ggthemr) library(RColorBrew...
3c03e6f29e2a0cebce3132c1508e6213ebdf651b5519957dccb0945e781b0b96
R
7,919
199
# Load packages ----------------------------------- rm(list = ls()) library(data.table) library(tidyverse) library(crayon) library(ape) library(readxl) library(ComplexHeatmap) library(qs) library(cowplot) library(SingleR) # Organize environment ----------------------------------- base_dir <- "/Users/sdaniell/Dropbox...
1d53a74b131500bbec8af4e248189944da2ad59f069255651ee2bb92f9bbbda4
R
8,002
245
# Ensure ggplot2 package is installed if (!requireNamespace("ggplot2", quietly = TRUE)) { install.packages("ggplot2") } library(ggplot2) # ================================ Data Preparation (English) ================================ # Your provided silhouette scores (corresponding to K=2 to K=10) silhouet...
17550640ed4b8d1de51c0850a45736c6183ffb48bfd5b9eafbd45af095a27367
R
8,003
175
# On-Demand Seizures Facilitate Rapid Screening of Therapeutics for Epilepsy # Authors: Yuzhang Chen, Brian Litt, Flavia Vitale, Hajime Takano # DOI: https://doi.org/10.7554/eLife.101859 # Step 0: Epileptic (1) or Naive (0) ep_or_nv = 1; # Step 1: Import Libraries and Master Spreadsheet library(readxl) library(ggpl...
84a0601a81839e23bde5bacb7e1a1beaf899d84d4ed0dd31cfb9128cbc021414
R
8,020
220
library(ggplot2) library(dplyr) library(cowplot) library(nlme) data <- read.csv("Analysis_Files/ASO/ASO GI Motility - ASO_FP_Output.csv",header=TRUE) data_long <- pivot_longer(data, cols = starts_with("X"), names_to = "timepoint", values...
a3c6fe1e51070e5e3f76ac76db1e544d12465cc8ad05a632396c1310cdbc6bb5
R
8,026
217
--- title: "Hemisphere x Long-Axis x Age Bin Interactions" output: html_notebook --- Version 1.0, July 2025, SA We ran a linear mixed model predicting hippocampal-voxelwise whole brain connectivity as a function of hemisphere, long-axis, and age bin. We identified neocortical clusters where there was a significant in...
5aa114c8b53b33643fe5dd926d8df1f242017b53847816e96ee6b3ea3ef72cf6
R
8,036
196
## This script imports the two references preprocessed in the script before and combines them into a single dataset ## It also calculates pseudobulked cm, HVGs and DEGs for projection in the next script # Load packages ----------------------------------- rm(list = ls()) library(data.table) library(tidyverse) library(...
d55f36a4d333a0d6f71ef1b71e671a811779d004fceba176cc977dc2c7333ced
R
8,094
260
# CpG Feature Selection via Age–Correlation Stratified by Sex # # - Builds a common CpG set across multiple cohorts # - Computes Spearman correlations with age in 4 age strata, # separately for females and males # - For each stratum, keeps CpGs with the top 1% |rho| # (sex with higher |rho| wins for each CpG...
a04538518ea5579260666fe621b0b0eae59deeb45a624bee3f64921c64f581ff
R
8,098
96
# Step 2: Nuclei segmentation of individual capture areas images The functions [VNS](https://github.com/LieberInstitute/VistoSeg/blob/main/code/VNS.m) (Visium Nuclei Segmentation) and [refineVNS](https://github.com/LieberInstitute/VistoSeg/blob/main/code/refineVNS.m) from the pipeline are used to perform nuclei segmen...
1c567ad5c98b7565a8e805216c17a2bbe2ddf25ff50702597a8e4028f976bff6
R
8,139
205
library(Rtsne) library(here) library(dplyr) library(ggplot2) library(cowplot) ### Compiling ASO data into one single sheet ## Rotarod -- data <- readr::read_csv(here("data", "ASO","ASO Rotarod - Rotarod.csv")) subset <- data %>% select(c("MouseID","ASO_Tg")) summary_rotarod <- data %>% group_by(MouseID) %>% #sum...
0086f5f96c565d8054636483007f281275e5496c8fa6d310aac74635a6729442
R
8,148
228
library(ggplot2) library(dplyr) library(cowplot) library(nlme) library(here) library(tidyverse) here::here() data <- readr::read_csv(here("Analysis_Files", "MPTP","MPTP_FP_Output.csv")) data_long <- pivot_longer(data, cols = c("5","10","15","30","45","60"), names...
7ae97578adb699f155b13850b7bff9fd5124ddbc6faf207f69eecb70aa1518fe
R
8,218
318
##################################### # Estimate correlation coefficient between metacognitive effiency # estimate between two, three, or four domains. # # Adaptation in R of matlab function 'fit_meta_d_mcmc_groupCorr.m' # by Steve Fleming # for more details see Fleming (2017). HMeta-d: hierarchical Bayesian # estim...
fc3ffbe6ac6a68fe6e55ff663641c9efa8e8fba8197865ab0a9291ac37b69f29
R
8,238
143
## This function executes the original SOLO algorithm, following Timothy Walker's implementation (PMID 26116186). ## The inputTab has columns sample_id, mutation, phenotype and [SOnly or het]; maxIter is a positive integer or Inf. ## If removeSOnly is FALSE, the first stage of classifying and removing the variants occu...
9b1c631f20e8f8ce1e66b6a57dc4ff51d2009f9a132694a051438a111278c61f
R
8,252
207
library(ggplot2) library(dplyr) library(patchwork) library(cowplot) #for plot latent_data_X <-as.data.frame(cbind(design,spls.final.4comp.multilevel.canonical$variates$X)) colnames(latent_data_X) <- c("sample", "X1", "X2", "X3", "X4") latent_data_Y <-as.data.frame(spls.final.4comp.multilevel.canonical$variates$Y) lat...
d65cabb19db6cde7d4a956b30ef31366deb9c3150831399e48f16828418243a8
R
8,266
207
################################################################################ # Visualizes change in environmental variables for Figures S1 and S5 # Visualizes the diversity of Durusdinium and Symbiodinium ITS2 profiles ################################################################################ ###############...
1e1bdc7653c865c9067a899a8d350c19d948ac88b5808a323ac96796fdb023ae
R
8,274
207
library(here) library(ggplot2) library(rlang) library(rstatix) library(nlme) library(cowplot) library(ggbeeswarm) library(ggpubr) library(ggsignif) #ROTAROD here() rotarod_data<-readr::read_csv(here("Analysis_Files", "Spontaneous", "Data_Rotarod_Analysis.csv")) generate_boxplots <- function(input_data, X, Y, min,ma...
d86790b86b5c66d17805f4c9803d828c3433bd4cfd5f3655490dfec33952a541
R
8,281
211
--- title: "Comparing Electrode Groups on Turnaround Effect" output: html_document date: "2025-07-03" --- ```{r setup, include=FALSE} knitr::opts_chunk$set( echo = FALSE, # don't print the code chunk warning = FALSE, # don't print warnings message = FALSE, # don't print messages fig.width = 8, # set defaul...
5c128304cf3104bf034165bdeea66112c892ca044d82ca2cf8a2f8c5faf4103f
R
8,286
272
top_markers <- function(markers, ntop=10) { c_names <- levels(markers$cluster) top <- lapply(c_names, function(x) markers$gene[markers$cluster == x][1:ntop]) top <- lapply(top, function(x) x[!is.na(x)]) names(top) <- c_names return(top) } find_common_variable_genes <- functio...
77fe126bf976c7be52e07cc8d2757f49f7751f755f114d236e0e2abb08ec5d4d
R
8,390
288
--- title: "Heatmap of spatial composition of each section" output: html_document date: "2025-06-09" --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` # Configuration ## Load library ```{r} library(data.table) library(dplyr) library(pheatmap) library(ggplot2) library(ggpubr) library(cowplot) li...
f3355991f4e24a1ed8bf793573a409e2bc9f97f4794b598b69f39bddf3e732cb
R
8,440
202
library(ggplot2) library(here) library(ggplot2) library(rlang) library(rstatix) library(nlme) library(cowplot) library(ggbeeswarm) library(ggpubr) library(ggsignif) data_box_plot<- read.csv("Data_OLM_Analysis.csv", header=TRUE) mytheme <- theme(panel.grid.minor=element_blank(), #gets rid of grey and lines in the midd...
be9d598a5a2d214f4e84c8a89466f787ae1813bcef4e4f6535b9aa39ce63fc8b
R
8,604
174
context("Testing makeNhoods function") library(miloR) ### Set up a mock data set using simulated data library(SingleCellExperiment) library(scran) library(scater) library(irlba) library(MASS) library(mvtnorm) set.seed(42) r.n <- 1000 n.dim <- 50 block1.cells <- 500 # select a set of eigen values for the covariance ma...
9d62d15fde84f1d382d5293874e387641d2d0a5b68fd28a823f94ac41154bab1
R
8,657
213
--- title: "Making comparisons for differential abundance using contrasts" author: "Mike Morgan" date: "27/01/2022" output: BiocStyle::html_document: toc_float: true BiocStyle::pdf_document: default package: miloR vignette: | %\VignetteIndexEntry{Using contrasts for differential abundance testing} %\Vignett...
c197771da6e781461071d4b9f6c04972466e7ce33c337ef2f718cbb0f77b9c0c
R
8,701
312
############################## ## Utils ############################## load_single_file <- function(file_path) { tryCatch( { args <- readRDS(file_path) do.call(Epoch, args) }, error = function(e) { file.remove(file_path) stop(paste("Error loa...
56e5298da234d99445f064ae79a86cafe9981c309d2175e4b6ad839dc0f64a96
R
8,702
282
make_plot = function(axis_type, comp_df, dat, label, scatter_cols, cor_zlim, white_borders = FALSE) { num_vars = length(levels(comp_df$x_var)) ind_mat = matrix( seq(1, (1 + num_vars)^2), nrow = 1 + num_vars, ncol = 1 + num_vars ) index_df = get_indexes(comp_df, ind_mat, num_v...
f54966ff777697636053c59b630c8633324bdd980a503bd78660bee69bc6d992
R
8,775
184
#' ### foldchange and standard error in each contrast, one plot for each protein #' # ggplot is too slow for thousands of plots #' # instead, use a vanilla R implementation (downside: more hardcoding and fiddling, upside: few seconds to plot 2000+ proteins) #' #' @param dataset todo #' #' @param pdf_file_path todo #' #...
5bb20d996c8020e8195923f36e43e95a84743432bde7c3125e13932fe71a4300
R
8,866
177
#' Control the spatial FDR #' #' Borrowing heavily from \code{cydar} which corrects for multiple-testing #' using a weighting scheme based on the volumetric overlap over hyperspheres. #' In the instance of graph neighbourhoods this weighting scheme can use graph #' connectivity or incorpate different within-neighbourho...
08f4938f8c94f95666ba196ad844d06e15b90cbb775b83d0be079b0fe5fb2204
R
8,906
253
############ # LIBRARIES # ############ library(readxl) library(dplyr) library(edgeR) library(ggplot2) library(ggrepel) library(paletteer) library(biomaRt) library(xlsx) library(clusterProfiler) library(org.Hs.eg.db) library(ComplexHeatmap) library(RColorBrewer) library(enrichplot) library(pathview) ...
3e05c015b9dfb2017c60caec0acb02964315337c13efb500a61e130ba872f1ac
R
8,912
226
cli::cli_h2("┗ [Vasc-AoP] Loading data ingestion functions") #-------------------------# ####🔺Helper functions #### #-------------------------# ## Loading the data dictionary load_data_dict <- function(path = configs$data$data_dict) { purrr::map(readxl::excel_sheets(path) |> purrr::set_names(), \(sheet) ...
29d61bbc3cb814c723ea091a9e10516a0892a438d0a43c1cd90a4ee3f3315680
R
8,914
277
######## getter/setter Methods ######## #' @title Get and set methods for Milo objects #' #' @description #' Get and set methods for Milo object slots. Generally speaking these methods #' are used internally, but they allow the user to assign their own externally computed #' values - should be used \emph{with caution}....
e82fbd1f0169edf6af517000cb1390296172d03622f12e3aca09288facfd4c38
R
8,941
252
# Simulation Parameters --------------------------------------------------- #' @importFrom MASS rlm #' @importFrom stats residuals na.exclude .lfc.evaluate <- function(truth, estimated) { # input SE <- ((truth - estimated)^2) AE <- abs(truth - estimated) RMSE <- sqrt(mean(SE, na.rm = T)) MAE <- mean(AE, na...
5e06de962f36825eec5deb59d719c82388d0e29bce7b8b348dfae597a123d848
R
8,961
224
library(EWCE) library(HPOExplorer) library(MSTExplorer) library(ggplot2) library(readr) library(data.table) library(dplyr) library(tidyr) library(scales) # for figure 7B hpo <- HPOExplorer::get_hpo() ymat <- HPOExplorer::hpo_to_matrix() ##unique genes length(unique(ymat@Dimnames[[1]])) # [1] 5180 ##unique HPO phen...
e18d77fddc208f53a18e1afc91b8a6da023aeba48b2e77fff5a784cbe482f9e6
R
8,966
171
#' placeholder title #' @param peptides todo #' @param samples todo #' #' @importFrom viridis scale_fill_viridis #' @importFrom ggpubr theme_pubr ggplot_peptide_detect_frequency = function(peptides, samples) { ## peptide detect counts, mapped to samples tib = peptides %>% filter(detect) %>% select(peptide_id, samp...
561837658d370c40e150689d03dcbac3b1b7f195f46f43cc51ae192246611f12
R
9,024
201
# doPowerVsDistance.r (Seul Ah Kim) # rm(list = ls()) AssumeLIP_PD = F rundoPower = F # Looping through monkey, NEAR, and Hemisphere for (monk in c('tyr','zen')) { for (NEAR in c(0)) { for (Hemisphere in c('R','L')) { ## Section 1 - Nearest to sort all sites based on distance in monk and hemi ##-----------...
bf212abc5cbff1e4108294c6b42f3a9161e2e785d7f15e62ae1725517b34acf9
R
9,032
217
### Grouping neighbourhoods ### #' Group neighbourhoods #' #' This function groups overlapping and concordantly DA neighbourhoods, using the louvain #' community detection algorithm. #' #' @param x A \code{\linkS4class{Milo}} object containing single-cell gene expression #' and neighbourhoods. #' @param da.res A \code...
075ef6981de3a08785deab6cd7f4415a7ef4ae1f2ec34eb8474aa2c126ab0216
R
9,145
259
# doPower.r ########################################################################### # Set basic parameters # ######################## AREA = "LIP" MONK = "tyr" # zen, tyr, both (don't use both: R calls will merge monks) MEMORY = F # T or F - can only be run with Zen, LIP (have not tested...) ALIGN = "" # "" (targ...
96fc9e4c8d4f4320d5c2911aa8133d32185dec0ab1e761245743d151fb3d71ff
R
9,216
175
ses_res = function (dat, agevar, exposure, covar, label) { covars = paste(covar, collapse = "+") res = dat %>% select(all_of(agevar), all_of(exposure), all_of(covar)) %>% tidyr::pivot_longer(all_of(agevar), names_to = "y", values_to = "yvalue") %>% mutate(y = factor(y, levels = agevar, labels = label)...
95324ce8248d99fcf031991b973fca96058d3fc9f130910b588f4266ee5eb52f
R
9,232
218
#' Calculate within neighbourhood distances #' #' This function will calculate Euclidean distances between single-cells in a #' neighbourhood using the same dimensionality as was used to construct the graph. #' This step follows the \code{makeNhoods} call to limit the number of distance #' calculations required. #' #' ...
2447765c2e55e30330df57a09932904d8bde81c5b98bd2c392ec14991644e950
R
9,249
226
library(here) library(tidyverse) library(ggvenn) library(ggplot2) library(cowplot) ### Read in ASO results --- ASO_lc_dat <-read.table(here("results/ASO/differential_taxa/L6_Luminal_Colon_Maaslin2_Sex_Site_Genotype/all_results.tsv"), header=TRUE) ASO_lc_dat_het <- ASO_lc_dat %>% filter(value=="HET") %>% filter(qval<0....
7c7ac3ff96dcb6367b4057224afea6a590bdca1e68e74759bff4f5f1f2c3f736
R
9,249
217
##' Missing value estimation using local least squares (LLS). First, ##' k variables (for Microarrya data usually the genes) are selected ##' by pearson, spearman or kendall correlation coefficients. Then ##' missing values are imputed by a linear combination of the k ##' selected variables. The optimal combination ...
b4d32776b12ac98842537cd2acae46ec5b1e3e503209d69d24a5e0656866e547
R
9,292
153
#' Import a label-free proteomics dataset from MetaMorpheus #' #' @param path the directory that contains the search results (eg; present files are AllProteinGroups.tsv, AllQuantifiedPeaks.tsv, etc.) #' @param protein_qval_threshold qvalue threshold for accepting target proteins #' @param collapse_peptide_by if multip...
b6cf3b354ce406d28c3660090158827ea731d210af3688e6c4dd85fa78fd8af6
R
9,312
183
--- output: github_document --- <!-- README.md is generated from README.Rmd. Please edit that file --> ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) ``` <img src="images/logo_UCR.png" width="300"/> <img src="images/logo_with_text-01.png" width="300"/> <img src="images/lo...
8c350d169283223ca74c5522fbc5f3164b0f3cf9fc3a6ee1c354050fbd540282
R
9,332
248
library(ggplot2) library(vegan) library(dplyr) library(rlang) library(cowplot) library(viridis) library(here) here::i_am("src/PFF/PFF_RSJensen_Beta_Diversity.R") fp <- "data/PFF/PFF_Microbiome/" metadata <- read.table(here(paste0(fp,"/starting_files/PFF_Mapping.tsv")),header=TRUE) counts <- read.table(here(paste0(fp,"...
654202ca3d7d5ee79c749f8a43589427be0ff090ff50721e06b22fd5a6774352
R
9,420
245
--- title: "Differential abundance testing with Milo" author: - Emma Dann - Mike Morgan output: BiocStyle::html_document: toc_float: true BiocStyle::pdf_document: default package: miloR vignette: | %\VignetteIndexEntry{Differential abundance testing with Milo} %\VignetteEngine{knitr::rmarkdown} %\Vign...
fcc0cff708bc8cb9fb7df872e0e94c8d455e6ca64d24d0e4273b44967d413cf2
R
9,464
222
##' This is a PCA implementation robust to outliers in a data set. It ##' can also handle missing values, it is however NOT intended to be ##' used for missing value estimation. As it is based on robustSVD we ##' will get an accurate estimation for the loadings also for ##' incomplete data or for data with outliers. ...
d67670219e328c01b43debda434614c4c7acbb779278284690abcf06e94277c5
R
9,465
260
library(ggplot2) library(dplyr) library(cowplot) library(here) library(tidyr) library(ggbeeswarm) ## Environment -- here::i_am("Rscripts/Figure_S4_ASO_PFF_Behaviors.R") ## Functions -- generate_boxplots <- function(input_data, X, Y, min,max){ data<-as.data.frame(input_data) #Ensure correct ordering of levels #...
9d19ce2372f9f468af193bab82055de33b28ec23ce81fabfbfe9c3d45d6d2b47
R
9,489
245
#' server.R # Copyright (C) Carlos Biagi Jr # # This is a 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 # Foundation; either version 3 of the License, or (at your option) any later # version. # # This software is distribute...
bef460772258b83986219a9ecce91393c82d38104cb1b30589b84af33a125f11
R
9,489
312
--- title: "Behavioral Models" output: html_document date: "2024-10-03" --- ```{r setup, include=FALSE} knitr::opts_chunk$set( echo <- FALSE, # don't print the code chunk warning <- FALSE, # don't print warnings message <- FALSE, # don't print messages fig.width <- 5, # set default width of figures fig.h...
32244e9c6220b8b31981975036713367d76036163475d0257baa10c5550fa92b
R
9,511
288
########## R scripts used to produce plots for ########## Lewin, Liao and Luo 2024 ########## Brachiopod genome and the evolution of BMP signalling #### Initially created: 02/06/2023 (Thomas D. Lewin) #### Last edited: 23/05/2024 (Thomas D. Lewin) ############################# Load general packages #################...
cab0c19ef5f687743716ced4ffa03685247bdce1fd789ab3ece9a12489cd4997
R
9,534
270
library(ggplot2) library(dplyr) library(cowplot) library(nlme) library(tidyr) setwd("C:/Users/Jacobs Laboratory/Documents/JCYang/pdbehavior/") data <- read.csv("Analysis_Files/SMT/Fecal Pellet Output (SMT) - Total_FP_output.csv",header=TRUE) data_long <- pivot_longer(data, cols = starts_wit...
c184ba7c8ccc766b51becad150373cd73ffc64133228648e9db2887a19487200
R
9,536
222
#' placeholder title #' prior to this; species %in% c("YEAST", "HUMAN") #' add extra column predictor; true for spike-in, false for rest #' @param tib todo #' @param mtitle todo #' @param universe todo #' @param plot_coords todo #' #' @importFrom pROC plot.roc coords #' @importFrom gtools mixedsort #' @importFrom colo...
d8a7a98af6ce3af9c488d523e47f1c94f0873acaeb48091f76e476f90a9ee773
R
9,572
324
--- title: "MMN amplitude" output: html_document --- ```{r echo = FALSE} # create dir to save output ifelse(!dir.exists(file.path("output/mmn_amp")), { dir.create(file.path("output/mmn_amp")) print("results will be saved in output/mmn_amp") }, "Dir exists, if you continue, i...
0b3e8102e467b7fdb396bc1e787f64583ca3943db2eb1e2af17d3c80a915fdd8
R
9,590
180
health_res = function (dat, agevar, outcome, covar, label) { covars = paste(covar, collapse = "+") res = dat %>% select(all_of(agevar), all_of(outcome), all_of(covar))%>% tidyr::pivot_longer(all_of(outcome), names_to = "y", values_to = "yvalue") %>% tidyr::pivot_longer(all_of(agevar), names_to = "x", ...
9c2d0cf2c91508047f65f0baffd636000bcb61142c2babfe2f5d083b5c29722f
R
9,693
170
--- title: "Sulcal Phenotype Network Analysis" author: "Will Snyder" output: pdf_document: default html_document: default --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE,message = FALSE, warning = FALSE) #install and load required packages if(!require("corrplot")) install.packages("corrplot"); l...
59bf40716a58d0755e14385ed23fe80427dc3b62a2e28228e36d52b08fa33d63
R
9,705
310
--- title: "iEEg Cleaning" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set( echo <- FALSE, # don't print the code chunk warning <- FALSE, # don't print warnings message <- FALSE, # don't print messages fig.width <- 5, # set default width of figures fig.height <- 8, # set d...
28da8de970d2fcf8b5f7edebc2a35ec8ec25bae7e63029dbcd3b0f2d5cdd67cc
R
9,715
163
#' Plot the variance explained of sample metadata properties in the protein-intensity matrix #' #' precondition: the input dataset$peptides tibble must have a "intensity_all_group" column, #' e.g. obtained by first calling the filter_dataset() function with parameter all_group=TRUE #' (when using this function to anal...
35f1a6f8886b5e6cc6fb04cb691954b566fadfdb3c3bb35184de6fb61fb0ab3a
R
9,727
234
library(here) library(ggplot2) library(rlang) library(rstatix) library(nlme) library(cowplot) library(ggbeeswarm) library(ggpubr) library(ggsignif) library(knitr) library(dplyr) data <- readr::read_csv(here("Analysis_Files/PFF/PFF Rotarod - PFF_Rotarod_Analysis.csv")) data$SLC_Genotype <- factor(data$SLC_Genotype, ...
41fc32ebf81a7e1d31e64b253199dddf1cee305060e070dd7e64f916395f1d49
R
9,781
215
# 01_statistic_of_gut_microbiome.R rm(list=ls()) library(dplyr) library(ggplot2) group_col=c("#982b2b","#db6968","#EDB3B3","#D0E5D0","#459943") names(group_col)=c('AD','MCI','SCD','SCS','NC') #1.meta:group-age-sex---- map=read.csv('./03_table/00_meta_all.csv',header=T) df_count_sex <- map %>% group_by(Age, gender...
b8ada12c6ea40c6271440ef24d0824c283a2f74478a79a413e66a6d70f78fe36
R
9,790
175
--- output: rmarkdown::github_document: html_preview: true toc: false --- ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, fig.path = "images/dd-", comment = "#>" ) ``` ```{r setup, include = FALSE} devtools::load_all() ``` This vignette demonstrates a basic metric for "differential...
ff8e1472b4f40e5395a6c902e2f617e72f6c08f74396aab70cf9dc1cec218122
R
9,791
224
--- title: "Comparing Electrode Groups on Turnaround Effect" output: html_document date: "2025-07-03" --- ```{r setup, include=FALSE} knitr::opts_chunk$set( echo = FALSE, # don't print the code chunk warning = FALSE, # don't print warnings message = FALSE, # don't print messages fig.width = 8, # set defa...
2c1c15da8076dcbc25dd28b347ff0c21e7f3c1792c44f378e4cbac25057d4478
R
9,806
114
--- title: "VistoSeg: Visium Histology Image Segmentation and Processing Pipeline" author: - name: Madhavi Tippani affiliation: - &libd Lieber Institute for Brain Development, Johns Hopkins Medical Campus email: madhavi.tippani@libd.org site: bookdown::bookdown_site apple-touch-sin: "icon_192.png" apple-t...
7f89f00d6b7076f2dcfb051a472dfe61a71d2b63bb8d7289fe32b9c0f103e321
R
9,857
198
#Loading required libraries#### library(ranger) library(data.table) library(ggplot2) #set.seed(42) #Uncomment to reproduce the published results #Parse args#### args = commandArgs(trailingOnly = TRUE) if(length(args) < 2){ print("Usage: Rscript GenomicPrediction_with_IncrementalFeatureSelection plinkBinaryPrefix th...
fbb2027314618e5cdf587b59f013ce88089a6d3030ff8ba93b0e2c541329b1f4
R
9,950
240
#' Identify post-hoc neighbourhood marker genes #' #' This function will perform differential gene expression analysis on #' groups of neighbourhoods. Adjacent and concordantly DA neighbourhoods can be defined using #' \code{groupNhoods} or by the user. Cells \emph{between} these #' aggregated groups are compared. For...
f9407c82e7192cd0bc95168fb0061a6707f2992594b0782386076fc6e70eae75
R
9,974
248
if(!require(devtools)) install.packages("devtools") devtools::install_github("kassambara/ggpubr") setTimeLimit(100000); setSessionTimeLimit(10000) library(ggplot2) library("cowplot") library("gridExtra") library(ggpubr) library(plyr) # load data data <- read.csv(file="//lexport/iss01.charpier/analyses/stephen.whitma...
87d0e360fa10e8920cbf622c4c3a1f28e8adad1d45a3f027523d1216afc6d923
R
9,991
248
if(!require(devtools)) install.packages("devtools") devtools::install_github("kassambara/ggpubr") setTimeLimit(100000); setSessionTimeLimit(10000) library(ggplot2) library("cowplot") library("gridExtra") library(ggpubr) library(plyr) # load data data <- read.csv(file="//lexport/iss01.charpier/analyses/stephen.whitma...
f1c8f715a6a9d7ffdf8c53442f8fc7716591c13e041b40ee75345039ce7f35f3
R
10,008
295
library(VennDiagram) library(dplyr) library(VennDiagram) library(readr) library(data.table) ados <- fread("ADOS_mri_cor_anova_outlier_removed2.tsv", sep = "auto", encoding = "UTF-8") %>% .[, .(feature, feature_pvalue)] cars <- fread("CARS_mri_cor_anova_outlier_rem...
ebf386f6f93b482a1195b0afc95d31f343513b0344d52cff9d2f540a950c850e
R
10,033
323
--- title: "LL10 Cleaning" output: html_document date: '2022-08-02' --- ```{r setup, include=FALSE} knitr::opts_chunk$set( echo <- FALSE, # don't print the code chunk warning <- FALSE, # don't print warnings message <- FALSE, # don't print messages fig.width <- 5, # set default width of figures fig.heig...
76b123eeb81d8b9a07e44fe85b426495621256682fa3691cbd5f57e1b5988a97
R
10,045
283
library(Maaslin2) library(funrar) library(dplyr) library(ggplot2) library(cowplot) library(here) library(glue) library(tidyverse) library(circlize) here::i_am("Rscripts/ASO/ASO_L2_L6_Maaslin2.R") ### Note: First remove "#Constructed from biom file row" ### Fraction ASV table into respective subsets --- # Load metada...
802764717ddf6aabcc016a9ca4c7f1d314e32224b875e74fbc410addb1374abf
R
10,068
323
```{r setup, include=FALSE} knitr::opts_chunk$set( echo = FALSE, # don't print the code chunk warning = FALSE, # don't print warnings message = FALSE, # don't print messages fig.width = 8, # set default width of figures fig.height = 6, # set default height of figures fig.align = "center", # always a...
0d994f4bb3ebbd595a280122d0a2a25286faaaa850cfdf515005b9c28542ebd9
R
10,096
328
# This test will try to download actual data, ensure network connectivity # and that the downloader is configured correctly. # Initialize the downloader dl <- EpochDownloader() test_that("EpochDownloader initialization and listing", { expect_s4_class(dl, "EpochDownloader") # Check if names(dl) returns a character...
4dbe4b459c91cae2b0a9bbd4ade0451185cd765de4110ee61ce183af4a3a6c89
R
10,144
217
#install.packages(c("seqinr", "plyr", "openxlsx", "randomForestSRC", "glmnet", "RColorBrewer")) #install.packages(c("ade4", "plsRcox", "superpc", "gbm", "plsRglm", "BART", "snowfall")) #install.packages(c("caret", "mboost", "e1071", "BART", "MASS", "pROC", "xgboost")) #if (!require("BiocManager", quietly = TRUE)) ...
ab896507036269443bde0125eb8ec7924240d3fba24883aac44befa0ab3c04a0
R
10,145
348
#' @include zzz.R #' NULL #' Get list of available datasets #' #' @return A dataframe with available Seurat datasets. Rownames of the dataframe are the actual package names #' \describe{ #' \item{Dataset}{Name of dataset, usable for other functions in SeuratData (eg. \code{\link{InstallData}})} #' \item{Version}{V...
2f2464728cd49430f5becdf149619fedb00fda49f02beb4287514a4c852b4dd4
R
10,239
248
if(!require(devtools)) install.packages("devtools") devtools::install_github("kassambara/ggpubr") setTimeLimit(100000); setSessionTimeLimit(10000) library(ggplot2) library("cowplot") library("gridExtra") library(ggpubr) library(plyr) # load data data <- read.csv(file="//lexport/iss01.charpier/analyses/st...
0d93dfdbe2a9e696c6e76b7d2f9d64d5c936cfa7a097548fe2484e974ffa4d85
R
10,297
248
# Load packages ----------------------------------- library(tidyverse) library(ggpubr) library(dplyr) library(Seurat) library(ggplot2) library(writexl) library(paletteer) library(readxl) library(writexl) library(qs) library(ggrastr) library(cowplot) library(openxlsx) library(SingleR) # Organize environment ----------...
7e919acd2b580126e376adab7d10a1ea95de43b714020ff99f796156844ea846
R
10,308
252
setwd("~/Documents/yu_lab/kernels_in_GP/Kick_data/") library(tidyverse) library(multcomp) source("src/scales.R") res <- read_csv("results/metrics_all_env.csv") ### PCs vs. SNPs --------------- pcs_snps <- res %>% filter(Data %in% c("G", "A")) res_pcs_snps <- pcs_snps |> mutate(Genetics = relevel(factor(Genet...
a6e36f06f86aa7ec5d97ed5a3364db9c0e4587c2ad46f1406d694567669a18f2
R
10,412
179
name="MergeGLU.V20241022" outdir = "/cluster/share/atac_group/PublishedData/HumanMouseMacaque/GLUintegrated" setwd(outdir) homoGeneDir = "/cluster/share/atac_group/PublishedData" oneToOneOrthGeneTb = readr::read_tsv(paste0(homoGeneDir, "/mart_export.humanMacaqeMouse.oneToOneOrth.ensembl91.20220428.txt")) head(oneT...
7c48055ebd0f2bab0e6ed1741793c05a4ec62364a0201ce9016b79f9f5f5ba87
R
10,459
246
library(Maaslin2) library(funrar) library(dplyr) library(ggplot2) library(cowplot) library(here) library(glue) library(tidyverse) here::i_am("src/PFF/PFF_L2_L6_Maaslin2.R") ### Note: First remove "#Constructed from biom file row" ### Fraction ASV table into respective subsets --- # Load metadata once metadata <- rea...
98ebff14fafa9390bcb466610192b11ee1e1eb005bd3dfc654d35b941b3eaeca
R
10,460
283
## libraries ## library(tidyverse) library(ggplot2) library(doParallel) library(parallel) library(foreach) library(here) library(fs) library(scales) library(brms) ## hand written functions ## source(path(here(), "R", 'mutate_cond.R')) source(path(here(), "R", "bayesian_helpers.R")) ### Load and Prep DF ### # load c...
b8c466f7ffaad7640e4d836402eafd2eac3c19b5afbd2eada0fce2a63ad25d95
R
10,460
225
context("Testing nhood marker gene function") library(miloR) ### Set up a mock data set using simulated data library(SingleCellExperiment) library(scran) library(scater) library(irlba) library(MASS) library(mvtnorm) set.seed(42) r.n <- 1000 n.dim <- 50 block1.cells <- 500 # select a set of eigen values for the covari...
164fdfea49e0a1eae7bfc7dbcb473bc0bee76934db9c9372b847c204d92876bc
R
10,469
282
## libraries ## library(tidyverse) library(ggplot2) library(doParallel) library(parallel) library(foreach) library(here) library(fs) library(scales) library(brms) ## hand written functions ## source(path(here(), "R", 'mutate_cond.R')) source(path(here(), "R", "bayesian_helpers.R")) ### Load and Prep DF ### # load c...
cd6eca5dfa5aa0f8a85e994eb0b9faac04133ea4d887daf52f96a1e4be6b1f89
R
10,494
344
--- title: "LL12 Cleaning" output: html_document date: '2022-10-31' --- ```{r setup, include=FALSE} knitr::opts_chunk$set( echo <- FALSE, # don't print the code chunk warning <- FALSE, # don't print warnings message <- FALSE, # don't print messages fig.width <- 5, # set default width of figures fig.heigh...
583e41c67ea23307cda5b679293849529bbc1f22311836665c305290aa5d4681
R
10,566
287
--- title: "Rising Falling Supplementary Tables" output: html_document date: "2024-12-09" --- ```{r setup, include=FALSE} knitr::opts_chunk$set( echo = FALSE, # don't print the code chunk warning = FALSE, # don't print warnings message = FALSE, # don't print messages fig.width = 8, # set default width of f...
a4c66a06979ea2d5329aaaea31d6f4e1f96001a69b8690ae8c9dbdd3a632264b
R
10,638
245
#' Define neighbourhoods on a graph (fast) #' #' This function randomly samples vertices on a graph to define neighbourhoods. #' These are then refined by either computing the median profile for the neighbourhood #' in reduced dimensional space and selecting the nearest vertex to this #' position (refinement_scheme = "...
2cde294ea74db95753ab5f58ba071138a2ea42e07399660140195757362576e6
R
10,700
303
# ==== TODO # * Make sure BLUP/BSLMM weights are being scaled properly based on MAF suppressMessages(library("optparse")) suppressMessages(library('plink2R')) suppressMessages(library('glmnet')) suppressMessages(library('methods')) suppressMessages(library('Seurat')) suppressMessages(library('caret')) option_list = li...
ccb23d889ecd0e1faca721c92000028d0ac7d686edfdf644f9086a9e3b61c5c8
R
10,715
339
--- title: "Cleaning BJH021" output: html_document date: '2022-11-01' --- ```{r setup, include=FALSE} knitr::opts_chunk$set( echo <- FALSE, # don't print the code chunk warning <- FALSE, # don't print warnings message <- FALSE, # don't print messages fig.width <- 5, # set default width of figures fig.he...
d9fa553b0c0648bbeaeee29e8e121a619b90f7e58a9196637c6f9387886ac778
R
10,775
510
# ---- libs ---- library("arrow") # reading in parquet data library("dplyr") # piping and manipulation of data library("tibble") # prettier data.frames library("ggplot2") # plotting library("ggthemes") # plotting library("knitr") # to print kable(.) tables library("tidyr") # pivot_wider() function library("readr") # ...
cab9b97ab43d5f53e059cc46954be54a15fd3f5072a4af35153db2fc41357bc8
R
10,793
245
#install.packages("ggplot2") library("ggplot2") library("grid") library("magrittr") library("viridis") #install.packages("raster") library("raster") library("readxl") library(ggplot2) library(viridisLite) library(grid) library("cowplot") library("cowplot") #install.packages("scales") library("scales") if (!requireNa...